maven "Compilation failure" but no issue displayed - maven-compiler-plugin

When running mvn install the build fails intermittently with Compilation failure, particuarly at AbstractCompilerMojo.java:1165 however no warnings or errors are displayed. Setting <verbose>true</verbose> in the maven-compiler-plugin has no effect.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.209 s (Wall Clock)
[INFO] Finished at: 2018-03-13T16:49:32Z
[INFO] Final Memory: 147M/611M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project PROJECTNAME: Compilation failure -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project PROJECTNAME: Compilation failure
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:213)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:200)
at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:196)
at java.util.concurrent.FutureTask.run (FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:511)
at java.util.concurrent.FutureTask.run (FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:624)
at java.lang.Thread.run (Thread.java:748)
Caused by: org.apache.maven.plugin.compiler.CompilationFailureException: Compilation failure
at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute (AbstractCompilerMojo.java:1165)
at org.apache.maven.plugin.compiler.CompilerMojo.execute (CompilerMojo.java:168)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:200)
at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:196)
at java.util.concurrent.FutureTask.run (FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:511)
at java.util.concurrent.FutureTask.run (FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:624)
at java.lang.Thread.run (Thread.java:748)
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

I managed to invoke javac manually with the same arguments and the following error was output
The system is out of resources.
Consult the following stack trace for details.
java.lang.StackOverflowError
at com.sun.tools.javac.code.Type.map(Type.java:220)
at com.sun.tools.javac.code.Type.map(Type.java:220)
at com.sun.tools.javac.code.Type.map(Type.java:220)
at com.sun.tools.javac.code.Type.map(Type.java:220)
at com.sun.tools.javac.code.Type.map(Type.java:220)
...
The issue can be solved by increasing the stack size to say 4 MB with -J-Xss4m
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<inherited>true</inherited>
<configuration>
<compilerArgs>
<arg>-J-Xss4m</arg>
</compilerArgs>
</configuration>
</plugin>
The root cause of the issue was a 3000-line Map field initialization. So the real solution was to move that data to a file.
Similar to this issue: https://github.com/google/guava/issues/2234

pass argument "-verbose" to compilerArgs as shown below to get details of the failure.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<verbose>false</verbose>
<fork>true</fork>
<source>${jdk.version}</source>
<target>${jdk.version}</target>
<!-- false means true here -->
<useIncrementalCompilation>true</useIncrementalCompilation>
<compilerArgs>
<arg>-J-Xss512m</arg>
<arg>-J-noverify</arg>
<arg>-verbose</arg>
<arg>-Xlint:all,-options,-path</arg>
</compilerArgs>
</configuration>
</plugin>

Related

Maven. Unable to compile module with groovy-eclipse compiler

I'm trying to perform migration of my project from java 8 to java 11.
What I did in root pom.xml:
Replaced
<source>8</source>
<target>8</target>
With
<release>11</release>
Configured maven-toolchain-plugin
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-toolchains-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>toolchain</goal>
</goals>
</execution>
</executions>
<configuration>
<toolchains>
<jdk>
<version>[11,12)</version>
</jdk>
</toolchains>
</configuration>
</plugin>
After that modules which don't use groovy compiled without problems. But few modules in this project use groovy.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<compilerId>groovy-eclipse-compiler</compilerId>
</configuration>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-compiler</artifactId>
<version>3.6.0-03</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-batch</artifactId>
<version>3.0.3-01</version>
</dependency>
</dependencies>
</plugin>
I get following error:
[INFO] Using Groovy-Eclipse compiler to compile both Java and Groovy files
[DEBUG] Compiling 15 source files to D:\Projects\dxcore-java11\fix-markets\fix-server-tests\target\classes
[DEBUG] Command line options:
[DEBUG] -cp D:\Projects\dxcore-java11\fix-markets\target\classes;C:\Users\turbanov\.m2\repository\org\codehaus\groovy\groovy\3.0.3\groovy-3.0.3.jar;<a_lot_of_jars_here>; -d D:\Projects\dxcore-java11\fix-markets\target\classes -s D:\Projects\dxcore-java11\fix-markets\target\generated-sources\annotations -g -encoding UTF8 --release 11 -nowarn D:\Projects\dxcore-java11\fix-markets\src\client\TestClient.groovy
[INFO] Using Groovy-Eclipse compiler to compile both Java and Groovy files
[DEBUG] Compiling 15 source files to D:\Projects\dxcore-java11\fix-markets\fix-server-tests\target\classes
[INFO] Compiling in a forked process using C:\Users\turbanov\.m2\repository\org\codehaus\groovy\groovy-eclipse-batch\3.0.3-01\groovy-eclipse-batch-3.0.3-01.jar
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] Failure executing groovy-eclipse compiler:
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project fix-server-tests: Compilation failure
Failure executing groovy-eclipse compiler:
option --release is supported only when run with JDK 9 or above
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:190)
at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:186)
at java.util.concurrent.FutureTask.run (FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:511)
at java.util.concurrent.FutureTask.run (FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:624)
at java.lang.Thread.run (Thread.java:748)
Caused by: org.apache.maven.plugin.compiler.CompilationFailureException: Compilation failure
What is wrong with my configuration? Does groovy-eclipse-compiler supports such configuration?
What is strange is that if I replace <release> back to use <source>11</source>/<target>8</target> all build fine.
I'm trying to migration my project from java 8 to java 11.
I want to use new language features and new API.
The simplest solution for this migration would be to use Java 11 for Maven invocation. There is no need to use maven-toolchains-plugin in this case.
As for the errors reported by the groovy-eclipse-compiler - every example in the Release new version of Groovy Eclipse Maven plugin to support Java 11 issue is using maven-compiler-plugin with either explicit configuration like this:
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>11</source>
<target>11</target>
</configuration>
</plugin>
or with implicit configuration like this:
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
</properties>
I suggest to follow these examples and drop <release> configuration completely.
Another suggestion would be to use maven-enforcer-plugin to enforce the minimum version of Java used for Maven invocation.
As #emiles commented above:
Yes, I see now after some research that groovy-eclipse-compiler is not toolchain-aware. I have created this github issue to track the addition of this capability: github.com/groovy/groovy-eclipse/issues/1232
He put the fix in on 13 March into groovy-eclipse-compiler 3.7.0. I was having this selfsame issue on an AEM build, compiling groovy on an AEM Cloud Manager install that has both JDK8 and JDK11 installed, using the maven-toolchains-plugin to switch.
Upgrading to groovy-eclipse-compiler 3.7.0 and groovy-eclipse-batch 3.0.7-02 fixed the issue for me.

spring-boot-maven-plugin spring-boot.run.main-class is ignored (Groovy)

I have a spring-boot application with 2 main class as follows.
package org.arunm.springwebfluxrestservice.client
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.builder.SpringApplicationBuilder
#SpringBootApplication
class ReactiveClientApplication {
public static void main(String[] args) {
new SpringApplicationBuilder(ReactiveClientApplication)
.properties(Collections.singletonMap("server.port","8081"))
.run(args)
}
}
and
package org.arunm.springwebfluxrestservice.webservice
import org.springframework.boot.SpringApplication
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.web.bind.annotation.RestController
#SpringBootApplication
#RestController
class ReactiveServiceApplication {
public static void main(String[] args) {
SpringApplication.run(ReactiveServiceApplication)
}
}
spring-boot-maven-plugin is already included in pom.xml
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
I am trying to start ReactiveClientApplication using
mvn spring-boot:run -Dspring-boot.run.main-class=org.arunm.springwebfluxrestservice.client.ReactiveClientApplication
I get the error
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.297 s
[INFO] Finished at: 2020-05-14T16:27:38+10:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.2.7.RELEASE:run (default-cli) on project spring-webflux-rest-service: Execution default-cli of goal org.springframework.boot:spring-boot-maven-plugin:2.2.7.RELEASE:run failed: Unable to find a single main class from the following candidates [org.arunm.springwebfluxrestservice.webservice.ReactiveServiceApplication, org.arunm.springwebfluxrestservice.client.ReactiveClientApplication] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.2.7.RELEASE:run (default-cli) on project spring-webflux-rest-service: Execution default-cli of goal org.springframework.boot:spring-boot-maven-plugin:2.2.7.RELEASE:run failed: Unable to find a single main class from the following candidates [org.arunm.springwebfluxrestservice.webservice.ReactiveServiceApplication, org.arunm.springwebfluxrestservice.client.ReactiveClientApplication]
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal org.springframework.boot:spring-boot-maven-plugin:2.2.7.RELEASE:run failed: Unable to find a single main class from the following candidates [org.arunm.springwebfluxrestservice.webservice.ReactiveServiceApplication, org.arunm.springwebfluxrestservice.client.ReactiveClientApplication]
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:148)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
What am I doing wrong here ?
Based on the plugin documentation documentation for mainClass parameter it is not specified whether it can be run from command line. For other parameters it has been mentioned specifically.
So one could use maven profile with main class configuration.
<profiles>
<profile>
<id>client</id>
<properties>
<spring.boot.mainclass>org.arunm.springwebfluxrestservice.client.ReactiveClientApplication</spring.boot.mainclass>
</properties>
</profile>
<profile>
<id>service</id>
<properties>
<spring.boot.mainclass>org.arunm.springwebfluxrestservice.webservice.ReactiveServiceApplication</spring.boot.mainclass>
</properties>
</profile>
</profiles>
Spring Boot Maven Plugin
<configuration>
<mainClass>${spring.boot.mainclass}</mainClass>
</configuration>
Console
mvn spring-boot:run -P client
Although this also works for me but it could be that maven is doing property replacement for the configuration parameter but I'm not 100% sure
mvn spring-boot:run -Dspring.boot.mainclass=org.arunm.springwebfluxrestservice.client.ReactiveClientApplication
References
SpringBoot: Unable to find a single main class from the following candidates
https://www.baeldung.com/spring-boot-main-class

