maven-deploy-plugin deploy-file goal insists on deploying javadoc file for previous deploy-file execution - maven

I have a pom which I use to package some third party jars to deploy to a local nexus.
However it always fails with the second upload. It seems as if it is always picking up the javadoc associated with the first deploy-file execution, eventhough I have not specified this.
Is this a bug, or what am I doing wrong?
<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>a.b.c</groupId>
<artifactId>vendorx_jdbc_driver_wrapper</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
<vendorx_jdbc_driver_wrapper.javadoczip>${basedir}/files/11.2.0.1.0/jdbc/javadoc.zip</vendorx_jdbc_driver_wrapper.javadoczip>
<vendorx_jdbc_driver_wrapper.javadoctemp>${basedir}/files/11.2.0.1.0/jdbc/javadoctemp</vendorx_jdbc_driver_wrapper.javadoctemp>
<vendorx_jdbc_driver_wrapper.javadocfile>${basedir}/files/11.2.0.1.0/jdbc/javadoctemp/thejavadocs.jar</vendorx_jdbc_driver_wrapper.javadocfile>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.2</version>
<executions>
<execution>
<id>prepare</id>
<phase>validate</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<echo message="repackge the vendorx javadoc zip to be in the expected format" />
<delete includeemptydirs="true">
<fileset dir="${vendorx_jdbc_driver_wrapper.javadoctemp}" includes="**/*" defaultexcludes="false"/>
</delete>
<unzip src="${vendorx_jdbc_driver_wrapper.javadoczip}" dest="${vendorx_jdbc_driver_wrapper.javadoctemp}" />
<!-- N.B. vendorx zip version specific location - you will have to change this to make it work -->
<jar destfile="${vendorx_jdbc_driver_wrapper.javadocfile}" basedir="${vendorx_jdbc_driver_wrapper.javadoctemp}/E13995_02/html"/>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>2.3.1</version>
<executions>
<execution>
<id>install-library-main</id>
<phase>install</phase>
<goals>
<goal>install-file</goal>
</goals>
<configuration>
<file>${basedir}/files/11.2.0.1.0/jdbc/lib/vjdbc99.jar</file>
<groupId>a.b.c.com.vendorx</groupId>
<artifactId>vjdbc99</artifactId>
<version>11.2.0.1.0</version>
<packaging>jar</packaging>
<generatePom>true</generatePom>
</configuration>
</execution>
<execution>
<id>install-javadocs-main</id>
<phase>install</phase>
<goals>
<goal>install-file</goal>
</goals>
<configuration>
<file>${vendorx_jdbc_driver_wrapper.javadocfile}</file>
<groupId>a.b.c.com.vendorx</groupId>
<artifactId>vjdbc99</artifactId>
<version>11.2.0.1.0</version>
<packaging>jar</packaging>
<classifier>javadoc</classifier>
</configuration>
</execution>
<execution>
<id>install-library-debug</id>
<phase>install</phase>
<goals>
<goal>install-file</goal>
</goals>
<configuration>
<file>${basedir}/files/11.2.0.1.0/jdbc/lib/vjdbc99_g.jar</file>
<groupId>a.b.c.com.vendorx</groupId>
<artifactId>vjdbc99_g</artifactId>
<version>11.2.0.1.0</version>
<packaging>jar</packaging>
<generatePom>true</generatePom>
</configuration>
</execution>
<execution>
<id>install-javadocs-debug</id>
<phase>install</phase>
<goals>
<goal>install-file</goal>
</goals>
<configuration>
<!-- same javadocs as for non debug -->
<file>${vendorx_jdbc_driver_wrapper.javadocfile}</file>
<groupId>a.b.c.com.vendorx</groupId>
<artifactId>vjdbc99_g</artifactId>
<version>11.2.0.1.0</version>
<packaging>jar</packaging>
<classifier>javadoc</classifier>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.7</version>
<executions>
<!-- Don't bother deploying this POM ... its only the artifact we want to deploy -->
<execution>
<id>default-deploy</id>
<phase>deploy</phase>
<goals>
<goal>deploy</goal>
</goals>
<configuration>
<skip>true</skip>
</configuration>
</execution>
<!-- This is the real thing we are deploying -->
<execution>
<id>deploy-library-main</id>
<phase>deploy</phase>
<goals>
<goal>deploy-file</goal>
</goals>
<configuration>
<file>${basedir}/files/11.2.0.1.0/jdbc/lib/vjdbc99.jar</file>
<groupId>a.b.c.com.vendorx</groupId>
<artifactId>vjdbc99</artifactId>
<version>11.2.0.1.0</version>
<packaging>jar</packaging>
<generatePom>true</generatePom>
<javadoc>${vendorx_jdbc_driver_wrapper.javadocfile}</javadoc>
<url>http://foo.lan:8888/nexus/content/repositories/releases</url>
<repositoryId>releases</repositoryId>
</configuration>
</execution>
<execution>
<id>deploy-library-debug</id>
<phase>deploy</phase>
<goals>
<goal>deploy-file</goal>
</goals>
<configuration>
<file>${basedir}/files/11.2.0.1.0/jdbc/lib/vjdbc99_g.jar</file>
<groupId>a.b.c.com.vendorx</groupId>
<artifactId>vjdbc99_g</artifactId>
<version>11.2.0.1.0</version>
<packaging>jar</packaging>
<generatePom>true</generatePom>
<url>http://foo.lan:8888/nexus/content/repositories/releases</url>
<repositoryId>releases</repositoryId>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<distributionManagement>
<repository>
<id>releases</id>
<url>http://foo.lan:8888/nexus/content/repositories/releases</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<url>http://foo.lan:8888/nexus/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
</project>
Here's the output
C:\Users\wibble\workspace\vendorx_jdbc_driver_wrapper>mvn deploy
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building vendorx_jdbc_driver_wrapper 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-antrun-plugin:1.2:run (prepare) # vendorx_jdbc_driver_wrapper ---
[INFO] Executing tasks
[echo] repackge the vendorx javadoc zip to be in the expected format
[unzip] Expanding: C:\Users\wibble\workspace\vendorx_jdbc_driver_wrapper\files\11.2.0.1.0\jdbc\javadoc.zip into C:\Users\wibble\workspace\vendorx_jdbc_driver_wrapper\files\11.2.0.1.0\j
dbc\javadoctemp
[jar] Building jar: C:\Users\wibble\workspace\vendorx_jdbc_driver_wrapper\files\11.2.0.1.0\jdbc\javadoctemp\thejavadocs.jar
[INFO] Executed tasks
[INFO]
[INFO] --- maven-install-plugin:2.3.1:install (default-install) # vendorx_jdbc_driver_wrapper ---
[INFO] Installing C:\Users\wibble\workspace\vendorx_jdbc_driver_wrapper\pom.xml to C:\Users\wibble\.m2\repository\uk\co\his\vendorx_jdbc_driver_wrapper\0.0.1-SNAPSHOT\vendorx_jdbc_driver_wr
apper-0.0.1-SNAPSHOT.pom
[INFO]
[INFO] --- maven-install-plugin:2.3.1:install-file (install-library-main) # vendorx_jdbc_driver_wrapper ---
[INFO] Installing C:\Users\wibble\workspace\vendorx_jdbc_driver_wrapper\files\11.2.0.1.0\jdbc\lib\vjdbc99.jar to C:\Users\wibble\.m2\repository\uk\co\his\com\vendorx\vjdbc99\11.2.0.1.0\ojdbc
6-11.2.0.1.0.jar
[INFO] Installing C:\Users\wibble\AppData\Local\Temp\1\mvninstall1181445077198226588.pom to C:\Users\wibble\.m2\repository\uk\co\his\com\vendorx\vjdbc99\11.2.0.1.0\vjdbc99-11.2.0.1.0.pom
[INFO]
[INFO] --- maven-install-plugin:2.3.1:install-file (install-javadocs-main) # vendorx_jdbc_driver_wrapper ---
[INFO] Installing C:\Users\wibble\workspace\vendorx_jdbc_driver_wrapper\files\11.2.0.1.0\jdbc\javadoctemp\thejavadocs.jar to C:\Users\wibble\.m2\repository\uk\co\his\com\vendorx\vjdbc99\11.
2.0.1.0\vjdbc99-11.2.0.1.0-javadoc.jar
[INFO]
[INFO] --- maven-install-plugin:2.3.1:install-file (install-library-debug) # vendorx_jdbc_driver_wrapper ---
[INFO] Installing C:\Users\wibble\workspace\vendorx_jdbc_driver_wrapper\files\11.2.0.1.0\jdbc\lib\vjdbc99_g.jar to C:\Users\wibble\.m2\repository\uk\co\his\com\vendorx\vjdbc99_g\11.2.0.1.0\o
jdbc6_g-11.2.0.1.0.jar
[INFO] Installing C:\Users\wibble\AppData\Local\Temp\1\mvninstall4548076073436253537.pom to C:\Users\wibble\.m2\repository\uk\co\his\com\vendorx\vjdbc99_g\11.2.0.1.0\vjdbc99_g-11.2.0.1.0.pom
[INFO]
[INFO] --- maven-install-plugin:2.3.1:install-file (install-javadocs-debug) # vendorx_jdbc_driver_wrapper ---
[INFO] Installing C:\Users\wibble\workspace\vendorx_jdbc_driver_wrapper\files\11.2.0.1.0\jdbc\javadoctemp\thejavadocs.jar to C:\Users\wibble\.m2\repository\uk\co\his\com\vendorx\vjdbc99_g\1
1.2.0.1.0\vjdbc99_g-11.2.0.1.0-javadoc.jar
[INFO]
[INFO] --- maven-deploy-plugin:2.7:deploy (default-deploy) # vendorx_jdbc_driver_wrapper ---
[INFO] Skipping artifact deployment
[INFO]
[INFO] --- maven-deploy-plugin:2.7:deploy-file (deploy-library-main) # vendorx_jdbc_driver_wrapper ---
Uploading: http://foo.lan:8888/nexus/content/repositories/releases/a/b/c/com/vendorx/vjdbc99/11.2.0.1.0/vjdbc99-11.2.0.1.0.jar
Uploaded: http://foo.lan:8888/nexus/content/repositories/releases/a/b/c/com/vendorx/vjdbc99/11.2.0.1.0/vjdbc99-11.2.0.1.0.jar (2062 KB at 3152.7 KB/sec)
Uploading: http://foo.lan:8888/nexus/content/repositories/releases/a/b/c/com/vendorx/vjdbc99/11.2.0.1.0/vjdbc99-11.2.0.1.0.pom
Uploaded: http://foo.lan:8888/nexus/content/repositories/releases/a/b/c/com/vendorx/vjdbc99/11.2.0.1.0/vjdbc99-11.2.0.1.0.pom (404 B at 8.8 KB/sec)
Downloading: http://foo.lan:8888/nexus/content/repositories/releases/a/b/c/com/vendorx/vjdbc99/maven-metadata.xml
Uploading: http://foo.lan:8888/nexus/content/repositories/releases/a/b/c/com/vendorx/vjdbc99/maven-metadata.xml
Uploaded: http://foo.lan:8888/nexus/content/repositories/releases/a/b/c/com/vendorx/vjdbc99/maven-metadata.xml (316 B at 6.1 KB/sec)
Uploading: http://foo.lan:8888/nexus/content/repositories/releases/a/b/c/com/vendorx/vjdbc99/11.2.0.1.0/vjdbc99-11.2.0.1.0-javadoc.jar
Uploaded: http://foo.lan:8888/nexus/content/repositories/releases/a/b/c/com/vendorx/vjdbc99/11.2.0.1.0/vjdbc99-11.2.0.1.0-javadoc.jar (780 KB at 1621.4 KB/sec)
[INFO]
[INFO] --- maven-deploy-plugin:2.7:deploy-file (deploy-library-debug) # vendorx_jdbc_driver_wrapper ---
Uploading: http://foo.lan:8888/nexus/content/repositories/releases/a/b/c/com/vendorx/vjdbc99_g/11.2.0.1.0/vjdbc99_g-11.2.0.1.0.jar
Uploaded: http://foo.lan:8888/nexus/content/repositories/releases/a/b/c/com/vendorx/vjdbc99_g/11.2.0.1.0/vjdbc99_g-11.2.0.1.0.jar (3323 KB at 2472.1 KB/sec)
Uploading: http://foo.lan:8888/nexus/content/repositories/releases/a/b/c/com/vendorx/vjdbc99_g/11.2.0.1.0/vjdbc99_g-11.2.0.1.0.pom
Uploaded: http://foo.lan:8888/nexus/content/repositories/releases/a/b/c/com/vendorx/vjdbc99_g/11.2.0.1.0/vjdbc99_g-11.2.0.1.0.pom (406 B at 6.8 KB/sec)
Downloading: http://foo.lan:8888/nexus/content/repositories/releases/a/b/c/com/vendorx/vjdbc99_g/maven-metadata.xml
Uploading: http://foo.lan:8888/nexus/content/repositories/releases/a/b/c/com/vendorx/vjdbc99_g/maven-metadata.xml
Uploaded: http://foo.lan:8888/nexus/content/repositories/releases/a/b/c/com/vendorx/vjdbc99_g/maven-metadata.xml (318 B at 4.7 KB/sec)
Uploading: http://foo.lan:8888/nexus/content/repositories/releases/a/b/c/com/vendorx/vjdbc99/11.2.0.1.0/vjdbc99-11.2.0.1.0-javadoc.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.311s
[INFO] Finished at: Mon Jan 23 12:34:09 GMT 2012
[INFO] Final Memory: 4M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy-file (deploy-library-debug) on project vendorx_jdbc_driver_wrapper: Error deploying attached artifact C:\Users\Adm
inistrator\workspace\vendorx_jdbc_driver_wrapper\files\11.2.0.1.0\jdbc\javadoctemp\thejavadocs.jar: Failed to deploy artifacts: Could not transfer artifact uk.co.his.com.vendorx:vjdbc99:jar:javadoc:11.2.
0.1.0 from/to releases (http://foo.lan:8888/nexus/content/repositories/releases): Failed to transfer file: http://foo.lan:8888/nexus/content/repositories/releases/a/b/c/com/vendorx/vjdbc99/1
1.2.0.1.0/vjdbc99-11.2.0.1.0-javadoc.jar. Return code is: 400 -> [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/MojoExecutionException
C:\Users\wibble\workspace\vendorx_jdbc_driver_wrapper>
I have created a bug on the deploy plugin jira:
MDEPLOY-143

Third party POMs will almost never play together nicely with your local Maven infrastructure.
The POM in question modifies the Maven build lifecycle by associating a number of goals with the phase install.
To deploy artifacts defined by that POM, I'd recommend you first create the artifacts by issuing a mvn package command. This will create the artifacts in your project's build folder (target/) but not send them to your local repository. Then upload them manually one by one into your repository.
If instead you prefer to deploy straight from that POM file, be prepared to do some serious editing beforehand.
As a side note: you might want to put such artifacts into a 3rd party repository inside your Nexus, not into nexus/content/repositories/releases, which is reserved for releases of your own software only (by convention).
Hope this helps!

Related

Error during maven "clean install" with plug-in resolve

I try to to use clean install in Maven and get the error below. I have two questions:
Is this an error to be solved with a fair amount of work or is it such an esoteric error, that any attempt to solve it would end up in a long-term project?
Has anybody a solution in mind?
I can provide further info, if necessary. The java version is:
openjdk version "10.0.1" 2018-04-17
I'm running this on Ubuntu 18.04.
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/usr/share/maven/lib/guice.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] DeepLearning4j Examples Parent
[INFO] DeepLearning4j Examples
[INFO] dl4j-spark-examples
[INFO] dl4j-spark
[INFO] datavec-examples
[INFO] DeepLearning4j CUDA special examples
[INFO] nd4j-examples
[INFO] Reinforcement Learning4j Examples
[INFO] lstm-hdfs
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building DeepLearning4j Examples Parent 1.0.0-alpha
[INFO] ------------------------------------------------------------------------
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-enforcer-plugin/1.0.1/maven-enforcer-plugin-1.0.1.pom
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] DeepLearning4j Examples Parent ..................... FAILURE [ 1.359 s]
[INFO] DeepLearning4j Examples ............................ SKIPPED
[INFO] dl4j-spark-examples ................................ SKIPPED
[INFO] dl4j-spark ......................................... SKIPPED
[INFO] datavec-examples ................................... SKIPPED
[INFO] DeepLearning4j CUDA special examples ............... SKIPPED
[INFO] nd4j-examples ...................................... SKIPPED
[INFO] Reinforcement Learning4j Examples .................. SKIPPED
[INFO] lstm-hdfs .......................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.774 s
[INFO] Finished at: 2018-05-01T21:23:04+02:00
[INFO] Final Memory: 8M/34M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-enforcer-plugin:1.0.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-enforcer-plugin:jar:1.0.1: Could not transfer artifact org.apache.maven.plugins:maven-enforcer-plugin:pom:1.0.1 from/to central (https://repo.maven.apache.org/maven2): java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty -> [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/PluginResolutionException
Here is the pom.xml
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<groupId>org.deeplearning4j</groupId>
<artifactId>deeplearning4j-examples-parent</artifactId>
<version>1.0.0-alpha</version>
<modelVersion>4.0.0</modelVersion>
<packaging>pom</packaging>
<name>DeepLearning4j Examples Parent</name>
<description>Examples of training different data sets</description>
<properties>
<!-- Change the nd4j.backend property to nd4j-cuda-8.0-platform, nd4j-cuda-9.0-platform or nd4j-cuda-9.1-platform to use CUDA GPUs -->
<nd4j.backend>nd4j-native-platform</nd4j.backend>
<!--<nd4j.backend>nd4j-cuda-9.1-platform</nd4j.backend>-->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<shadedClassifier>bin</shadedClassifier>
<java.version>1.8</java.version>
<nd4j.version>1.0.0-alpha</nd4j.version>
<dl4j.version>1.0.0-alpha</dl4j.version>
<datavec.version>1.0.0-alpha</datavec.version>
<arbiter.version>1.0.0-alpha</arbiter.version>
<rl4j.version>1.0.0-alpha</rl4j.version>
<!-- For Spark examples: change the _1 to _2 to switch between Spark 1 and Spark 2 -->
<dl4j.spark.version>1.0.0-alpha_spark_1</dl4j.spark.version>
<datavec.spark.version>1.0.0-alpha_spark_1</datavec.spark.version>
<!-- Scala binary version: DL4J's Spark and UI functionality are released with both Scala 2.10 and 2.11 support -->
<scala.binary.version>2.11</scala.binary.version>
<hadoop.version>2.2.0</hadoop.version> <!-- Hadoop version used by Spark 1.6.3 and 2.2.1 (and likely others) -->
<guava.version>19.0</guava.version>
<logback.version>1.1.7</logback.version>
<jfreechart.version>1.0.13</jfreechart.version>
<jcommon.version>1.0.23</jcommon.version>
<maven-compiler-plugin.version>3.6.1</maven-compiler-plugin.version>
<maven-shade-plugin.version>2.4.3</maven-shade-plugin.version>
<exec-maven-plugin.version>1.4.0</exec-maven-plugin.version>
<maven.minimum.version>3.3.1</maven.minimum.version>
<javafx.version>2.2.3</javafx.version>
<javafx.runtime.lib.jar>${env.JAVAFX_HOME}/jfxrt.jar</javafx.runtime.lib.jar>
<aws.sdk.version>1.11.109</aws.sdk.version>
<jackson.version>2.6.6</jackson.version>
<scala.plugin.version>3.2.2</scala.plugin.version>
</properties>
<modules>
<module>dl4j-examples</module>
<module>dl4j-spark-examples</module>
<module>datavec-examples</module>
<module>dl4j-cuda-specific-examples</module>
<module>nd4j-examples</module>
<module>rl4j-examples</module>
<module>lstm-hdfs</module>
</modules>
<!-- Maven Enforcer: Ensures user has an up to date version of Maven before building -->
<build>
<plugins>
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.0.1</version>
<executions>
<execution>
<id>enforce-default</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireMavenVersion>
<version>[${maven.minimum.version},)</version>
<message>********** Minimum Maven Version is ${maven.minimum.version}. Please upgrade Maven before continuing (run "mvn --version" to check). **********</message>
</requireMavenVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>
<!-- Automated Code Formatting -->
<plugin>
<groupId>net.revelc.code.formatter</groupId>
<artifactId>formatter-maven-plugin</artifactId>
<version>2.0.0</version>
<configuration>
<configFile>${session.executionRootDirectory}/contrib/formatter.xml</configFile>
<directories>
<directory>dl4j-examples</directory>
<directory>dl4j-spark-examples</directory>
<directory>datavec-examples</directory>
<directory>dl4j-cuda-specific-examples</directory>
<directory>nd4j-examples</directory>
<directory>rl4j-examples</directory>
<directory>arbiter-examples</directory>
<directory>lstm-hdfs</directory>
</directories>
</configuration>
</plugin>
<plugin>
<groupId>com.lewisd</groupId>
<artifactId>lint-maven-plugin</artifactId>
<version>0.0.11</version>
<configuration>
<failOnViolation>true</failOnViolation>
<onlyRunRules>
<rule>DuplicateDep</rule>
<rule>RedundantPluginVersion</rule>
<rule>VersionProp</rule>
<rule>DotVersionProperty</rule>
</onlyRunRules>
</configuration>
<executions>
<execution>
<id>pom-lint</id>
<phase>validate</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>com.lewisd</groupId>
<artifactId>lint-maven-plugin</artifactId>
<versionRange>[0.0.11,)</versionRange>
<goals>
<goal>check</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore/>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
<profiles>
<profile>
<id>OpenJFX</id>
<activation>
<jdk>1.7</jdk>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.0.1</version>
<executions>
<execution>
<id>enforce-default</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireProperty>
<property>env.JAVAFX_HOME</property>
<message>You must set the environment variable JAVAFX_HOME to the installation directory of the JavaFX 2.0 SDK! (with Oracle JDK1.7, $JRE_HOME/lib/jfxrt.jar)</message>
</requireProperty>
</rules>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
<executions>
<execution>
<id>install-external</id>
<phase>clean</phase>
<configuration>
<file>${javafx.runtime.lib.jar}</file>
<repositoryLayout>default</repositoryLayout>
<groupId>com.oracle</groupId>
<artifactId>javafx</artifactId>
<version>${javafx.version}</version>
<packaging>jar</packaging>
<generatePom>true</generatePom>
</configuration>
<goals>
<goal>install-file</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

How to use maven with Java9.0.1 and pom packaging in Eclipse Oxygen 1a Release (4.7.1a)?

The maven project example that is given below shows an error in module-info.java in Eclipse Oxygen:
log4j.api cannot be resolved to a module.
If I remove the line
<packaging>pom<packaging>
from pom.xml the error disappears. However, I need to use pom packaging. If I use Java8 without module definitions, the maven part in my real world example works very well. Trying to migrate to Java9 confronted me with this new issue. First I thought I would not correctly reference the log4j dependency. Then I found out that is has something to do with the pom packaging that I need in my multi-module project. I created a minimal example that is given below to allow you to reproduce the error messages in Eclipse.
=>Is this a bug of the M2E plugin (1.8.2.20171007-0217)?
=>If not, how do I have to adapt my pom.xml file to work with Java9?
Related issues:
How to use log4j with maven and java9?
Import of a Java-9-Jigsaw-Maven-Project in Eclipse Oxygen 4.7 does not work
Java 9 Modules and JUnit 4
Can Maven generate the module declaration
Where should I put unit tests when migrating a Java 8 project to Jigsaw
Which module should I require in Java 9 to use JPA?
List of java modules: http://download.java.net/java/jigsaw/docs/api/overview-summary.html
Min example project (my real example is more complex):
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>Log4JWithJava9</groupId>
<artifactId>Log4JWithJava9</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
<!-- encoding -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<plugins>
<!-- plugin for resource phase -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
<executions>
<execution>
<id>resource-execution</id>
<phase>process-resources</phase>
<goals>
<goal>resources</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- plugin for compile phase (and test-compile phase) -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<!-- specify current java version here: -->
<source>9</source>
<target>9</target>
</configuration>
<executions>
<execution>
<id>compile-execution</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>test-compile-execution</id>
<phase>test-compile</phase>
<goals>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- ### PACKAGE ### phase -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
<executions>
<execution>
<id>package-execution</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
</configuration>
</execution>
</executions>
</plugin>
<!-- plugin for install phase -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
<executions>
<execution>
<id>install-execution</id>
<phase>install</phase>
<goals>
<goal>install</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<!-- log4j -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.9.1</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.9.1</version>
</dependency>
</dependencies>
</project>
module-info.java
module Log4JWithJava9 {
exports isi.share;
requires javafx.base;
requires log4j.api;
}
Main.java
package isi.share;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
public class Main {
private static Logger sysLog = LogManager.getLogger(Main.class);
public static void main(String[] args) {
}
}
Output for maven run configuration with clean install:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Log4JWithJava9 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # Log4JWithJava9 ---
[INFO] Deleting D:\EclipseJava\workspace\Log4JWithJava9\target
[INFO]
[INFO] --- maven-resources-plugin:3.0.2:resources (resource-execution) # Log4JWithJava9 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory D:\EclipseJava\workspace\Log4JWithJava9\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.7.0:compile (compile-execution) # Log4JWithJava9 ---
[WARNING] ********************************************************************************************************************
[WARNING] * Required filename-based automodules detected. Please don't publish this project to a public artifact repository! *
[WARNING] ********************************************************************************************************************
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to D:\EclipseJava\workspace\Log4JWithJava9\target\classes
[INFO]
[INFO] --- maven-compiler-plugin:3.7.0:testCompile (test-compile-execution) # Log4JWithJava9 ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-jar-plugin:3.0.2:jar (package-execution) # Log4JWithJava9 ---
[INFO] Building jar: D:\EclipseJava\workspace\Log4JWithJava9\target\Log4JWithJava9-0.0.1-SNAPSHOT.jar
[INFO]
[INFO] --- maven-install-plugin:2.5.2:install (default-install) # Log4JWithJava9 ---
[INFO] Installing D:\EclipseJava\workspace\Log4JWithJava9\pom.xml to C:\Users\eis\.m2\repository\Log4JWithJava9\Log4JWithJava9\0.0.1-SNAPSHOT\Log4JWithJava9-0.0.1-SNAPSHOT.pom
[INFO]
[INFO] --- maven-install-plugin:2.5.2:install (install-execution) # Log4JWithJava9 ---
[INFO] Installing D:\EclipseJava\workspace\Log4JWithJava9\pom.xml to C:\Users\eis\.m2\repository\Log4JWithJava9\Log4JWithJava9\0.0.1-SNAPSHOT\Log4JWithJava9-0.0.1-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.520 s
[INFO] Finished at: 2017-11-10T20:41:10+01:00
[INFO] Final Memory: 15M/52M
[INFO] ------------------------------------------------------------------------
Whole Eclipse example project:
https://github.com/stefaneidelloth/java9MavenEclipse
Tools used:
Eclipse for RCP and RAP Developers, Oxygen 1a Release (4.7.1a)
(Including M2E version 1.8.2.20171007-0217)
Java JDK version 9.0.1

maven release:prepare gives [ERROR] No plugin found for prefix 'C' in the current project

I have a maven project which compiles and deploys without any issue. I am trying to use the release:prepare goal but I am getting an error. I have googled and understand that plugins can be given prefixes and the error means it can’t find one with a prefix of ‘C’. I have no idea why it is looking for a plugin with this prefix.
My pom file is:
<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>
<scm>
<connection>scm:git:ssh://git#gitlab.com:rmetcalf9/ICSchema_SAMPLE_UTIL_SCHEMA.git</connection>
<url>ssh://git#gitlab.com:rmetcalf9/ICSchema_SAMPLE_UTIL_SCHEMA.git</url>
<tag>ICSchema_SAMPLE_UTIL_SCHEMA-0.0.1</tag>
</scm>
<groupId>metcarob.com.oracledb.sample.schema</groupId>
<artifactId>ICSchema_SAMPLE_UTIL_SCHEMA</artifactId>
<version>0.0.1</version>
<packaging>jar</packaging>
<name>ICSchema_SAMPLE_UTIL_SCHEMA</name>
<url>http://maven.apache.org</url>
<!--
Command line parameters:
cmd.env - the environment this project is to be deployed to (dev/test/prod/etc)
cmd.parent.sys (OPTIONAL) - for UTILITY schemas this designates the system to use for deployment.
this is overridden by the pom property ic.pom.sys if present
-->
<properties>
<ic.ci.deployment.type>OracleDB</ic.ci.deployment.type>
<ic.ci.resourcedir>${project.basedir}/src/main/resources</ic.ci.resourcedir>
<ic.db.ciuser>CIDBADMIN</ic.db.ciuser>
<ic.db.ciuserpass>PASSWORD_REMOVED_FROM_POST</ic.db.ciuserpass>
<ic.db.schema.name>SAMPLE_UTIL_SCHEMA</ic.db.schema.name>
<ic.db.schema.objecttable>schema_objects</ic.db.schema.objecttable>
<ic.db.sqlplus.connectstring>${ic.db.ciuser}/${ic.db.ciuserpass}#${ic.db.host}:${ic.db.port}/${ic.db.service_name}</ic.db.sqlplus.connectstring>
<ic.db.jdbc.connectstring>jdbc:oracle:thin:#(DESCRIPTION=(enable=broken)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=${ic.db.host})(PORT=${ic.db.port})))(CONNECT_DATA=(service_name=${ic.db.service_name})))</ic.db.jdbc.connectstring>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<distributionManagement>
<snapshotRepository>
<id>ssh-repository</id>
<name>ssh-repository</name>
<url>scpexe://mvn.metcarob.com:7456/public_snapshots</url>
</snapshotRepository>
<repository>
<id>ssh-repository</id>
<name>ssh-repository</name>
<url>scpexe://mvn.metcarob.com:7456/public</url>
</repository>
</distributionManagement>
<repositories>
<repository>
<id>ic_snapshot</id>
<url>https://mvnsnap.metcarob.com</url>
</repository>
<repository>
<id>ic_main</id>
<url>https://mvn.metcarob.com</url>
</repository>
</repositories>
<build>
<plugins>
<!-- First plugin will caculate the sys property -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.10</version>
<executions>
<execution>
<id>bsh-property</id>
<goals>
<goal>bsh-property</goal>
</goals>
<configuration>
<properties>
<property>ic.actual.sys</property>
</properties>
<source>
ic.actual.sys = project.getProperties().getProperty("ic.pom.sys", session.getUserProperties().getProperty("cmd.parent.sys"));
</source>
</configuration>
</execution>
</executions>
</plugin>
<!-- Second plugin will read property values at the start of the validate phase -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0-alpha-2</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
</execution>
</executions>
<configuration>
<files>
<file>${env.CIICENV_HOME}/${cmd.env}/${ic.actual.sys}.properties</file>
</files>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.5.0</version>
<executions>
<execution>
<id>deploy-dependancies</id>
<phase>validate</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>ci_deployer</executable>
<arguments>
<argument>${project.basedir}/pom.xml</argument>
<argument>NULL</argument>
<argument>${cmd.env}</argument>
<argument>${ic.actual.sys}</argument>
</arguments>
<workingDirectory>${ic.ci.resourcedir}</workingDirectory>
</configuration>
</execution>
<execution>
<id>pre-hook</id>
<phase>compile</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>sqlplus</executable>
<arguments>
<argument>${ic.db.sqlplus.connectstring}</argument>
<argument>as</argument>
<argument>sysdba</argument>
<argument>#_control.sql</argument>
<argument>${ic.db.schema.name}</argument>
</arguments>
<workingDirectory>${ic.ci.resourcedir}/db/pre_migration</workingDirectory>
</configuration>
</execution>
<execution>
<id>sqlcodedeploy-setup</id>
<phase>compile</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>sqlcodedeploy_setup</executable>
<arguments>
<argument>${ic.ci.resourcedir}/db/code</argument>
<argument>${ic.db.sqlplus.connectstring}</argument>
<argument>${ic.db.schema.name}</argument>
<argument>${project.version}</argument>
<argument>${ic.db.schema.objecttable}</argument>
</arguments>
<workingDirectory>${ic.ci.resourcedir}/db/code</workingDirectory>
</configuration>
</execution>
<execution>
<id>migrate-datastructures</id>
<phase>compile</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>ci_flyway</executable>
<arguments>
<argument>"${ic.db.jdbc.connectstring}"</argument>
<argument>"${ic.db.ciuser}"</argument>
<argument>"${ic.db.ciuserpass}"</argument>
<argument>"${ic.db.schema.name}"</argument>
<argument>"${ic.ci.resourcedir}/db/migration"</argument>
</arguments>
<workingDirectory>${ic.ci.resourcedir}</workingDirectory>
</configuration>
</execution>
<execution>
<id>deploy-code</id>
<phase>compile</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>sqlcodedeploy</executable>
<arguments>
<argument>${ic.ci.resourcedir}/db/code</argument>
<argument>${ic.db.sqlplus.connectstring}</argument>
<argument>${ic.db.schema.name}</argument>
<argument>${project.version}</argument>
<argument>${ic.db.schema.objecttable}</argument>
</arguments>
<workingDirectory>${ic.ci.resourcedir}/db/code</workingDirectory>
</configuration>
</execution>
<execution>
<id>sqlplusmulti-runtests</id>
<phase>test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>sqlplusmulti</executable>
<arguments>
<argument>${project.basedir}/src/test/resources/db/code</argument>
<argument>${ic.db.sqlplus.connectstring}</argument>
<argument>${ic.db.schema.name}</argument>
<argument>*.sql</argument>
</arguments>
<workingDirectory>${project.basedir}/src/test/resources/db/code</workingDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<extensions>
<!-- Enabling the use of SSH -->
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh-external</artifactId>
<version>2.10</version>
</extension>
</extensions>
</build>
</project>
I use the command mvn -X release:prepare -Dcmd.env=dev -Dcmd.parent.sys=soa to run it and the output is too big for the post but the relevant part is:
INFO] Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-metadata.xml (13 KB at 43.2 KB/sec)
[INFO] [DEBUG] Writing tracking file C:\off_desk\eclipse_workspaces\CITesting\ICSchema_SAMPLE_UTIL_SCHEMA\true\org\apache\maven\plugins\resolver-status.properties
[INFO]
[INFO] Downloaded: https://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadata.xml (20 KB at 66.9 KB/sec)
[INFO] [DEBUG] Writing tracking file C:\off_desk\eclipse_workspaces\CITesting\ICSchema_SAMPLE_UTIL_SCHEMA\true\org\codehaus\mojo\resolver-status.properties
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] BUILD FAILURE
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Total time: 0.890 s
[INFO] [INFO] Finished at: 2016-09-23T12:39:47+01:00
[INFO] [INFO] Final Memory: 12M/304M
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [ERROR] No plugin found for prefix 'C' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (C:\off_desk\eclipse_workspaces\CITesting\ICSchema_SAMPLE_UTIL_SCHEMA\true), central (https://repo.maven.apache.org/maven2)] -> [Help 1]
[INFO] org.apache.maven.plugin.prefix.NoPluginFoundForPrefixException: No plugin found for prefix 'C' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (C:\off_desk\eclipse_workspaces\CITesting\ICSchema_SAMPLE_UTIL_SCHEMA\true), central (https://repo.maven.apache.org/maven2)]
[INFO] at org.apache.maven.plugin.prefix.internal.DefaultPluginPrefixResolver.resolve(DefaultPluginPrefixResolver.java:93)
[INFO] at org.apache.maven.lifecycle.internal.MojoDescriptorCreator.findPluginForPrefix(MojoDescriptorCreator.java:265)
[INFO] at org.apache.maven.lifecycle.internal.MojoDescriptorCreator.getMojoDescriptor(MojoDescriptorCreator.java:219)
[INFO] at org.apache.maven.lifecycle.internal.DefaultLifecycleTaskSegmentCalculator.calculateTaskSegments(DefaultLifecycleTaskSegmentCalculator.java:103)
[INFO] at org.apache.maven.lifecycle.internal.DefaultLifecycleTaskSegmentCalculator.calculateTaskSegments(DefaultLifecycleTaskSegmentCalculator.java:83)
[INFO] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:89)
[INFO] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
[INFO] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
[INFO] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
[INFO] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
[INFO] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
[INFO] at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
[INFO] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[INFO] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[INFO] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[INFO] at java.lang.reflect.Method.invoke(Method.java:497)
[INFO] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
[INFO] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
[INFO] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
[INFO] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[INFO] [ERROR]
[INFO] [ERROR]
[INFO] [ERROR] For more information about the errors and possible solutions, please read the following articles:
[INFO] [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoPluginFoundForPrefixException
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Skipping ICSchema_SAMPLE_UTIL_SCHEMA
[INFO] This project has been banned from the build due to previous failures.
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.663 s
[INFO] Finished at: 2016-09-23T12:39:47+01:00
[INFO] Final Memory: 13M/309M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.3.2:prepare (default-cli) on project ICSchema_SAMPLE_UTIL_SCHEMA: Maven execution failed, exit code: '1' -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.3.2:prepare (default-cli) on project ICSchema_SAMPLE_UTIL_SCHEMA: Maven execution failed, exit code: '1'
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:497)
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.MojoExecutionException: Maven execution failed, exit code: '1'
at org.apache.maven.plugins.release.PrepareReleaseMojo.prepareRelease(PrepareReleaseMojo.java:295)
at org.apache.maven.plugins.release.PrepareReleaseMojo.execute(PrepareReleaseMojo.java:247)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
... 20 more
Caused by: org.apache.maven.shared.release.ReleaseExecutionException: Maven execution failed, exit code: '1'
at org.apache.maven.shared.release.phase.AbstractRunGoalsPhase.execute(AbstractRunGoalsPhase.java:89)
at org.apache.maven.shared.release.phase.RunPrepareGoalsPhase.execute(RunPrepareGoalsPhase.java:44)
at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:234)
at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:169)
at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:146)
at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:107)
at org.apache.maven.plugins.release.PrepareReleaseMojo.prepareRelease(PrepareReleaseMojo.java:291)
... 23 more
Caused by: org.apache.maven.shared.release.exec.MavenExecutorException: Maven execution failed, exit code: '1'
at org.apache.maven.shared.release.exec.InvokerMavenExecutor.executeGoals(InvokerMavenExecutor.java:409)
at org.apache.maven.shared.release.exec.AbstractMavenExecutor.executeGoals(AbstractMavenExecutor.java:85)
at org.apache.maven.shared.release.phase.AbstractRunGoalsPhase.execute(AbstractRunGoalsPhase.java:81)
... 29 more
[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/MojoExecutionException
This has the "No Plugin found for prefix C".
Does anyone have any suggestions as to where to look to narrow down the cause?
I have tried commenting out all the plugins from the pom and I still get the same error.
My problem was caused by the way I launched maven. I had created a batch script for it in a central batch directory. This worked for
mvn package
mvn deploy
etc.
but not the release plugin.
I had to put maven in my path. I got another error complaining that maven could not find mvn.bat. I looked in the maven directory
C:\Program Files\Apache\apache-maven-3.3.9\bin
and I found "mvn" and "mvn.cmd" but no "mvn.bat".
I copied "mvn.cmd" to "mvn.bat" and it now seems to work.
I then found that my arguments were being ignored. I discovered that I need to call mvn in a strange way to make the arguments work:
mvn release:prepare -Darguments="-Dcmd.env=dev -Dcmd.parent.sys=soa"
Finally it worked. (Well I am debuging a git related issue now)
Thanks everyone for the help
I think that is the correct way to pass arguments to the release plugin.
Otherwise release plugin ignores the values of properties.
Or in your pom file, in maven-release-plugin's configuration you should have:
${releaseParams}
or
-Dparam=$value -Dparam=$value

Embedded error: Failed to transfer file: http://localhost:4502/apps/myProject-core.jar. Return code is: 401

I use the following profile to deploy my osgi bundle to CQ5/crx:
<id>deployToAuthor</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>echo Deployment auf Authoren-Instanz, myProject</id>
<phase>install</phase>
<configuration>
<tasks>
<echo
message="Deployment auf Instanz AUTHOR ! (${install.host}:${install.port}), myProject!"/>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>wagon-maven-plugin</artifactId>
<version>1.0-beta-3</version>
<executions>
<execution>
<id>upload-felix-bundle-author</id>
<phase>install</phase>
<goals>
<goal>upload</goal>
</goals>
<configuration>
<fromDir>${project.build.directory}</fromDir>
<includes>*.jar</includes>
<excludes>pom.xml</excludes>
<serverId>${install.host}</serverId>
<url>dav:${webdav.protocol}://${install.host}:${install.port}</url>
<toDir>apps/${portal.name}/install</toDir>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
I get the following Error:
[INFO] Tests are skipped.
[INFO] [bundle:bundle {execution: default-bundle}]
[WARNING] Bundle path.myProject:myProject-core:bundle:1.5.18-SNAPSHOT : Export path.myProject.components.alerts, has 1, private references [au.com.bytecode.opencsv],
[WARNING] Bundle path.myProject:myProject-core:bundle:1.5.18-SNAPSHOT : Export path.myProject.unionhtmlimport, has 1, private references [path.myProject.unionhtmlimport.impl],
[INFO] [resources:copy-resources {execution: copy-resources}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] [install:install {execution: default-install}]
[INFO] Installing C:\path\myProject\myProject-core\target\myProject-core.jar to C:\path\.m2\repository\path\myProject\myProject-core\1.5.18-SNAPSHOT\myProject-core-1.5.18-SNAPSHOT.jar
[INFO] [bundle:install {execution: default-install}]
[INFO] Installing path/myProject/myProject-core/1.5.18-SNAPSHOT/myProject-core-1.5.18-SNAPSHOT.jar
[INFO] Writing OBR metadata
[INFO] [antrun:run {execution: echo Deployment auf Authoren-Instanz, myProject}]
[INFO] Executing tasks
[echo] Deployment auf Instanz AUTHOR ! (localhost:4502), Project myProject!
[INFO] Executed tasks
[INFO] [wagon:upload {execution: upload-felix-bundle-author}]
[INFO] Uploading C:\path\myProject\myProject-core\target\myProject-core.jar to http://localhost:4502/apps/myProject/install/myProject-core.jar ...
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error handling resource
Embedded error: Failed to transfer file: http://localhost:4502/apps/myProject/install/myProject-core.jar. Return code is: 401
Seems to be quite complicated. Why not to use Maven Sling plugin?
<project>
<properties>
<sling.url>http://localhost:4502</sling.url>
<sling.username>admin</sling.username>
<sling.password>admin</sling.password>
</properties>
...
<build>
<plugins>
<plugin>
<groupId>org.apache.sling</groupId>
<artifactId>maven-sling-plugin</artifactId>
<version>2.1.0</version>
<configuration>
<bundleFileName>${project.build.directory}/${project.build.finalName}.jar</bundleFileName>
<user>${sling.username}</user>
<password>${sling.password}</password>
<slingUrl>${sling.url}/system/console</slingUrl>
</configuration>
</plugin>
...
Usage:
mvn clean package sling:install
Also, please take a look on a sample project using this plugin: Sling-Query.

How to generate jar for maven parent project

Maven requires a parent project to have
<packaging>pom</packaging>
clause in the parent's pom.xml. When such a project installed, only a pom-file generated into the maven repository. Jar-file is not generated, no matter if the parent project has any Java code. That forces me to have extra empty parent projects, which is overkill. Logically, some of my libraries could be parents at the same time.
Is there a way to generate both pom and jar files for a parent project without removing/adding the packaging clause between installs?
Use Maven Jar Plugin and Maven Build Helper. Example POM:
<?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>test</groupId>
<artifactId>test</artifactId>
<version>1.0</version>
<packaging>pom</packaging>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>attach-artifacts</id>
<phase>package</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>test-${project.version}</file>
<type>jar</type>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>default</id>
<goals>
<goal>jar</goal>
</goals>
<phase>package</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Maven build results:
mvn install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building test 1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- build-helper-maven-plugin:1.7:attach-artifact (attach-artifacts) # test ---
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default) # test ---
[WARNING] JAR will be empty - no content was marked for inclusion!
[INFO]
[INFO] --- maven-install-plugin:2.3.1:install (default-install) # test ---
[INFO] Installing /home/username/projects/test/pom.xml to /home/username/.m2/repository/test/test/1.0/test-1.0.pom
[INFO] Installing /home/username/projects/test/test-1.0 to /home/username/.m2/repository/test/test/1.0/test-1.0.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.805s
[INFO] Finished at: Thu Sep 06 13:33:20 EDT 2012
[INFO] Final Memory: 4M/119M
[INFO] ------------------------------------------------------------------------
A note on Maven practices:
Parent modules are typically where you define the dependencies and plugins used in common by all your child modules. It rarely has output of its own. You probably want to have a "distribution" sub-module that aggregates all your other module artifacts, rather than attempting to do it in the parent module.

Resources