I have a JavaFX app that I have successfully built and run with Java SDK 1.8. I am trying to move it to Java 11 with an ultimate goal of using Java 14 and can not create a runnable jar. To try and understand the process I have downloaded the javafx helloFX example and tried to follow the instructions at https://openjfx.io/openjfx-docs/#modular for Maven. When I run the mvn clean javafx:jlink I get the error:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------< org.openjfx:hellofx >-------------------------
[INFO] Building demo 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # hellofx ---
[INFO] Deleting C:\Users\jungl\eclipse-workspace\helloFX\Maven\hellofx\target
[INFO]
[INFO] --- javafx-maven-plugin:0.0.3:jlink (default-cli) # hellofx ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\jungl\eclipse-workspace\helloFX\Maven\hellofx\src\main\resources
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to C:\Users\jungl\eclipse-workspace\helloFX\Maven\hellofx\target\classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.345 s
[INFO] Finished at: 2020-04-14T14:52:18+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.openjfx:javafx-maven-plugin:0.0.3:jlink (default-cli) on project hellofx: Error: jlink requires a module descriptor -> [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
The pom.xml 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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.openjfx</groupId>
<artifactId>hellofx</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>demo</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>11</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>0.0.3</version>
<configuration>
<mainClass>HelloFX</mainClass>
<jlinkImageName>hello></jlinkImageName>
<jlinkZipName>hellozip></jlinkZipName>
</configuration>
</plugin>
</plugins>
</build>
</project>
<!-- https://mvnrepository.com/artifact/com.zenjava/javafx-maven-plugin -->
Can anyone point me in the correct direction as I am failing to understand the issue.
The provided example is not structured as the tutorial says. The maven version has been updated under the CommandLine folder. If you go to: ..\CommandLine\Modular\Maven\helloFX and enter the commands mvn clean javafx:run, clean javafx:jlink, target\hellofx\bin\launcher it runs as described in the tutorial.
Related
I am trying to create new maven archetype to generate custom project as per my needs. My project looks like below
My archetype pom looks like following:
<?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>com.tarkshala</groupId>
<artifactId>maven-archetype-tarkshala-service-models</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>tarkshala-service-models-archetype</name>
<!-- Used to point local artifacts to the hosted repo , Starts -->
<distributionManagement>
<repository>
<id>nexus</id>
<name>maven-releases</name>
<url>http://maven.tarkshala.com:10081/repository/maven-releases/</url>
</repository>
<snapshotRepository>
<id>nexus</id>
<name>maven-snapshots</name>
<url>http://maven.tarkshala.com:10081/repository/maven-snapshots/</url>
</snapshotRepository>
</distributionManagement>
<!-- Ends -->
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>18</source>
<target>18</target>
<compilerArgs>--enable-preview</compilerArgs>
</configuration>
</plugin>
</plugins>
</build>
<!-- Check we can delete compiler properties-->
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
</properties>
</project>
and my archetype.xml looks like following
<archetype-descriptor xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0 http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd"
name="maven-archetype-sample" partial="false">
<requiredProperties>
<!-- This is used in pom.xml of the future app. -->
<requiredProperty key="projectName">
<defaultValue>TarkshalaService</defaultValue>
</requiredProperty>
</requiredProperties>
<fileSets>
<fileSet filtered="true" packaged="true">
<directory>src/main/java</directory>
<includes>
<include>**/**.java</include>
</includes>
</fileSet>
<fileSet filtered="true">
<directory/>
<includes>
<include>*.yml</include>
<include>.gitignore</include>
<include>*.md</include>
<include>*.xml</include>
</includes>
</fileSet>
</fileSets>
</archetype-descriptor>
mvn clean install is successful when done on archetype, but mvn generate fails as following
~/W/r/maven-archetype-tarkshala-service-models (master|✚1) [1]$ mvn archetype:generate \
-DarchetypeGroupId=com.tarkshala \
-DarchetypeArtifactId=maven-archetype-tarkshala-service-models \
-DarchetypeVersion=1.0-SNAPSHOT \
-DgroupId=com.tarkshala \
-DartifactId=dhaba-models \
-DprojectName=DhabaModels
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.tarkshala:maven-archetype-tarkshala-service-models:jar:1.0-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. # line 31, column 21
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] -------< com.tarkshala:maven-archetype-tarkshala-service-models >-------
[INFO] Building tarkshala-service-models-archetype 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] >>> maven-archetype-plugin:3.2.1:generate (default-cli) > generate-sources # maven-archetype-tarkshala-service-models >>>
[INFO]
[INFO] <<< maven-archetype-plugin:3.2.1:generate (default-cli) < generate-sources # maven-archetype-tarkshala-service-models <<<
[INFO]
[INFO]
[INFO] --- maven-archetype-plugin:3.2.1:generate (default-cli) # maven-archetype-tarkshala-service-models ---
[INFO] Generating project in Interactive mode
[WARNING] Archetype not found in any catalog. Falling back to central repository.
[WARNING] Add a repository with id 'archetype' in your settings.xml if archetype's repository is elsewhere.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.892 s
[INFO] Finished at: 2023-01-28T07:38:18+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:3.2.1:generate (default-cli) on project maven-archetype-tarkshala-service-models: Cannot invoke "org.codehaus.plexus.util.xml.Xpp3Dom.getValue()" because the return value of "org.codehaus.plexus.util.xml.Xpp3Dom.getChild(String)" is null -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
Can someone please help to point what exactly am I doing wrong.
This question already has answers here:
Find Oracle JDBC driver in Maven repository
(21 answers)
Closed 3 years ago.
I am having problems trying to build my project with maven, more specifically when a dependency is required, that of Oracle JDBC 7, I have been looking for a solution for hours and nothing, even consult some of the questions raised regarding that here but nothing
C:\Users\E10697\Desktop\Contenedores\oracle_contenedores\Entorno-Oracle-sobre-Docker-master\4. Consumo de la Oracle DB a través de un API Rest\4.1. Elaboración del API Rest\4.1.2. Implementación de una API Rest\OpenwebinarDockerAPI - RESUELTO\OPENWE~1>mvn clean install
error: [ERROR] Failed to execute goal on project app-rest-api: Could not resolve dependencies for project openwebinar.marvel.app:app-rest-api:war:0.1.0-SNAPSHOT: Could not find artifact com.oracle:ojdbc7:jar:12.1.0 in spring-milestones (https://repo.spring.io/milestone)
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] rest-api [pom]
[INFO] app-rest-api [war]
[INFO] app-web [war]
[INFO]
[INFO] ---------------------< openwebinar.marvel.app:app >---------------------
[INFO] Building rest-api 0.1.0-SNAPSHOT [1/3]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.0.0:clean (default-clean) # app ---
[INFO]
[INFO] --- maven-install-plugin:2.5.2:install (default-install) # app ---
[INFO] Installing C:\Users\E10697\Desktop\Contenedores\oracle_contenedores\Entorno-Oracle-sobre-Docker-master\4. Consumo de la Oracle DB a través de un API Rest\4.1. Elaboración del API Rest\4.1.2. Implementación de una API Rest\OpenwebinarDockerAPI - RESUELTO\OPENWE~1\pom.xml to C:\Users\E10697\.m2\repository\openwebinar\marvel\app\app\0.1.0-SNAPSHOT\app-0.1.0-SNAPSHOT.pom
[INFO]
[INFO] ----------------< openwebinar.marvel.app:app-rest-api >-----------------
[INFO] Building app-rest-api 0.1.0-SNAPSHOT [2/3]
[INFO] --------------------------------[ war ]---------------------------------
Downloading from spring-milestones: https://repo.spring.io/milestone/com/oracle/ojdbc7/12.1.0/ojdbc7-12.1.0.pom
Downloading from repository.springframework.maven.release: http://maven.springframework.org/milestone/com/oracle/ojdbc7/12.1.0/ojdbc7-12.1.0.pom
Downloading from org.springframework: http://maven.springframework.org/snapshot/com/oracle/ojdbc7/12.1.0/ojdbc7-12.1.0.pom
Downloading from spring-milestone: http://repo.spring.io/libs-milestone/com/oracle/ojdbc7/12.1.0/ojdbc7-12.1.0.pom
Downloading from spring-release: http://repo.spring.io/libs-release/com/oracle/ojdbc7/12.1.0/ojdbc7-12.1.0.pom
Downloading from central: https://repo.maven.apache.org/maven2/com/oracle/ojdbc7/12.1.0/ojdbc7-12.1.0.pom
[WARNING] The POM for com.oracle:ojdbc7:jar:12.1.0 is missing, no dependency information available
Downloading from spring-milestones: https://repo.spring.io/milestone/com/oracle/ojdbc7/12.1.0/ojdbc7-12.1.0.jar
Downloading from repository.springframework.maven.release: http://maven.springframework.org/milestone/com/oracle/ojdbc7/12.1.0/ojdbc7-12.1.0.jar
Downloading from org.springframework: http://maven.springframework.org/snapshot/com/oracle/ojdbc7/12.1.0/ojdbc7-12.1.0.jar
Downloading from spring-milestone: http://repo.spring.io/libs-milestone/com/oracle/ojdbc7/12.1.0/ojdbc7-12.1.0.jar
Downloading from spring-release: http://repo.spring.io/libs-release/com/oracle/ojdbc7/12.1.0/ojdbc7-12.1.0.jar
Downloading from central: https://repo.maven.apache.org/maven2/com/oracle/ojdbc7/12.1.0/ojdbc7-12.1.0.jar
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for rest-api 0.1.0-SNAPSHOT:
[INFO]
[INFO] rest-api ........................................... SUCCESS [ 0.590 s]
[INFO] app-rest-api ....................................... FAILURE [ 3.732 s]
[INFO] app-web ............................................ SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.762 s
[INFO] Finished at: 2020-01-03T15:36:54-04:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project app-rest-api: Could not resolve dependencies for project openwebinar.marvel.app:app-rest-api:war:0.1.0-SNAPSHOT: Could not find artifact com.oracle:ojdbc7:jar:12.1.0 in spring-milestones (https://repo.spring.io/milestone) -> [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/DependencyResolutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <args> -rf :app-rest-api
The app-rest-api 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>
<artifactId>app-rest-api</artifactId>
<version>0.1.0-SNAPSHOT</version>
<packaging>war</packaging>
<parent>
<groupId>openwebinar.marvel.app</groupId>
<artifactId>app</artifactId>
<version>0.1.0-SNAPSHOT</version>
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
<exclusions>
<exclusion>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jdbc</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc7</artifactId>
<version>12.1.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
My project structure, in this case I am running the mvn clean install command in the operwebinar_mavel folder:
What is in the maven route:
C: \ Users \ E10697 \ .m2 \ repository \ com \ oracle \ ojdbc7 \ 12.1.0
Add the Repository to your POM and it will work:
<repositories>
<repository>
<id>hand-china-repo</id>
<name>HandChinaRepo</name>
<url>http://nexus.saas.hand-china.com/content/repositories/rdc/</url>
</repository>
</repositories>
The repo is listed on the Maven Repository page:
https://mvnrepository.com/artifact/com.oracle/ojdbc7/12.1.0.2
Maven Central is reporting a similar dependency at version 12.1.0.2. Try changing your POM to match:
<!-- https://mvnrepository.com/artifact/com.oracle/ojdbc7 -->
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc7</artifactId>
<version>12.1.0.2</version>
</dependency>
I tested and this combination of adding the repo and the exact version works for me.
This question already has an answer here:
json files and called features not found in jenkins (with Karate Framework)
(1 answer)
Closed 1 year ago.
I am using karate default arche type as mentioned in the karate tutorial and running testing successfully with cucumber reports using Eclipse but when i use the same project in Jenkins i am getting following error.
I am using Java 1.8 and Cucumber-reporting tool, Please help me solving this issue as i suspect this is issue with the project structure
<===[JENKINS REMOTING CAPACITY]===>channel started
Executing Maven: -B -f D:\CogsdaleWorkspace\karate-archetype\pom.xml clean test
[INFO] Scanning for projects...
[INFO]
[INFO] ----------------------< com.mycompany:myproject >-----------------------
[INFO] Building myproject 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # myproject ---
[INFO] Deleting D:\CogsdaleWorkspace\karate-archetype\target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # myproject ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory D:\CogsdaleWorkspace\karate-archetype\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.6.0:compile (default-compile) # myproject ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # myproject ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 10 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.6.0:testCompile (default-testCompile) # myproject ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to D:\CogsdaleWorkspace\karate-archetype\target\test-classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /D:/CogsdaleWorkspace/karate-archetype/src/test/java/nexusportalapi/TestParallel.java:[3,24] package org.junit does not exist
[ERROR] /D:/CogsdaleWorkspace/karate-archetype/src/test/java/nexusportalapi/TestParallel.java:[3,1] static import only from classes and interfaces
[ERROR] /D:/CogsdaleWorkspace/karate-archetype/src/test/java/nexusportalapi/TestParallel.java:[11,17] package org.junit does not exist
[ERROR] /D:/CogsdaleWorkspace/karate-archetype/src/test/java/nexusportalapi/TestParallel.java:[34,10] cannot find symbol
symbol: class Test
location: class nexusportalapi.TestParallel
[INFO] 4 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.046 s
[INFO] Finished at: 2019-12-18T07:25:48-06:00
[INFO] ------------------------------------------------------------------------
Waiting for Jenkins to finish collecting data
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.0:testCompile (default-testCompile) on project myproject: Compilation failure: Compilation failure:
[ERROR] /D:/CogsdaleWorkspace/karate-archetype/src/test/java/nexusportalapi/TestParallel.java:[3,24] package org.junit does not exist
[ERROR] /D:/CogsdaleWorkspace/karate-archetype/src/test/java/nexusportalapi/TestParallel.java:[3,1] static import only from classes and interfaces
[ERROR] /D:/CogsdaleWorkspace/karate-archetype/src/test/java/nexusportalapi/TestParallel.java:[11,17] package org.junit does not exist
[ERROR] /D:/CogsdaleWorkspace/karate-archetype/src/test/java/nexusportalapi/TestParallel.java:[34,10] cannot find symbol
[ERROR] symbol: class Test
[ERROR] location: class nexusportalapi.TestParallel
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
POM FILE
`http://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
<groupId>com.mycompany</groupId>
<artifactId>myproject</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
<maven.compiler.version>3.6.0</maven.compiler.version>
<karate.version>0.9.4</karate.version>
</properties>
<dependencies>
<dependency>
<groupId>com.intuit.karate</groupId>
<artifactId>karate-apache</artifactId>
<version>${karate.version}</version>
</dependency>
<dependency>
<groupId>com.intuit.karate</groupId>
<artifactId>karate-junit5</artifactId>
<version>${karate.version}</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.4.0</version>
</dependency>
<dependency>
<groupId>net.masterthought</groupId>
<artifactId>cucumber-reporting</artifactId>
<version>5.0.0</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.1</version>
</dependency>
</dependencies>
<build>
<testResources>
<testResource>
<directory>src/test/java</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</testResource>
</testResources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven.compiler.version}</version>
<configuration>
<encoding>UTF-8</encoding>
<source>${java.version}</source>
<target>${java.version}</target>
<compilerArgument>-Werror</compilerArgument>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
</plugin>
</plugins>
</build>
This is hard to tell with just this info, can you try 2 things:
upgrade to Karate version 0.9.5.RC5
use the version we have
tested with for the cucumber-reporting lib: 3.8.0 -
https://github.com/intuit/karate/tree/master/karate-demo#example-report
You are in the best position to troubleshoot this - but you can try follow this process if all else fails: https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue
I created a maven project using Eclipse. It works fine on my computer but my colleague cannot run it while he has the same config as me (JDK version (1.8), maven version, Windows 10, Eclipse config, etc).
Here is the 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>test</groupId>
<artifactId>test</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-rt</artifactId>
<version>2.2.8</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>2.5</version>
<executions>
<execution>
<goals>
<goal>wsimport</goal>
</goals>
<configuration>
<xauthFile>authFile.txt</xauthFile>
<packageName>*some package name*</packageName>
<wsdlUrls>
<wsdlUrl>*some wsdl url*</wsdlUrl>
</wsdlUrls>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
And here are the errors :
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building test 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # test ---
[INFO] Deleting C:\Users\lgautrais\Documents\Projet\Sas-to-ips\workspace\sas-to-ips\target
[INFO]
[INFO] --- jaxws-maven-plugin:2.5:wsimport (default) # test ---
[INFO] Processing: *some wsdl url*
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.300 s
[INFO] Finished at: 2018-04-12T10:31:42+02:00
[INFO] Final Memory: 9M/243M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:jaxws-maven-plugin:2.5:wsimport (default) on project test: Execution default of goal org.codehaus.mojo:jaxws-maven-plugin:2.5:wsimport failed. NullPointerException -> [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/PluginExecutionException
and :
Execution default of goal org.codehaus.mojo:jaxws-maven-plugin:2.5:wsimport failed. (org.codehaus.mojo:jaxws-maven-plugin:2.5:wsimport:default:generate-sources)
org.apache.maven.plugin.PluginExecutionException: Execution default of goal org.codehaus.mojo:jaxws-maven-plugin:2.5:wsimport failed.
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:145)
at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:331)
at org.eclipse.m2e.core.internal.embedder.MavenImpl$11.call(MavenImpl.java:1362)
at org.eclipse.m2e.core.internal.embedder.MavenImpl$11.call(MavenImpl.java:1)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:177)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:112)
at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:1360)
at org.eclipse.m2e.core.project.configurator.MojoExecutionBuildParticipant.build(MojoExecutionBuildParticipant.java:52)
at org.eclipse.m2e.core.internal.builder.MavenBuilderImpl.build(MavenBuilderImpl.java:137)
at org.eclipse.m2e.core.internal.builder.MavenBuilder$1.method(MavenBuilder.java:172)
at org.eclipse.m2e.core.internal.builder.MavenBuilder$1.method(MavenBuilder.java:1)
at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod$1$1.call(MavenBuilder.java:115)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:177)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:112)
at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod$1.call(MavenBuilder.java:105)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:177)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:151)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:99)
at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod.execute(MavenBuilder.java:86)
at org.eclipse.m2e.core.internal.builder.MavenBuilder.build(MavenBuilder.java:200)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:735)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:206)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:246)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:301)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:304)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:360)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:383)
at org.eclipse.core.internal.resources.Workspace.buildInternal(Workspace.java:487)
at org.eclipse.core.internal.resources.Workspace.build(Workspace.java:399)
at org.eclipse.ui.actions.GlobalBuildAction$1.run(GlobalBuildAction.java:177)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56)
Caused by: java.lang.NullPointerException
at org.codehaus.mojo.jaxws.AbstractJaxwsMojo.getSelectedVersion(AbstractJaxwsMojo.java:363)
at org.codehaus.mojo.jaxws.AbstractJaxwsMojo.isArgSupported(AbstractJaxwsMojo.java:335)
at org.codehaus.mojo.jaxws.AbstractJaxwsMojo.getCommonArgs(AbstractJaxwsMojo.java:277)
at org.codehaus.mojo.jaxws.WsImportMojo.getWsImportArgs(WsImportMojo.java:379)
at org.codehaus.mojo.jaxws.WsImportMojo.processWsdlViaUrls(WsImportMojo.java:362)
at org.codehaus.mojo.jaxws.WsImportMojo.executeJaxws(WsImportMojo.java:291)
at org.codehaus.mojo.jaxws.MainWsImportMojo.executeJaxws(MainWsImportMojo.java:54)
We tried to install / uninstall some plugins, dependency versions but none of these worked. Do you have any idea about this problem ?
Thank you in advance for your returns.
I have created a very simple project in Eclipse to run a very simple JUnit test. These tests work fine when tests are executed from within Eclipse, but the code does not compile when run via maven command line.
The command I am using to run maven is simply 'maven test'. The following is the maven output:
MacBook-Pro:leonard-reference-test randy$ mvn test
[INFO] Scanning for projects...
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building leonard-reference-test 0.0.1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # leonard-reference-test ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.3:compile (default-compile) # leonard-reference-test ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /Users/randy/PSH/workspaces/playground/leonard-reference-test/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /Users/randy/PSH/workspaces/playground/leonard-reference-test/src/main/java/info/leonard/reference/test/ReferenceTestClient.java:[3,17] package org.junit does not exist
[ERROR] /Users/randy/PSH/workspaces/playground/leonard-reference-test/src/main/java/info/leonard/reference/test/ReferenceTestClient.java:[8,10] cannot find symbol
symbol: class Test
location: class info.leonard.reference.test.ReferenceTestClient
[INFO] 2 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.043 s
[INFO] Finished at: 2015-12-15T19:10:49-07:00
[INFO] Final Memory: 11M/245M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.3:compile (default-compile) on project leonard-reference-test: Compilation failure: Compilation failure:
[ERROR] /Users/randy/PSH/workspaces/playground/leonard-reference-test/src/main/java/info/leonard/reference/test/ReferenceTestClient.java:[3,17] package org.junit does not exist
[ERROR] /Users/randy/PSH/workspaces/playground/leonard-reference-test/src/main/java/info/leonard/reference/test/ReferenceTestClient.java:[8,10] cannot find symbol
[ERROR] symbol: class Test
[ERROR] location: class info.leonard.reference.test.ReferenceTestClient
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
MacBook-Pro:leonard-reference-test randy$
The pom.xml for this is as follows:
<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>info.leonard.reference</groupId>
<artifactId>leonard-reference-test</artifactId>
<version>0.0.1</version>
<prerequisites>
<maven>3.0</maven>
</prerequisites>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19</version>
</plugin>
</plugins>
</build>
</project>
And the only Java file in the project is as follows:
package info.leonard.reference.test;
import org.junit.Test;
public class ReferenceTestClient
{
#Test
public void testOne()
{
System.out.println("simple test");
}
}
That's it... no other files in the project. Maven tests run successfully from within Eclipse, but the code doesn't even compile from within Maven.
A valid pom.xml file, or other modifications to this simple project, is appreciated.
You have your file in src/main/java/ directory but the scope for the JUnit dependency is test. This means maven will not take it into account when compiling non-test code. Please put your file in src/test/java.
Test scope means that junit is only available in src/test/java
move
/Users/randy/PSH/workspaces/playground/leonard-reference-test/src/main/java/info/leonard/reference/test/ReferenceTestClient.java:
over to
/Users/randy/PSH/workspaces/playground/leonard-reference-test/src/test/java/info/leonard/reference/test/ReferenceTestClient.java: