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

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

Related

maven-dependency-plugin usage to download dependency jars

Hoping someone can explain how to set the plugin options correctly.
I am looking to have a pom file that someone could execute an mvn command on to download all the jars of the dependencies (transitive included) defined in the pom (including their sources and javadoc jars) from Maven Central and copy them to a specified directory.
My question appears quite similar to maven-dependency-plugin ignores outputDirectory configuration but dwells on a slightly different aspect. Tried the approach advised in the accepted answer there but that didn't work.
pom file:
<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>gq.jetstream</groupId>
<artifactId>maven-download-sources-javadocs</artifactId>
<version>0.0.1-SNAPSHOT</version>
<properties>
<org.springframework.version>5.2.22.RELEASE</org.springframework.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${org.springframework.version}</version>
</dependency>
</dependencies>
<build>
<!-- <sourceDirectory>src</sourceDirectory> -->
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<includeScope>runtime</includeScope>
<classifier>sources</classifier>
<classifier>javadoc</classifier>
<outputDirectory>${project.build.directory}/dependency-jars/</outputDirectory>
<includeClassifiers>sources,javadoc</includeClassifiers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Executing mvn package against this pom doesn't do anything. The output for the goal execution was empty.
Alt 1: Tried the following command. This copied the javadoc jars only and not the binary jars and sources jars of the dependencies.
mvn dependency:copy-dependencies#copy-dependencies
[INFO] Scanning for projects...
[INFO]
[INFO] ------------< gq.jetstream:maven-download-sources-javadocs >------------
[INFO] Building maven-download-sources-javadocs 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:3.3.0:copy-dependencies (copy-dependencies) # maven-download-sources-javadocs ---
[INFO] Copying spring-core-5.2.22.RELEASE-javadoc.jar to C:\projects\code\maven-download-sources-javadocs\target\dependency-jars\spring-core-5.2.22.RELEASE-javadoc.jar
[INFO] Copying spring-jcl-5.2.22.RELEASE-javadoc.jar to C:\projects\code\maven-download-sources-javadocs\target\dependency-jars\spring-jcl-5.2.22.RELEASE-javadoc.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.846 s
[INFO] Finished at: 2022-06-22T02:09:55+01:00
[INFO] ------------------------------------------------------------------------

azure-functions-maven-plugin final jar missing libraries in classpath

I am try to deploy Java Azure function app from my local machine. My tech stack is fallows,
Azure Function App OS: Linux
Azure Functions Core Tools (2.0.3)
Springboot 2.6.3
spring-boot-maven-plugin 2.6.3
azure-functions-maven-plugin 1.14.3
azure-functions-java-library 1.4.2
spring-cloud-function-adapter-azure 3.2.1
Here is my pom.xml
<?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>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.6.3</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.avol.func</groupId>
<artifactId>springcloud-eh-func</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Azure Java Functions</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>11</java.version>
<azure.functions.maven.plugin.version>1.14.3</azure.functions.maven.plugin.version>
<azure.functions.java.library.version>1.4.2</azure.functions.java.library.version>
<functionAppName>poc-java-func-apsp</functionAppName>
<resource.groupname>AvolPOCs</resource.groupname>
<appserviceplan.name>ASP-AvolPOCs-84f2</appserviceplan.name>
<azure.region>southcentralus</azure.region>
<azure.subscriptionid>xxxxxx</azure.subscriptionid>
<stagingDirectory>${project.build.directory}/azure-functions/${functionAppName}</stagingDirectory>
<start-class>com.avol.func.SpringAppRunner</start-class>
</properties>
<dependencies>
<dependency>
<groupId>com.microsoft.azure.functions</groupId>
<artifactId>azure-functions-java-library</artifactId>
<version>${azure.functions.java.library.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-function-adapter-azure</artifactId>
<version>3.2.1</version>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>applicationinsights-spring-boot-starter</artifactId>
<version>2.6.3</version>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>applicationinsights-logging-logback</artifactId>
<version>2.6.3</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.22</version>
</dependency>
<!-- Test -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.8.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>4.2.0</version>
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-function-dependencies</artifactId>
<version>3.2.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.microsoft.azure.functions</groupId>
<artifactId>azure-functions-java-library</artifactId>
<version>${azure.functions.java.library.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<filesets>
<fileset>
<directory>obj</directory>
</fileset>
</filesets>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${stagingDirectory}/lib</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>false</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer>
<includeScope>runtime</includeScope>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-functions-maven-plugin</artifactId>
<version>${azure.functions.maven.plugin.version}</version>
<configuration>
<subscriptionId>${azure.subscriptionid}</subscriptionId>
<!-- function app name -->
<appName>${functionAppName}</appName>
<!-- function app resource group -->
<resourceGroup>${resource.groupname}</resourceGroup>
<!-- function app service plan name -->
<appServicePlanName>${appserviceplan.name}</appServicePlanName>
<!-- function app region-->
<!-- refers https://github.com/microsoft/azure-maven-plugins/wiki/Azure-Functions:-Configuration-Details#supported-regions for all valid values -->
<region>${azure.region}</region>
<!-- function pricingTier, default to be consumption if not specified -->
<!-- refers https://github.com/microsoft/azure-maven-plugins/wiki/Azure-Functions:-Configuration-Details#supported-pricing-tiers for all valid values -->
<!-- <pricingTier></pricingTier> -->
<!-- Whether to disable application insights, default is false -->
<disableAppInsights>false</disableAppInsights>
<runtime>
<os>linux</os>
<javaVersion>11</javaVersion>
</runtime>
<appSettings>
<property>
<name>FUNCTIONS_EXTENSION_VERSION</name>
<value>~4</value>
</property>
<property>
<name>FUNCTIONS_WORKER_RUNTIME</name>
<value>java</value>
</property>
</appSettings>
</configuration>
<executions>
<execution>
<id>package-functions</id>
<goals>
<goal>package</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<id>copy-resources</id>
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<overwrite>true</overwrite>
<outputDirectory>
${project.build.directory}/azure-functions/${functionAppName}
</outputDirectory>
<resources>
<resource>
<directory>${project.basedir}/src/main/resources
</directory>
<includes>
<include>**</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.6.3</version>
<dependencies>
<dependency>
<groupId>org.springframework.boot.experimental</groupId>
<artifactId>spring-boot-thin-layout</artifactId>
<version>1.0.28.RELEASE</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
Here is my maven build logs,
$ mvn clean package
[INFO] Scanning for projects...
[INFO]
[INFO] ----------------< com.avol.func:springcloud-eh-func >----------------
[INFO] Building Azure Java Functions 1.0.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) # springcloud-eh-func ---
[INFO] Deleting C:\Users\padaldl\workspace\projects\Avol-POCs\src\Java\JavaFunAppPOC\springcloud-eh-func\target
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) # springcloud-eh-func ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] Copying 1 resource
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) # springcloud-eh-func ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 10 source files to C:\Users\padaldl\workspace\projects\Avol-POCs\src\Java\JavaFunAppPOC\springcloud-eh-func\target\classes
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:testResources (default-testResources) # springcloud-eh-func ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] skip non existing resourceDirectory C:\Users\padaldl\workspace\projects\Avol-POCs\src\Java\JavaFunAppPOC\springcloud-eh-func\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) # springcloud-eh-func ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.22.2:test (default-test) # springcloud-eh-func ---
[INFO] No tests to run.
[INFO]
[INFO] --- maven-dependency-plugin:3.2.0:copy-dependencies (copy-dependencies) # springcloud-eh-func ---
[INFO] Copying azure-functions-java-library-1.4.2.jar to C:\Users\padaldl\workspace\projects\Avol-POCs\src\Java\JavaFunAppPOC\springcloud-eh-func\target\azure-functions\poc-java-func-apsp\lib\azure-functions-java-library-1.4.2.jar
[INFO]
[INFO] --- maven-jar-plugin:3.2.2:jar (default-jar) # springcloud-eh-func ---
[INFO] Building jar: C:\Users\padaldl\workspace\projects\Avol-POCs\src\Java\JavaFunAppPOC\springcloud-eh-func\target\springcloud-eh-func-1.0.0-SNAPSHOT.jar
[INFO]
[INFO] --- azure-functions-maven-plugin:1.14.3:package (package-functions) # springcloud-eh-func ---
[INFO] Java home : C:/Users/padaldl/workspace/installedsws/zulu-11-azure-jdk_11.52.13-11.0.13-win_x64
[INFO] Artifact compile version : 11
[INFO]
[INFO] Step 1 of 8: Searching for Azure Functions entry points
[INFO] 2 Azure Functions entry point(s) found.
[INFO]
[INFO] Step 2 of 8: Generating Azure Functions configurations
[INFO] Generation done.
[INFO]
[INFO] Step 3 of 8: Validating generated configurations
[INFO] Validation done.
[INFO]
[INFO] Step 4 of 8: Saving host.json
[INFO] Successfully saved to C:\Users\padaldl\workspace\projects\Avol-POCs\src\Java\JavaFunAppPOC\springcloud-eh-func\target\azure-functions\poc-java-func-apsp\host.json
[INFO]
[INFO] Step 5 of 8: Saving local.settings.json
[INFO] Successfully saved to C:\Users\padaldl\workspace\projects\Avol-POCs\src\Java\JavaFunAppPOC\springcloud-eh-func\target\azure-functions\poc-java-func-apsp\local.settings.json
[INFO]
[INFO] Step 6 of 8: Saving configurations to function.json
[INFO] Starting processing function: uppercase
[INFO] Successfully saved to C:\Users\padaldl\workspace\projects\Avol-POCs\\src\Java\JavaFunAppPOC\springcloud-eh-func\target\azure-functions\poc-java-func-apsp\uppercase\function.json
[INFO] Starting processing function: assetSync
[INFO] Successfully saved to C:\Users\padaldl\workspace\projects\Avol-POCs\src\Java\JavaFunAppPOC\springcloud-eh-func\target\azure-functions\poc-java-func-apsp\assetSync\function.json
[INFO]
[INFO] Step 7 of 8: Copying JARs to staging directoryC:\Users\padaldl\workspace\projects\Avol-POCs\src\Java\JavaFunAppPOC\springcloud-eh-func\target\azure-functions\poc-java-func-apsp
[INFO] Copied successfully.
[INFO] Step 8 of 8: Installing function extensions if needed
[INFO] Extension bundle specified, skip install extension
[INFO] Successfully built Azure Functions.
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:copy-resources (copy-resources) # springcloud-eh-func ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] Copying 2 resources
[INFO]
[INFO] --- spring-boot-maven-plugin:2.6.3:repackage (repackage) # springcloud-eh-func ---
[INFO] Replacing main artifact with repackaged archive
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 29.790 s
[INFO] Finished at: 2022-02-03T19:39:15+05:30
[INFO] ------------------------------------------------------------------------
Function App works fine in local from IntellIJ IDEA, and as well run through mvn azure-functions:run command.
When I run the jar using java command java -jar <> it fails with error No Class Definition found error.
mvn azure-functions:deploy succeeded without any issue, and am able to see functions created on azure, but when I trigger function it fails with 500 Internal Error.
I suspect function failing in azure due to external dependencies not added to classpath of jar. From the stackoverflow I found similar question here, suggestion is to go with maven assembly plugin, but my question is why should we use Assembly plugin when I am using springboot plugin?
Finally issue got resolved after installing Azure Functions Core Tools version 4.x through MSI installer on windows.
https://learn.microsoft.com/en-us/azure/azure-functions/functions-run-local?tabs=v4%2Cwindows%2Ccsharp%2Cportal%2Cbash#v2
And it looks like azure functions refer /lib folder under staging directory when function triggers, it need not be springboot fat jar.

