I follow this tutorial :https://platform.netbeans.org/tutorials/nbm-maven-crud.html and I have an issue.
I tried to create the sample "maven crud sample application" and my "maven netbeans application" and I get always the same error. When I run the project, I get the following exception:
--- nbm-maven-plugin:3.3:run-platform (default-cli) # application ---
Executing: /bin/sh -c "/home/pea-rep/NetBeansProjects/JDK6/test maven//MavenCRUDSample/application/target/foo/bin/foo" --userdir '"/home/pea-rep/NetBeansProjects/JDK6/test maven//MavenCRUDSample/application/target/userdir"' -J-Dnetbeans.logger.console=true -J-ea --branding foo --jdkhome /usr/local/java/jdk1.6.0_45
Exception in thread "main" java.lang.NoClassDefFoundError: maven//MavenCRUDSample/application/target/userdir/var/log/heapdump/hprof
Caused by: java.lang.ClassNotFoundException: maven.MavenCRUDSample.application.target.userdir.var.log.heapdump.hprof
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: maven/MavenCRUDSample/application/target/userdir/var/log/heapdump.hprof. Program will exit.
In this tutorial, I don't see any modification to make at the main class
I did the same tutorial without MAVEN and it works : https://platform.netbeans.org/tutorials/nbm-crud.html
With this error, I can't run my application and have my netbeans platform window. Someone knows why I have this?
I'm on Netbeans 6.9.1 with jdk1.6.0_45 and maven-3.2.1
OS : Ubuntu 64bit
edit :
I've got 4 pom.xml :
Parent : crud-sample-application – netbeans Platform Application
crud-sample-application – Netbeans Platform based application
crud-sample-application – Platform application branding ressources
crud-sample-application – sample Netbeans Module
Sorry I wasn't able to split it.
<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.netbeans</groupId>
<artifactId>crud-sample-application</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<name>crud-sample-application - NetBeans Platform Application</name>
<repositories>
<!-- this is a remote repository hosting the netbeans api artifacts.
the versions of the artifacts are netbeans IDE release based, eg. RELEASE65
You might want to use your own repository. To create one, use the nbm:populate-repository goal.
-->
<repository>
<id>netbeans</id>
<name>repository hosting netbeans.org api artifacts</name>
<url>http://bits.netbeans.org/maven2</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-actions</artifactId>
<version>RELEASE68</version>
</dependency>
</dependencies>
<build>
<plugins>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>nbm-maven-plugin</artifactId>
<version>3.1</version>
<extensions>true</extensions>
<configuration>
<descriptor>src/main/nbm/module.xml</descriptor>
<brandingToken>${brandingToken}</brandingToken>
<cluster>foobar</cluster>
</configuration>
</plugin>
<!-- netbeans modules in 5.5+ are 1.5 compatible -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
<modules>
<module>crudsample</module>
<module>branding</module>
<module>application</module>
</modules>
<properties>
<netbeans.version>RELEASE68</netbeans.version>
<brandingToken>foo</brandingToken>
</properties>
</project>
<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">
<parent>
<groupId>org.netbeans</groupId>
<artifactId>crud-sample-application</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>application</artifactId>
<packaging>nbm-application</packaging>
<version>1.0-SNAPSHOT</version>
<name>crud-sample-application - NetBeans Platform based application</name>
<dependencies>
<dependency>
<groupId>org.netbeans.cluster</groupId>
<artifactId>platform11</artifactId>
<version>${netbeans.version}</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.netbeans</groupId>
<artifactId>crudsample</artifactId>
<version>1.0-SNAPSHOT</version>
<type>nbm</type>
</dependency>
<dependency>
<groupId>org.netbeans</groupId>
<artifactId>branding</artifactId>
<version>1.0-SNAPSHOT</version>
<type>nbm</type>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>nbm-maven-plugin</artifactId>
<version>3.3</version>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>deployment</id>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>nbm-maven-plugin</artifactId>
<executions>
<execution>
<id>updatesite</id>
<phase>package</phase>
<goals>
<goal>autoupdate</goal>
</goals>
<configuration>
<!--distBase>central::default::http://repo1.maven.org/maven2</distBase-->
</configuration>
</execution>
<execution>
<id>webstart</id>
<phase>package</phase>
<goals>
<goal>webstart-app</goal>
</goals>
<configuration>
<codebase>${project.build.directory}/webstart/${brandingToken}</codebase>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
<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">
<parent>
<groupId>org.netbeans</groupId>
<artifactId>crud-sample-application</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>branding</artifactId>
<packaging>nbm</packaging>
<version>1.0-SNAPSHOT</version>
<name>crud-sample-application - Platform application branding resources</name>
<dependencies>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-util</artifactId>
<version>${netbeans.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>nbm-maven-plugin</artifactId>
<executions>
<execution>
<id>branding</id>
<phase>process-resources</phase>
<goals>
<goal>branding</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.2</version>
<configuration>
<!-- to have the jar plugin pickup the nbm generated manifest -->
<useDefaultManifestFile>true</useDefaultManifestFile>
</configuration>
</plugin>
</plugins>
</build>
</project>
<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">
<parent>
<groupId>org.netbeans</groupId>
<artifactId>crud-sample-application</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>nbm</packaging>
<version>1.0-SNAPSHOT</version>
<name>crud-sample-application - sample NetBeans Module</name>
<dependencies>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-util</artifactId>
<version>RELEASE68</version>
</dependency>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>javax.persistence</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>eclipselink</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-windows</artifactId>
<version>RELEASE68</version>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-awt</artifactId>
<version>RELEASE68</version>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-explorer</artifactId>
<version>RELEASE68</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-nodes</artifactId>
<version>RELEASE68</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-dialogs</artifactId>
<version>RELEASE68</version>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-execution</artifactId>
<version>RELEASE68</version>
</dependency>
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derbyclient</artifactId>
<version>10.5.3.0_1</version>
<scope>runtime</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>nbm-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.2</version>
<configuration>
<!-- to have the jar plugin pickup the nbm generated manifest -->
<useDefaultManifestFile>true</useDefaultManifestFile>
</configuration>
</plugin>
</plugins>
</build>
<groupId>org.netbeans</groupId>
<artifactId>crudsample</artifactId>
<repositories>
<repository>
<url>http://ftp.ing.umu.se/mirror/eclipse/rt/eclipselink/maven.repo</url>
<id>eclipselink</id>
<layout>default</layout>
<name>Repository for library Library[eclipselink]</name>
</repository>
</repositories>
</project>
I use netbeans for run my application ==> run project :
install nbm:run-platform
run project via main() :
process-classes org.codehaus.mojo:exec-maven-plugin:1.1.1:exec
avec les arguments :
exec.classpathScope=${classPathScope}
exec.args=-classpath %classpath ${packageClassName}
exec.executable=java "
Thanks,
M.
Problem solve, When netbeans execute :
/bin/sh -c "/home/pea-rep/NetBeansProjects/JDK6/test maven//MavenCRUDSample/application/target/foo/bin/foo" --userdir '"/home/pea-rep/NetBeansProjects/JDK6/test maven//MavenCRUDSample/application/target/userdir"' -J-Dnetbeans.logger.console=true -J-ea --branding foo --jdkhome /usr/local/java/jdk1.6.0_45
It doesn't like the space between maven and test. I rename my folder and it works.
Related
I'm trying to link my two projects into one. One is a REST API meant to gather data and the other is a java swing app to create the GUI which is meant to controls the other. I've run both of them independently and they work fine. Though, when I add dependencies to each other and clean/build them. It returns the error message:
"Failed to execute goal on project MainFrame: Could not resolve
dependencies for project com.mycompany:MainFrame:jar:1.0-SNAPSHOT:
Could not find artifact com.mycompany:SoA_VII:jar:1.0 in central
(https://repo.maven.apache.org/maven2) -> [Help 1]"
As far as I can tell my POM-file is declared correctly and I'm not sure where to look for solutions anymore.
<?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.mycompany</groupId>
<artifactId>MainFrame</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>javax.jms</groupId>
<artifactId>jms</artifactId>
<version>1.1</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.48</version>
</dependency>
<dependency>
<groupId>com.mycompany</groupId>
<artifactId>SoA_VII</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
</project>
<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.mycompany</groupId>
<artifactId>SoA_VII</artifactId>
<version>1.0</version>
<packaging>war</packaging>
<name>SoA_VII-1.0</name>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<failOnMissingWebXml>false</failOnMissingWebXml>
<jakartaee>8.0</jakartaee>
</properties>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>MainFrame</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>${jakartaee}</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<compilerArguments>
<endorseddirs>${endorsed.dir}</endorseddirs>
</compilerArguments>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.3</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<outputDirectory>${endorsed.dir}</outputDirectory>
<silent>true</silent>
<artifactItems>
<artifactItem>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>${jakartaee}</version>
<type>jar</type>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>```
If you work locally then clean install both projects
Create/push to your own remote repository if you are sharing with a team
I have a spring boot application which I am trying to run from command line on my Mac but I get following error:
Error: Could not find or load main class MyProject.jar
Here is my 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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.myproject.abc</groupId>
<artifactId>MyProject</artifactId>
<packaging>jar</packaging>
<version>1.0.0</version>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.3.RELEASE</version>
</parent>
<properties>
<start-class>com.myproject.abc.MyMain</start-class>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</dependency>
<dependency>
<groupId>com.google.collections</groupId>
<artifactId>google-collections</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>target/MyProject-1.0.0.lib</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<includeSystemScope>true</includeSystemScope>
<archive>
<manifest>
<mainClass>com.myproject.abc.MyMain</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</project>
I have referred various posts online and as visible from above pom.xml, have tried adding <start-class>, spring-boot-maven-plugin, but nothing worked.
On further searching found following link Maven error: Could not find or load main class org.codehaus.plexus.classworlds.launcher.Launcher, I removed M2_HOME from .bash_profile which looked as below
export M2_HOME=/Users/myuser/Downloads/apache-maven-3.5.4
export PATH=$PATH:$M2_HOME/bin
Then I installed maven using brew -> deleted the .m2 folder -> ran mvn clean install-> run java MyProject.jar
Still facing same issue. Any ideas?
I want to know how to generate surefire-report.html using eclipse. I created a project and i am able to create reports in text file
Here is a look at my 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>com.company</groupId>
<artifactId>mymaven</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>mymaven</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-remote-control</artifactId>
<version>1.0.1</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
<version>2.5</version>
<type>maven-plugin</type>
</dependency>
</dependencies>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
<version>2.5</version>
<configuration>
<outputName>GoogleSearchTestResults</outputName>
</configuration>
</plugin>
</plugins>
</reporting>
</project>
Appreciate if you could help.
Thanks
Include this reporting plugin
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
<version>2.19.1</version>
<reportSets>
<reportSet>
<reports>
<report>report-only</report>
</reports>
</reportSet>
</reportSets>
</plugin>
</plugins>
</reporting>
Execute goal -
test -Dmaven.test.failure.ignore=true site
pom.xml 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>omoto</groupId>
<artifactId>myproject</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>omoto</name>
<packaging>war</packaging>
<properties>
<spring.version>3.0.5.RELEASE</spring.version>
</properties>
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.24</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<version>7.0</version>
<scope>provided</scope>
</dependency>
<!--dependencies -->
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.jboss.as.plugins</groupId>
<artifactId>jboss-as-maven-plugin</artifactId>
<version>7.4.Final</version>
<inherited>true</inherited>
<configuration>
<skip>true</skip>
</configuration>
<executions>
<execution>
<id>deploy-driver</id>
<phase>package</phase>
<configuration>
<groupId>mysql</groupId>
<artifactId>mysql</artifactId>
<name>mysql.jar</name>
</configuration>
<goals>
<goal>deploy-artifact</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Eventhough, I have specified my packaging as war, after build, I am getting a jar file in target folder. But, when I see the folder structure through eclipse, it's mentioned as war, but in terminal ,its is as a jar file.
I have a multi-module maven project where module A/B/C depends on module D.
Plugin maven-surefire-plugin is used for test phrase.
However,
mvn clean package
doesn't generate surefire-reports under **/target/
And
mvn clean; mvn package
could generate surefire-reports as expected.
This confused me a lot. Although the workaround for me is simply splitting to two mvn commands but I would like to know why?
Versions:
maven 3.3.3
jdk 1.7.0
maven-surefire-plugin 2.14
Root 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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.jzako.test</groupId>
<artifactId>FeedbackSystem</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<name>FeedbackSystem</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.8.21</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.10.19</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito</artifactId>
<version>1.6.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-testng</artifactId>
<version>1.6.2</version>
<scope>test</scope>
</dependency>
</dependencies>
<modules>
<module>ModuleA</module>
<module>ModuleB</module>
<module>ModuleC</module>
<module>Utility</module>
</modules>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.14</version>
<configuration>
<forkMode>never</forkMode>
</configuration>
</plugin>
</plugins>
</build>
</project>
Module A Pom:
<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.jzako.test</groupId>
<artifactId>FeedbackSystem</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<groupId>org.jzako.test</groupId>
<artifactId>ModuleA</artifactId>
<version>1.0-SNAPSHOT</version>
<name>ModuleA</name>
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>org.jzako.test.main.LightweightFeedbackStatisticsMain</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>assembly</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
<directory>${basedir}/../conf/dev</directory>
</resource>
</resources>
<testResources>
<testResource>
<directory>${basedir}/../conf/dev</directory>
</testResource>
</testResources>
</build>
<dependencies>
<dependency>
<groupId>org.jzako.test</groupId>
<artifactId>Utility</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
Multi-module Relationship
Module A/B/C depends on Utility Module and no dependencies among Module A/B/C.
Update:
It seems everything's fine for a single maven module projects. Something related to the multi-modules?