Error trying to compile google closure-compiler using maven

I am trying to compile the closure-compiler, following the instructions here:
https://github.com/google/closure-compiler
javac -version
javac 1.8.0_232
mvn --version
Apache Maven 3.3.9
Maven home: /usr/share/maven
Java version: 1.8.0_232, vendor: Private Build
Java home: /usr/lib/jvm/java-8-openjdk-amd64/jre
Default locale: en_US, platform encoding: ANSI_X3.4-1968
OS name: "linux", version: "3.10.0-1062.7.1.el7.x86_64", arch: "amd64", family: "unix"
When I execute: mvn -DskipTests -pl externs/pom.xml,pom-main.xml,pom-main-shaded.xml
.
.
.
[INFO] --- maven-compiler-plugin:3.5.1:compile (default-compile) # closure-compiler ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 763 source files to /workspace/closure-compiler/target/classes
[INFO] -------------------------------------------------------------
[WARNING] COMPILATION WARNING :
[INFO] -------------------------------------------------------------
[WARNING] /workspace/closure-compiler/src/com/google/javascript/jscomp/ant/AntErrorManager.java:[19,35] [deprecation] BasicErrorManager in com.google.javascript.jscomp has been deprecated
[WARNING] /workspace/closure-compiler/src/com/google/javascript/refactoring/FixingErrorManager.java:[30,35] [deprecation] BasicErrorManager in com.google.javascript.jscomp has been deprecated
[WARNING] /workspace/closure-compiler/src/com/google/javascript/jscomp/deps/JsFileFullParser.java:[27,35] [deprecation] BasicErrorManager in com.google.javascript.jscomp has been deprecated
[WARNING] /workspace/closure-compiler/src/com/google/javascript/jscomp/ant/AntErrorManager.java:[19,35] [deprecation] BasicErrorManager in com.google.javascript.jscomp has been deprecated
[WARNING] /workspace/closure-compiler/src/com/google/javascript/refactoring/FixingErrorManager.java:[30,35] [deprecation] BasicErrorManager in com.google.javascript.jscomp has been deprecated
[WARNING] /workspace/closure-compiler/src/com/google/javascript/jscomp/deps/JsFileFullParser.java:[27,35] [deprecation] BasicErrorManager in com.google.javascript.jscomp has been deprecated
[WARNING] /workspace/closure-compiler/src/com/google/javascript/jscomp/ant/AntErrorManager.java:[19,35] [deprecation] BasicErrorManager in com.google.javascript.jscomp has been deprecated
[WARNING] /workspace/closure-compiler/src/com/google/javascript/refactoring/FixingErrorManager.java:[30,35] [deprecation] BasicErrorManager in com.google.javascript.jscomp has been deprecated
[WARNING] /workspace/closure-compiler/src/com/google/javascript/jscomp/deps/JsFileFullParser.java:[27,35] [deprecation] BasicErrorManager in com.google.javascript.jscomp has been deprecated
[INFO] 9 warnings
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Closure Compiler Externs ........................... SUCCESS [ 2.195 s]
[INFO] Closure Compiler Main .............................. SUCCESS [ 1.312 s]
[INFO] Closure Compiler ................................... FAILURE [ 33.755 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 39.156 s
[INFO] Finished at: 2020-01-09T16:51:45+00:00
[INFO] Final Memory: 18M/61M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile (default-compile) on project closure-compiler: Compilation failure: Compilation failure:
[ERROR] /workspace/closure-compiler/src/com/google/javascript/jscomp/ant/AntErrorManager.java:[19,35] [deprecation] BasicErrorManager in com.google.javascript.jscomp has been deprecated
[ERROR] /workspace/closure-compiler/src/com/google/javascript/refactoring/FixingErrorManager.java:[30,35] [deprecation] BasicErrorManager in com.google.javascript.jscomp has been deprecated
[ERROR] /workspace/closure-compiler/src/com/google/javascript/jscomp/deps/JsFileFullParser.java:[27,35] [deprecation] BasicErrorManager in com.google.javascript.jscomp has been deprecated
[ERROR] /workspace/closure-compiler/src/com/google/javascript/jscomp/ant/AntErrorManager.java:[19,35] [deprecation] BasicErrorManager in com.google.javascript.jscomp has been deprecated
[ERROR] /workspace/closure-compiler/src/com/google/javascript/refactoring/FixingErrorManager.java:[30,35] [deprecation] BasicErrorManager in com.google.javascript.jscomp has been deprecated
[ERROR] /workspace/closure-compiler/src/com/google/javascript/jscomp/deps/JsFileFullParser.java:[27,35] [deprecation] BasicErrorManager in com.google.javascript.jscomp has been deprecated
[ERROR] /workspace/closure-compiler/src/com/google/javascript/jscomp/ant/AntErrorManager.java:[19,35] [deprecation] BasicErrorManager in com.google.javascript.jscomp has been deprecated
[ERROR] /workspace/closure-compiler/src/com/google/javascript/refactoring/FixingErrorManager.java:[30,35] [deprecation] BasicErrorManager in com.google.javascript.jscomp has been deprecated
[ERROR] /workspace/closure-compiler/src/com/google/javascript/jscomp/deps/JsFileFullParser.java:[27,35] [deprecation] BasicErrorManager in com.google.javascript.jscomp has been deprecated
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :closure-compiler
This is happening on an Ubuntu 16.04.2 LTS, but I experienced the same issue on centos 7.
Can someone explain what's going on?
Update:
I modified the pom.xml and removed the deprecation
<compilerArgument>-Xlint:unchecked,deprecation,fallthrough,finally</compilerArgument>
Now the build fails with:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project closure-compiler: Compilation failure -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project closure-compiler: Compilation failure
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
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:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.plugin.compiler.CompilationFailureException: Compilation failure
at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute (AbstractCompilerMojo.java:1224)
at org.apache.maven.plugin.compiler.CompilerMojo.execute (CompilerMojo.java:187)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
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:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:4
06)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
No idea if this is the same issue but I had something similar with Ubuntu 18.04. Turns out I only had the JRE installed and not the JDK. After running sudo apt install openjdk-8-jdk it compiled, no problem.
This is the plugin i used in maven for minification of Javascript part of my project. It minifies all .js files and overwrites them at build phase. I hope this will help
<plugin>
<groupId>com.github.blutorange</groupId>
<artifactId>closure-compiler-maven-plugin</artifactId>
<version>2.16.0</version>
<configuration>
<baseSourceDir>${project.basedir}\src\main\resources\public\assets</baseSourceDir>
<baseTargetDir>${project.build.directory}\classes\public\assets</baseTargetDir>
</configuration>
<executions>
<execution>
<id>default-minify</id>
<configuration>
<encoding>UTF-8</encoding>
<sourceDir></sourceDir>
<outputFilename>#{path}/#{basename}.#{extension}</outputFilename>
<targetDir></targetDir>
<includes>**/*.js</includes>
<excludes>
<exclude>**/*.min.js</exclude>
</excludes>
<skipMerge>true</skipMerge>
<closureLanguageOut>ECMASCRIPT5</closureLanguageOut>
</configuration>
<goals>
<goal>minify</goal>
</goals>
<phase>generate-resources</phase>
</execution>
</executions>
</plugin>