How to Integrate Integration Tests Using Cucumber 6 and Maven

I really need help here.
Objective: Run my cucumber integration tests using Cucumber-Java8 version 6.7.0 with Maven 3.6.3.
Actual Scenario: When I run maven using this command: $ mvn clean verify -Pintegration-tests I am receiving this result.
xxxxx # xxx <Project Name> % mvn clean verify -Pintegration-tests
[INFO] Scanning for projects...
[INFO]
[INFO] ----------< <Project Name> >----------
[INFO] Building <Project Name> 0.0.1
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) # <Project Name> ---
[INFO] Deleting /Users/<home>/Documents/repos/xxx/<Project Name>/target
[INFO]
[INFO] --- build-helper-maven-plugin:3.1.0:add-test-source (add-source) # <Project Name> ---
***[INFO] Test Source directory: /Users/<home>/Documents/repos/xxxx/<Project Name>/src/testintegration added.***
[INFO]
[INFO] --- build-helper-maven-plugin:3.1.0:add-test-resource (add-resource) # <Project Name ---
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) # <Project Name> ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 13 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) # <Project Name> ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 223 source files to /Users/<home>/Documents/repos/xxx/<Project Name>
...
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:testResources (default-testResources) # <Project Name> ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 15 resources
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) # n<Project Name> ---
[INFO] Changes detected - recompiling the module!
...
[INFO]
[INFO] --- maven-surefire-plugin:2.22.2:test (default-test) # <Project Name> ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-jar-plugin:3.2.0:jar (default-jar) # <Project Name> ---
[INFO] Building jar: /Users/<home>/Documents/repos/xxxx/<Project Name> -server/target/<Project Name>.jar
[INFO]
[INFO] --- maven-failsafe-plugin:2.22.2:integration-test (default) # <Project Name> ---
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO]
[INFO] --- maven-failsafe-plugin:2.22.2:verify (default) # <Project Name> ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.484 s
[INFO] Finished at: 2020-10-17T13:07:50+01:00
[INFO] ------------------------------------------------------------------------
I didn't put any code in my Definition Class except "Sysout" and assertTrue. The Integration Test runs when I use a runner that I created trigger by Intellij.
#RunWith(Cucumber.class)
#CucumberOptions(
features = {"src/testintegration/java/features"},
glue = {"steps"},
plugin = {"pretty", "html:target/cucumber"},
publish = true)
public class RunCucumberIT {
Code Scenario Actual
Sctructure of the Project - Intellij
Maven File - Snipped
<!-- Integration tests -->
<profiles>
<profile>
<id>integration-tests</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<cucumber.plugin>json:target/report.json</cucumber.plugin>
<cucumber.filter.tags>#wip</cucumber.filter.tags>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>2.7</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-test-source</goal>
</goals>
<configuration>
<sources>
<source>src/testintegration/</source>
</sources>
</configuration>
</execution>
<execution>
<id>add-resource</id>
<phase>generate-sources</phase>
<goals>
<goal>add-test-resource</goal>
</goals>
<configuration>
<resources>
<resource>
<directory>src/testintegration/resources/features</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<!-- block unit tests execution -->
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
<configuration>
<systemPropertyVariables>
<cucumber.plugin>${cucumber.plugin}</cucumber.plugin>
<cucumber.filter.tags>${cucumber.filter.tags}</cucumber.filter.tags>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<!-- Cucumber -->
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java8</artifactId>
<version>${cucumber.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit</artifactId>
<version>${cucumber.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<version>6.2.2</version>
<scope>test</scope>
</dependency>
</dependencies>
</profile>
</profiles>
</project>
Definition Class
package steps;
import static org.junit.jupiter.api.Assertions.assertTrue;
import io.cucumber.java8.En;
public class Authorization implements En {
public Authorization() {
Given("the system knows about the following attributes",
(io.cucumber.datatable.DataTable dataTable) -> {
System.out.println("AUTHORIZATION GIVEN TEST");
assertTrue(true);
});
When("the client request POST \\/login", () -> {
System.out.println("AUTHORIZATION When TEST");
assertTrue(true);
});
Then("the response should be JSON", (io.cucumber.datatable.DataTable dataTable) -> {
System.out.println("AUTHORIZATION Then TEST");
assertTrue(true);
});
}
}
Part of Feature File
Feature: Authorization
#wip
Scenario: Login into account
...
Runner Class - (When I trigger this class by Intellij my test run correctly
package runner;
import io.cucumber.junit.Cucumber;
import io.cucumber.junit.CucumberOptions;
import org.junit.runner.RunWith;
#RunWith(Cucumber.class)
#CucumberOptions(
features = {"src/testintegration/java/features"},
glue = {"steps"},
plugin = {"pretty", "html:target/cucumber"},
publish = true)
public class RunCucumberIT {
}
I used this page here to try to do work my tests. But to be honest I don't know if I am doing something wrong or the article is missing something.
Here is the website.(weblogism)
Please, could someone check the Pom.xml file? I think I am missing something.
Many thanks if someone can help me here.
Cheers,

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.

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

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!

Resources