2016-12-11 16 views
3

私はeirslett:frontend-maven-pluginでパッケージ化したフロントプロジェクトモジュールを持つmavenプロジェクトを持っています。ローカルでうまく動作しますが、gitlab.comではビルドに失敗しました。eirslett:frontend-maven-pluginを使用してgitlab.com上でmavenビルドを実行

私はこの.gitlab-ci.ymlでビルドを起動:

image: maven:3.3.9-jdk-8-onbuild 

build: 
    script: "mvn clean install -B -X" 

そして、これのpom.xml:gitlab.comオン

<?xml version="1.0" encoding="UTF-8"?> 
<project xmlns="http://maven.apache.org/POM/4.0.0" 
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 
    <modelVersion>4.0.0</modelVersion> 

    <groupId>fr.nev.oms</groupId> 
    <artifactId>oms-frontend</artifactId> 
    <packaging>jar</packaging> 

    <parent> 
     <groupId>fr.nev.oms</groupId> 
     <artifactId>myproject</artifactId> 
     <version>1.0.0-SNAPSHOT</version> 
    </parent> 

    <build> 
    <plugins> 
     <plugin> 
     <groupId>com.github.eirslett</groupId> 
     <artifactId>frontend-maven-plugin</artifactId> 
     <version>1.3</version> 
     <configuration> 
      <!--<configuration>--> 
       <nodeVersion>v4.4.7</nodeVersion> 
       <npmVersion>3.10.5</npmVersion> 
      <!--</configuration>--> 
      <environmentVariables> 
       <NODE_ENV>production</NODE_ENV> 
       <API_URL></API_URL> 
       <APP_VERSION></APP_VERSION> 
      </environmentVariables> 
     </configuration> 
     <executions> 

      <execution> 
      <id>install node and npm</id> 
      <goals> 
       <goal>install-node-and-npm</goal> 
      </goals> 

      </execution> 

      <execution> 
      <id>npm install</id> 
      <goals> 
       <goal>npm</goal> 
      </goals> 
      <configuration> 
       <arguments>install</arguments> 
      </configuration> 
      </execution> 

      <execution> 
      <id>npm run build</id> 
      <goals> 
       <goal>npm</goal> 
      </goals> 
      <configuration> 
       <arguments>run build</arguments> 
      </configuration> 
      </execution> 

     </executions> 
     </plugin> 
    </plugins> 
    </build> 
</project> 

を、私はこのトレースを持っている:

[DEBUG] Configuring mojo com.github.eirslett:frontend-maven-plugin:1.3:install-node-and-npm from plugin realm ClassRealm[plugin>com.github.eirslett:frontend-maven-plugin:1.3, parent: [email protected]] 
[DEBUG] Configuring mojo 'com.github.eirslett:frontend-maven-plugin:1.3:install-node-and-npm' with basic configurator --> 
[DEBUG] (f) environmentVariables = {API_URL=null, APP_VERSION=null, NODE_ENV=production} 
[DEBUG] (f) nodeDownloadRoot = https://nodejs.org/dist/ 
[DEBUG] (f) nodeVersion = v4.4.7 
[DEBUG] (f) npmDownloadRoot = http://registry.npmjs.org/npm/-/ 
[DEBUG] (f) npmVersion = 3.10.5 
[DEBUG] (f) project = MavenProject: fr.nev.oms:oms-frontend:1.0.0-SNAPSHOT @ /builds/nieven/on-my-shelves/oms-frontend/pom.xml 
[DEBUG] (f) repositorySystemSession = [email protected] 
[DEBUG] (f) session = [email protected] 
[DEBUG] (f) skip = false 
[DEBUG] (f) skipTests = false 
[DEBUG] (f) workingDirectory = /builds/nieven/on-my-shelves/oms-frontend 
[DEBUG] (f) execution = com.github.eirslett:frontend-maven-plugin:1.3:install-node-and-npm {execution: install node and npm} 
[DEBUG] -- end configuration -- 
[INFO] Installing node version v4.4.7 
[DEBUG] Creating install directory /builds/nieven/on-my-shelves/oms-frontend/node 
[DEBUG] Creating temporary directory /builds/nieven/on-my-shelves/oms-frontend/node/tmp 
[INFO] Downloading https://nodejs.org/dist/v4.4.7/node-v4.4.7-linux-x64.tar.gz to /root/.m2/repository/com/github/eirslett/node/4.4.7/node-4.4.7-linux-x64.tar.gz 
[INFO] No proxies configured 
[INFO] No proxy was configured, downloading directly 
[INFO] Unpacking /root/.m2/repository/com/github/eirslett/node/4.4.7/node-4.4.7-linux-x64.tar.gz into /builds/nieven/on-my-shelves/oms-frontend/node/tmp 
[INFO] Copying node binary from /builds/nieven/on-my-shelves/oms-frontend/node/tmp/node-v4.4.7-linux-x64/bin/node to /builds/nieven/on-my-shelves/oms-frontend/node/node 
[DEBUG] Deleting temporary directory /builds/nieven/on-my-shelves/oms-frontend/node/tmp 
[INFO] Installed node locally. 
[INFO] Installing npm version 3.10.5 
[INFO] Downloading http://registry.npmjs.org/npm/-/npm-3.10.5.tgz to /root/.m2/repository/com/github/eirslett/npm/3.10.5/npm-3.10.5.tar.gz 
[INFO] No proxies configured 
[INFO] No proxy was configured, downloading directly 
[INFO] Unpacking /root/.m2/repository/com/github/eirslett/npm/3.10.5/npm-3.10.5.tar.gz into /builds/nieven/on-my-shelves/oms-frontend/node/node_modules 
[INFO] Installed npm locally. 
[INFO] 
[INFO] --- frontend-maven-plugin:1.3:npm (npm install) @ oms-frontend --- 
[DEBUG] Configuring mojo com.github.eirslett:frontend-maven-plugin:1.3:npm from plugin realm ClassRealm[plugin>com.github.eirslett:frontend-maven-plugin:1.3, parent: [email protected]] 
[DEBUG] Configuring mojo 'com.github.eirslett:frontend-maven-plugin:1.3:npm' with basic configurator --> 
[DEBUG] (f) arguments = install 
[DEBUG] (f) environmentVariables = {API_URL=null, APP_VERSION=null, NODE_ENV=production} 
[DEBUG] (f) npmInheritsProxyConfigFromMaven = true 
[DEBUG] (f) project = MavenProject: fr.nev.oms:oms-frontend:1.0.0-SNAPSHOT @ /builds/nieven/on-my-shelves/oms-frontend/pom.xml 
[DEBUG] (f) repositorySystemSession = [email protected] 
[DEBUG] (f) session = [email protected] 
[DEBUG] (f) skip = false 
[DEBUG] (f) skipTests = false 
[DEBUG] (f) workingDirectory = /builds/nieven/on-my-shelves/oms-frontend 
[DEBUG] (f) execution = com.github.eirslett:frontend-maven-plugin:1.3:npm {execution: npm install} 
[DEBUG] -- end configuration -- 
[INFO] Running 'npm install' in /builds/nieven/on-my-shelves/oms-frontend 
[INFO] ------------------------------------------------------------------------ 
[INFO] Reactor Summary: 
[INFO] 
[INFO] myproject .......................................... SUCCESS [ 3.446 s] 
[INFO] oms-frontend ....................................... FAILURE [ 8.628 s] 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 12.254 s 
[INFO] Finished at: 2016-12-11T12:14:19+00:00 
[INFO] Final Memory: 14M/197M 
[INFO] ------------------------------------------------------------------------ 
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.3:npm (npm install) on project oms-frontend: Execution npm install of goal com.github.eirslett:frontend-maven-plugin:1.3:npm failed. NullPointerException -> [Help 1] 
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.3:npm (npm install) on project oms-frontend: Execution npm install of goal com.github.eirslett:frontend-maven-plugin:1.3:npm failed. 
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212) 
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) 
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) 
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116) 
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80) 
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) 
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128) 
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307) 
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193) 
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106) 
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863) 
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288) 
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:199) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:498) 
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) 
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) 
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) 
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) 
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution npm install of goal com.github.eirslett:frontend-maven-plugin:1.3:npm failed. 
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:145) 
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207) 
    ... 20 more 
Caused by: java.lang.NullPointerException 
    at java.lang.ProcessEnvironment.validateValue(ProcessEnvironment.java:120) 
    at java.lang.ProcessEnvironment.access$400(ProcessEnvironment.java:61) 
    at java.lang.ProcessEnvironment$Value.valueOf(ProcessEnvironment.java:203) 
    at java.lang.ProcessEnvironment$StringEnvironment.put(ProcessEnvironment.java:243) 
    at java.lang.ProcessEnvironment$StringEnvironment.put(ProcessEnvironment.java:221) 
    at java.util.AbstractMap.putAll(AbstractMap.java:281) 
    at com.github.eirslett.maven.plugins.frontend.lib.ProcessExecutor.createProcessBuilder(ProcessExecutor.java:103) 
    at com.github.eirslett.maven.plugins.frontend.lib.ProcessExecutor.<init>(ProcessExecutor.java:37) 
    at com.github.eirslett.maven.plugins.frontend.lib.NodeExecutor.<init>(NodeExecutor.java:20) 
    at com.github.eirslett.maven.plugins.frontend.lib.NodeTaskExecutor.execute(NodeTaskExecutor.java:58) 
    at com.github.eirslett.maven.plugins.frontend.mojo.NpmMojo.execute(NpmMojo.java:62) 
    at com.github.eirslett.maven.plugins.frontend.mojo.AbstractFrontendMojo.execute(AbstractFrontendMojo.java:89) 
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134) 
    ... 21 more 
[ERROR] 

この問題の解決方法についてご意見はありますか?

答えて

0

私は似たような問題を抱えていました(LinuxでこのNullPointerで勝敗して失敗しました)。frontend-maven-pluginを最新のもの(私の場合は1.4)に更新しました。

<plugin> 
    <groupId>com.github.eirslett</groupId> 
    <artifactId>frontend-maven-plugin</artifactId> 
    <version>1.4</version> 
関連する問題