maven-dependency-plugin:3.1.1:unpack Unable to find/resolve artifact

[SOLVED] How to fix: maven-dependency-plugin:3.1.1:unpack Unable to find/resolve artifact.
After a day of trial and error, I realized something. The maven plugins are trying to build the parent module (rst_bav). This module is just a container declaring dependencies and maven plugins. I never intended it to be built.
Therefore the solution is to move all plugin declarations to the child modules (rst_eureka, rst_admin, rst_mail, rst_config) and remove them from the parent module (rst_bav).
There is also an answer here on stackoverflow. Matts had the same problem as me and wrote a plugin to orchestrate plugin execution for maven child modules, while the plugins themselves are declared in the parent module. I did not try said plugin though.
Original Question
I am trying to package a multi module maven project. During the package phase, all dependecies shall be unpacked into the /target/dependencies/ directory, so that I can build a docker image as described here: https://spring.io/guides/gs/spring-boot-docker/
My multi module maven project looks like this:
rst_bav (packaging="pom")
|_ rst_eureka (packaging="jar")
|_ rst_admin (packaging="jar")
|_ rst_mail (packaging="jar")
|_ rst_config (packaging="jar")
The build fails on trying to unpack rst_bav, saying it does not exist in the local nexus.
"C:\Program Files\Java\jdk-11.0.1\bin\java.exe" -Dmaven.multiModuleProjectDirectory=C:\git\rst_bav "-Dmaven.home=C:\Program Files\apache-maven-3.6.0" "-Dclassworlds.conf=C:\Program Files\apache-maven-3.6.0\bin\m2.conf" "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA 2018.3.2\lib\idea_rt.jar=60959:C:\Program Files\JetBrains\IntelliJ IDEA 2018.3.2\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\apache-maven-3.6.0\boot\plexus-classworlds-2.5.2.jar" org.codehaus.classworlds.Launcher -Didea.version=2018.3.2 clean install package -e -U
Console output is saving to: C:\tmp\indea.log
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] rst_bav [pom]
[INFO] rst_eureka [jar]
[INFO] rst_admin [jar]
[INFO] rst_mail [jar]
[INFO] rst_config [jar]
[INFO]
[INFO] --------------------------< de.hhpv:rst_bav >---------------------------
[INFO] Building rst_bav 0.0.1-SNAPSHOT [1/5]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.0.0:clean (default-clean) # rst_bav ---
[INFO] Deleting C:\git\rst_bav\target
[INFO]
[INFO] --- spring-boot-maven-plugin:2.0.5.RELEASE:repackage (default) # rst_bav ---
[INFO]
[INFO] --- maven-dependency-plugin:3.1.1:unpack (unpack) # rst_bav ---
[INFO] Configured Artifact: de.hhpv:rst_bav:0.0.1-SNAPSHOT:jar
Downloading from archetype: http://nexus.hh.hhpv.dir:8081/de/hhpv/rst_bav/0.0.1-SNAPSHOT/maven-metadata.xml
Downloading from central-repo: http://repo1.maven.org/maven2/de/hhpv/rst_bav/0.0.1-SNAPSHOT/maven-metadata.xml
Downloading from internal-repository: http://nexus.hh.hhpv.dir:8081/repository/maven-public/de/hhpv/rst_bav/0.0.1-SNAPSHOT/maven-metadata.xml
Downloading from internal-repository: http://nexus.hh.hhpv.dir:8081/repository/maven-public/de/hhpv/rst_bav/0.0.1-SNAPSHOT/rst_bav-0.0.1-SNAPSHOT.jar
Downloading from central-repo: http://repo1.maven.org/maven2/de/hhpv/rst_bav/0.0.1-SNAPSHOT/rst_bav-0.0.1-SNAPSHOT.jar
Downloading from archetype: http://nexus.hh.hhpv.dir:8081/de/hhpv/rst_bav/0.0.1-SNAPSHOT/rst_bav-0.0.1-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for rst_bav 0.0.1-SNAPSHOT:
[INFO]
[INFO] rst_bav ............................................ FAILURE [ 20.525 s]
[INFO] rst_eureka ......................................... SKIPPED
[INFO] rst_admin .......................................... SKIPPED
[INFO] rst_mail ........................................... SKIPPED
[INFO] rst_config ......................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 22.973 s
[INFO] Finished at: 2019-01-03T15:32:45+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:3.1.1:unpack (unpack) on project rst_bav: Unable to find/resolve artifact.: Could not find artifact de.hhpv:rst_bav:jar:0.0.1-SNAPSHOT in internal-repository (http://nexus.hh.hhpv.dir:8081/repository/maven-public) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:3.1.1:unpack (unpack) on project rst_bav: Unable to find/resolve artifact.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
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)
at org.codehaus.classworlds.Launcher.main (Launcher.java:47)
Caused by: org.apache.maven.plugin.MojoExecutionException: Unable to find/resolve artifact.
at org.apache.maven.plugins.dependency.fromConfiguration.AbstractFromConfigurationMojo.getArtifact (AbstractFromConfigurationMojo.java:255)
at org.apache.maven.plugins.dependency.fromConfiguration.AbstractFromConfigurationMojo.getProcessedArtifactItems (AbstractFromConfigurationMojo.java:171)
at org.apache.maven.plugins.dependency.fromConfiguration.UnpackMojo.getProcessedArtifactItems (UnpackMojo.java:151)
at org.apache.maven.plugins.dependency.fromConfiguration.UnpackMojo.doExecute (UnpackMojo.java:102)
at org.apache.maven.plugins.dependency.AbstractDependencyMojo.execute (AbstractDependencyMojo.java:143)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
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)
at org.codehaus.classworlds.Launcher.main (Launcher.java:47)
Caused by: org.apache.maven.shared.artifact.resolve.ArtifactResolverException: Could not find artifact de.hhpv:rst_bav:jar:0.0.1-SNAPSHOT in internal-repository (http://nexus.hh.hhpv.dir:8081/repository/maven-public)
at org.apache.maven.shared.artifact.resolve.internal.Maven31ArtifactResolver.resolveArtifact (Maven31ArtifactResolver.java:116)
at org.apache.maven.shared.artifact.resolve.internal.Maven31ArtifactResolver.resolveArtifact (Maven31ArtifactResolver.java:80)
at org.apache.maven.shared.artifact.resolve.internal.DefaultArtifactResolver.resolveArtifact (DefaultArtifactResolver.java:73)
at org.apache.maven.plugins.dependency.fromConfiguration.AbstractFromConfigurationMojo.getArtifact (AbstractFromConfigurationMojo.java:251)
at org.apache.maven.plugins.dependency.fromConfiguration.AbstractFromConfigurationMojo.getProcessedArtifactItems (AbstractFromConfigurationMojo.java:171)
at org.apache.maven.plugins.dependency.fromConfiguration.UnpackMojo.getProcessedArtifactItems (UnpackMojo.java:151)
at org.apache.maven.plugins.dependency.fromConfiguration.UnpackMojo.doExecute (UnpackMojo.java:102)
at org.apache.maven.plugins.dependency.AbstractDependencyMojo.execute (AbstractDependencyMojo.java:143)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
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)
at org.codehaus.classworlds.Launcher.main (Launcher.java:47)
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not find artifact de.hhpv:rst_bav:jar:0.0.1-SNAPSHOT in internal-repository (http://nexus.hh.hhpv.dir:8081/repository/maven-public)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve (DefaultArtifactResolver.java:413)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts (DefaultArtifactResolver.java:215)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact (DefaultArtifactResolver.java:192)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveArtifact (DefaultRepositorySystem.java:247)
at org.apache.maven.shared.artifact.resolve.internal.Maven31ArtifactResolver.resolveArtifact (Maven31ArtifactResolver.java:108)
at org.apache.maven.shared.artifact.resolve.internal.Maven31ArtifactResolver.resolveArtifact (Maven31ArtifactResolver.java:80)
at org.apache.maven.shared.artifact.resolve.internal.DefaultArtifactResolver.resolveArtifact (DefaultArtifactResolver.java:73)
at org.apache.maven.plugins.dependency.fromConfiguration.AbstractFromConfigurationMojo.getArtifact (AbstractFromConfigurationMojo.java:251)
at org.apache.maven.plugins.dependency.fromConfiguration.AbstractFromConfigurationMojo.getProcessedArtifactItems (AbstractFromConfigurationMojo.java:171)
at org.apache.maven.plugins.dependency.fromConfiguration.UnpackMojo.getProcessedArtifactItems (UnpackMojo.java:151)
at org.apache.maven.plugins.dependency.fromConfiguration.UnpackMojo.doExecute (UnpackMojo.java:102)
at org.apache.maven.plugins.dependency.AbstractDependencyMojo.execute (AbstractDependencyMojo.java:143)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
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)
at org.codehaus.classworlds.Launcher.main (Launcher.java:47)
Caused by: org.eclipse.aether.transfer.ArtifactNotFoundException: Could not find artifact de.hhpv:rst_bav:jar:0.0.1-SNAPSHOT in internal-repository (http://nexus.hh.hhpv.dir:8081/repository/maven-public)
at org.eclipse.aether.connector.basic.ArtifactTransportListener.transferFailed (ArtifactTransportListener.java:48)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run (BasicRepositoryConnector.java:368)
at org.eclipse.aether.util.concurrency.RunnableErrorForwarder$1.run (RunnableErrorForwarder.java:75)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector$DirectExecutor.execute (BasicRepositoryConnector.java:642)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector.get (BasicRepositoryConnector.java:262)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads (DefaultArtifactResolver.java:489)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve (DefaultArtifactResolver.java:390)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts (DefaultArtifactResolver.java:215)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact (DefaultArtifactResolver.java:192)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveArtifact (DefaultRepositorySystem.java:247)
at org.apache.maven.shared.artifact.resolve.internal.Maven31ArtifactResolver.resolveArtifact (Maven31ArtifactResolver.java:108)
at org.apache.maven.shared.artifact.resolve.internal.Maven31ArtifactResolver.resolveArtifact (Maven31ArtifactResolver.java:80)
at org.apache.maven.shared.artifact.resolve.internal.DefaultArtifactResolver.resolveArtifact (DefaultArtifactResolver.java:73)
at org.apache.maven.plugins.dependency.fromConfiguration.AbstractFromConfigurationMojo.getArtifact (AbstractFromConfigurationMojo.java:251)
at org.apache.maven.plugins.dependency.fromConfiguration.AbstractFromConfigurationMojo.getProcessedArtifactItems (AbstractFromConfigurationMojo.java:171)
at org.apache.maven.plugins.dependency.fromConfiguration.UnpackMojo.getProcessedArtifactItems (UnpackMojo.java:151)
at org.apache.maven.plugins.dependency.fromConfiguration.UnpackMojo.doExecute (UnpackMojo.java:102)
at org.apache.maven.plugins.dependency.AbstractDependencyMojo.execute (AbstractDependencyMojo.java:143)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
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)
at org.codehaus.classworlds.Launcher.main (Launcher.java:47)
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Process finished with exit code 1
rst_bav/pom.xml
<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>de.hhpv</groupId>
<artifactId>rst_bav</artifactId>
<version>${revision}</version>
<packaging>pom</packaging>
<name>rst_bav</name>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.5.RELEASE</version>
<relativePath />
</parent>
<properties>
<revision>0.0.1-SNAPSHOT</revision>
<java.version>1.11</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<project.build.sourceEncoding>ISO-8859-1</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
<maven-dependency-plugin-version>3.1.1</maven-dependency-plugin-version>
<spring-boot-maven-plugin-version>${spring-boot-version}</spring-boot-maven-plugin-version>
<spring-cloud-version>Finchley.SR2</spring-cloud-version>
<spring-boot-version>2.0.5.RELEASE</spring-boot-version>
<!-- newest version 2.1.2-SNAPSHOT does not work with current spring boot (reactor libraries vs tomcat) -->
<spring-boot-admin-server-version>2.0.4</spring-boot-admin-server-version>
<javax-version>2.0.3</javax-version>
<javax-activation-version>javax.activation</javax-activation-version>
</properties>
<modules>
<module>rst_eureka</module>
<module>rst_admin</module>
<module>rst_mail</module>
<module>rst_config</module>
</modules>
<dependencyManagement>
<dependencies>
<dependency>
<!-- Import dependency management from Spring Cloud -->
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud-version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<!-- Import dependency management from Spring Boot -->
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring-boot-version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<release>11</release>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring-boot-maven-plugin-version}</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<!--
This plugin unpacks the dependencies and jar file during mvn package
Based on this article:
https://openliberty.io/blog/2018/07/02/creating-dual-layer-docker-images-for-spring-boot-apps.html
-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>${maven-dependency-plugin-version}</version>
<executions>
<execution>
<id>unpack</id>
<phase>package</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>${project.groupId}</groupId>
<artifactId>${project.artifactId}</artifactId>
<version>${project.version}</version>
</artifactItem>
</artifactItems>
<!--
dependency:unpack always downloads artifacts to default local repository first, and then
unpacks the artifacts to the desired locations. For large size unique snapshot artifacts,
the downloads can quickly fill up default local repository, and therefore local disk, after
many executions. To clean up the downloaded artifacts as part the build, set
localRepositoryDirectory's value to a location in your project's target directory.
https://maven.apache.org/plugins/maven-dependency-plugin/examples/copying-artifacts.html
-->
<localRepositoryDirectory>${project.build.directory}/localrepo</localRepositoryDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
it looks like a problem with your proxy configuration in your IDE
Does your company use a specific proxy ?
Check your maven user settings path in your IDE and be sure the proxy in the settings.xml is right

Maven NullpointerException in package stage with unpacking zip for xml schemas

I have a project that should include xml schemas from another project.
The source project creates a zip file ~/.m2/repository/com/comp/xml-schemas/0.0.1-SNAPSHOT/xml-schemas-0.0.1-SNAPSHOT-resources.zip alongside a jar file xml-schemas-0.0.1-SNAPSHOT.jar
In the pom of the project using the xml-schemas I used the dependency plugin to import the xml schemas.
<?xml version="1.0" encoding="UTF-8"?>
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<artifactId>core.xml-schemas</artifactId>
<packaging>bwmodule</packaging>
<parent>
<groupId>com.comp.bw</groupId>
<artifactId>core.parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../core.parent</relativePath>
</parent>
<dependencies>
<dependency>
<groupId>com.comp</groupId>
<artifactId>xml-schemas</artifactId>
<version>0.0.1-SNAPSHOT</version>
<classifier>resources</classifier>
<type>zip</type>
</dependency>
</dependencies>
<build>
<sourceDirectory>src</sourceDirectory>
<outputDirectory>target/classes</outputDirectory>
<plugins>
<plugin>
<groupId>com.tibco.plugins</groupId>
<artifactId>bw6-maven-plugin</artifactId>
<version>1.3.1</version>
<extensions>true</extensions>
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<phase>generate-resources</phase>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>com.comp</groupId>
<artifactId>xml-schemas</artifactId>
<version>0.0.1-SNAPSHOT</version>
<classifier>resources</classifier>
<type>zip</type>
</artifactItem>
</artifactItems>
<includes>**/*.x*</includes>
<includeGroupIds>com.comp</includeGroupIds>
<includeArtifactIds>xml-schemas</includeArtifactIds>
<outputDirectory>${project.basedir}/Schemas</outputDirectory>
<includeTransative>true</includeTransative>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.0.0</version>
<configuration>
<filesets>
<fileset>
<directory>Schemas</directory>
<includes>
<include>**/*</include>
</includes>
<followSymlinks>false</followSymlinks>
</fileset>
</filesets>
</configuration>
</plugin>
</plugins>
</build>
</project>
When I run mvn validate and mvn compile, everything works fine. Also when I run Update project in Eclipse there are no issues.
But when I run mvn package an error message is thrown:
[johan#localhost core.xml-schemas]$ mvn clean package -e
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] Starting Maven Build for BW6 Project.................................
[INFO] Checking for In-Project JAR dependencies if any and Pushing them to Local Maven Repository
[INFO]
[INFO] -----------------< com.comp.bw:core.xml-schemas >------------------
[INFO] Building core.xml-schemas 1.0.0-SNAPSHOT
[INFO] ------------------------------[ bwmodule ]------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.0.0:clean (default-clean) # core.xml-schemas ---
[INFO] Deleting /home/johan/projects/bw6_projects/core.xml-schemas/target
[INFO] Deleting /home/johan/projects/bw6_projects/core.xml-schemas/Schemas (includes = [**/*], excludes = [])
[INFO]
[INFO] --- maven-dependency-plugin:2.8:unpack-dependencies (default) # core.xml-schemas ---
[INFO] Unpacking /home/johan/.m2/repository/com/comp/xml-schemas/0.0.1-SNAPSHOT/xml-schemas-0.0.1-SNAPSHOT-resources.zip to /home/johan/projects/bw6_projects/core.xml-schemas/Schemas with includes "**/*.x*" and excludes ""
[INFO]
[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) # core.xml-schemas ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/johan/projects/bw6_projects/core.xml-schemas/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) # core.xml-schemas ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:3.0.2:testResources (default-testResources) # core.xml-schemas ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/johan/projects/bw6_projects/core.xml-schemas/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.7.0:testCompile (default-testCompile) # core.xml-schemas ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.21.0:test (default-test) # core.xml-schemas ---
[INFO] No tests to run.
[INFO]
[INFO] --- bw6-maven-plugin:1.3.1:bwmodule (default-bwmodule) # core.xml-schemas ---
[INFO] Module Packager Mojo started for Module core.xml-schemas ...
[INFO] Updated the Manifest version
UpdateManifest Method in
Update Attribute
[INFO] The OSGi verion is 1.0.0.201805020939 for Maven version of 1.0.0.201805020939
[INFO] Removing the externals entries if any.
[INFO] Created Plugin JAR with name /home/johan/projects/bw6_projects/core.xml-schemas/target/core.xml-schemas_1.0.0.201805020939.jar
[INFO] Adding Maven Dependencies to the Plugin JAR file
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.556 s
[INFO] Finished at: 2018-05-02T09:39:06+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.tibco.plugins:bw6-maven-plugin:1.3.1:bwmodule (default-bwmodule) on project core.xml-schemas: Execution default-bwmodule of goal com.tibco.plugins:bw6-maven-plugin:1.3.1:bwmodule failed.: NullPointerException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.tibco.plugins:bw6-maven-plugin:1.3.1:bwmodule (default-bwmodule) on project core.xml-schemas: Execution default-bwmodule of goal com.tibco.plugins:bw6-maven-plugin:1.3.1:bwmodule failed.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:213)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
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 default-bwmodule of goal com.tibco.plugins:bw6-maven-plugin:1.3.1:bwmodule failed.
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:148)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
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: java.lang.NullPointerException
at com.tibco.bw.maven.plugin.module.BWModulePackageMojo.addDependencies (BWModulePackageMojo.java:188)
at com.tibco.bw.maven.plugin.module.BWModulePackageMojo.execute (BWModulePackageMojo.java:110)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
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)
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
Could someone help me out with this?

Resources