multi-modules project with maven is not working as expected? - eclipse

Hi
I am trying to create a multi-modules project in eclipse with m2eclipse. I followed some tutorials but the way it work is not what i expect:
Here is the structure of my project
-Root
- webapps
- module1
- module2
I have pom.xml for Root and modules. (module 1 and 2 are independent to each other)
In the pom.xml (Root), i have
<modules>
<module>./webapps/module1</module>
<module>./webapps/module2</module>
</modules>
In module1's pom.xml:
<parent>
<groupId>{RootGroupId}</groupId>
<artifactId>{RootArtifactId}</artifactId>
<version>{RootVersionId}</version>
<relativePath>../../pom.xml</relativePath>
</parent>
In module2, it is similar to module 1.
When I go to Root and run the pom file, it will trigger the Root's phases first and the module's phases later (build the root project and also build the module projects). To me it is fine.
But the problem happens when i go to module1 and run the pom.xml. Then it also so do the same: trigger the Root pom.xml and module1's pom.xml. i dont like this. What i want to be happened is ONLY the module1's pom file is triggered (ONLY module1 is built), root's pom will not be triggered (Root project is not be built).
Any help, please.

Update: If you don't want a plugin configuration to be applied in POMs which inherit from the POM where it is declared, set inherited to false.
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0-alpha-1</version>
<inherited>false</inherited> <!-- THIS SHOULD DO IT -->
<executions>
<execution>
<id>read-project-properties</id>
<phase>initialize</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
<configuration>
<files>
<file>build.properties</file>
</files>
</configuration>
</execution>
</executions>
</plugin>
Reference
Maven POM Reference
Plugins
I tried to reproduce the problem... but didn't succeed. I created a similar project structure:
$ tree .
.
├── pom.xml
└── webapps
├── module1
│   ├── pom.xml
│   └── src
│   └── main
│   └── webapp
│   ├── index.jsp
│   └── WEB-INF
│   └── web.xml
└── module2
├── pom.xml
└── src
└── main
├── resources
└── webapp
├── index.jsp
└── WEB-INF
└── web.xml
Where the parent pom.xml declares:
<modules>
<module>webapps/module1</module>
<module>webapps/module2</module>
</modules>
And each child:
<parent>
<artifactId>Q3790987</artifactId>
<groupId>com.stackoverflow</groupId>
<version>1.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Building from the root triggers a reactor build:
$ mvn install
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] Q3790987
[INFO] module1 Maven Webapp
[INFO] module2 Maven Webapp
[INFO]
[INFO] ------------------------------------------------------------------------
...
But building a child doesn't trigger anything on the parent:
$ cd webapps/module1/
$ mvn install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building module1 Maven Webapp 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
...
Everything works as expected for me.
(initial answer removed as it appeared I misinterpreted the question)

Related

Cannot resolve dependency-jars error with AWS device farm with Java TestNG project

I am trying to load my zip-with-dependencies to AWS device farm for Java TestNG project with Selenium.
Whenever I upload my .zip to AWS device farm, I get the message, "There was a problem processing your file. We could not find the dependency-jars directory in the root of your test package. Please unzip your test package, verify that the dependency-jars directory is in the root of your package, and try again."
I checked the tree in target folder with "Tree ." and I got:
.
├── TestngCucumberBoilerPlate-0.0.1-SNAPSHOT-tests.jar
├── TestngCucumberBoilerPlate-0.0.1-SNAPSHOT.jar
├── archive-tmp
├── classes
├── dependency-jars
│   ├── aether-api-1.7.jar
│   ├── aether-impl-1.7.jar
│   ├── aether-spi-1.7.jar
│   ├── aether-util-1.7.jar
│   ├── animal-sniffer-annotations-1.14.jar
│   ├── ant-1.10.3.jar
│   ├── ant-launcher-1.10.3.jar
│   ├── asm-6.2.1.jar
│   ├── aspectjweaver-1.9.1.jar
│   ├── bridj-0.6.2.jar
│   ├── bsh-2.0b6.jar
│   ├── byte-buddy-1.8.15.jar
│   ├── cglib-3.2.8.jar
│   ├── checker-compat-qual-2.0.0.jar
│   ├── commons-beanutils-1.9.2.jar
│   ├── commons-cli-1.2.jar
│   ├── commons-codec-1.10.jar
│   ├── commons-collections-3.2.2.jar
│   ├── commons-compress-1.18.jar
│   ├── commons-digester-1.8.1.jar
│   ├── commons-exec-1.3.jar
│   ├── commons-io-2.6.jar
│   ├── commons-lang3-3.8.jar
│   ├── commons-logging-1.2.jar
│   ├── commons-validator-1.6.jar
│   ├── cucumber-core-1.2.5.jar
│   ├── cucumber-html-0.2.3.jar
│   ├── cucumber-java-1.2.5.jar
│   ├── cucumber-jvm-deps-1.0.5.jar
│   ├── cucumber-testng-1.2.5.jar
│   ├── error_prone_annotations-2.1.3.jar
│   ├── gherkin-2.12.2.jar
│   ├── gson-2.8.5.jar
│   ├── guava-25.0-jre.jar
│   ├── httpclient-4.5.6.jar
│   ├── httpcore-4.4.10.jar
│   ├── j2objc-annotations-1.1.jar
│   ├── java-client-7.0.0.jar
│   ├── jcommander-1.72.jar
│   ├── jintellitype-1.3.7.jar
│   ├── jsr305-1.3.9.jar
│   ├── jxgrabkey-1.0.jar
│   ├── maven-aether-provider-3.0.jar
│   ├── maven-archiver-3.3.0.jar
│   ├── maven-artifact-3.0.jar
│   ├── maven-core-3.0.jar
│   ├── maven-jar-plugin-3.1.1.jar
│   ├── maven-model-3.0.jar
│   ├── maven-model-builder-3.0.jar
│   ├── maven-plugin-api-3.0.jar
│   ├── maven-repository-metadata-3.0.jar
│   ├── maven-settings-3.0.jar
│   ├── maven-settings-builder-3.0.jar
│   ├── maven-shared-utils-3.2.1.jar
│   ├── okhttp-3.11.0.jar
│   ├── okio-1.14.0.jar
│   ├── plexus-archiver-3.7.0.jar
│   ├── plexus-cipher-1.4.jar
│   ├── plexus-classworlds-2.2.3.jar
│   ├── plexus-component-annotations-1.5.5.jar
│   ├── plexus-interpolation-1.14.jar
│   ├── plexus-io-3.1.0.jar
│   ├── plexus-sec-dispatcher-1.3.jar
│   ├── plexus-utils-3.1.0.jar
│   ├── selenium-api-3.141.59.jar
│   ├── selenium-chrome-driver-3.141.59.jar
│   ├── selenium-edge-driver-3.141.59.jar
│   ├── selenium-firefox-driver-3.141.59.jar
│   ├── selenium-ie-driver-3.141.59.jar
│   ├── selenium-java-3.141.59.jar
│   ├── selenium-opera-driver-3.141.59.jar
│   ├── selenium-remote-driver-3.141.59.jar
│   ├── selenium-safari-driver-3.141.59.jar
│   ├── selenium-support-3.141.59.jar
│   ├── sikulixapi-1.1.0.jar
│   ├── sikulixlibsmac-1.1.0.jar
│   ├── sisu-guice-2.1.7-noaop.jar
│   ├── sisu-inject-bean-1.4.2.jar
│   ├── sisu-inject-plexus-1.4.2.jar
│   ├── slf4j-api-1.7.25.jar
│   ├── snappy-0.4.jar
│   ├── spring-aop-5.1.0.RELEASE.jar
│   ├── spring-beans-5.1.0.RELEASE.jar
│   ├── spring-context-5.1.0.RELEASE.jar
│   ├── spring-core-5.1.0.RELEASE.jar
│   ├── spring-expression-5.1.0.RELEASE.jar
│   ├── spring-jcl-5.1.0.RELEASE.jar
│   ├── swing-layout-1.0.3.jar
│   ├── testng-6.14.3.jar
│   └── xz-1.8.jar
├── generated-test-sources
│   └── test-annotations
├── maven-archiver
│   └── pom.properties
├── maven-status
│   └── maven-compiler-plugin
│   ├── compile
│   │   └── default-compile
│   │   └── inputFiles.lst
│   └── testCompile
│   └── default-testCompile
│   ├── createdFiles.lst
│   └── inputFiles.lst
├── test-classes
│   ├── Locators
│   │   ├── AdvisorAEPOhio.class
│   │   ├── AdvisorBlueprint.class
│   │   ├── AdvisorDTE.class
│   │   ├── DemandResponseCardBlueprint.class
│   │   ├── DemandResponseNotificationBlueprint.class
│   │   ├── DevicesBlueprint.class
│   │   ├── HamburgerAEPOhio.class
│   │   ├── HamburgerBlueprint.class
│   │   ├── HamburgerDTE.class
│   │   ├── HomeAEPOhio.class
│   │   ├── HomeBlueprint.class
│   │   ├── HomeCardsAEPOhio.class
│   │   ├── HomeCardsBlueprint.class
│   │   ├── HomeCardsDTE.class
│   │   ├── HomeDTE.class
│   │   ├── LightBlueprint.class
│   │   ├── LoginAEPOhio.class
│   │   ├── LoginBlueprint.class
│   │   ├── LoginDTE.class
│   │   ├── MyPlanBlueprint.class
│   │   ├── MyPlanDTE.class
│   │   ├── ParentDeviceBlueprint.class
│   │   ├── PlugBlueprint.class
│   │   ├── PortalBlueprint.class
│   │   ├── PortalDemandResponseBlueprint.class
│   │   ├── PushApp.class
│   │   └── TstatBlueprint.class
│   ├── config
│   │   └── config.properties
│   ├── drivers
│   │   └── chromedriver
│   ├── features
│   │   ├── DemandResponse.feature
│   │   ├── EnergyTabNavigation.feature
│   │   ├── EnergyUseComparison.feature
│   │   ├── Hamburger.feature
│   │   ├── HomeAdvisor.feature
│   │   ├── Light.feature
│   │   ├── PayModel.feature
│   │   ├── Switch.feature
│   │   ├── Tstat.feature
│   │   └── loginSingle.feature
│   ├── main
│   │   └── CucumberRunner.class
│   ├── samplefeatures
│   │   └── loginMulti.feature
│   ├── stepdefinition
│   │   ├── AdvisorPage.class
│   │   ├── DemandResponseCard$1.class
│   │   ├── DemandResponseCard.class
│   │   ├── DevicesPage.class
│   │   ├── HamburgerPage.class
│   │   ├── HomeCardsPage.class
│   │   ├── HomePage.class
│   │   ├── LightPage.class
│   │   ├── LoginPage.class
│   │   ├── MyPlanPage.class
│   │   ├── ParentDevicePage.class
│   │   ├── PlugPage.class
│   │   ├── PortalDemandResponsePage.class
│   │   ├── PortalWebPage.class
│   │   ├── PushAppPage.class
│   │   └── TstatPage.class
│   └── utilities
│   ├── AppiumServer.class
│   ├── ByWrapper.class
│   ├── ByWrapperPortal.class
│   ├── DemandResponse.class
│   ├── MyUtils.class
│   └── TstatDemandResponse.class
└── zip-with-dependencies.zip
Whenever I moved my zip-with-dependencies into another directory and tried the same command, I got:
.
├── TestngCucumberBoilerPlate-0.0.1-SNAPSHOT-tests.jar
├── TestngCucumberBoilerPlate-0.0.1-SNAPSHOT.jar
└── zip-with-dependencies.zip
This is what I got when I originally ran mvn clean package -DskipTests=true to build the .zip
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building TestngCucumberBoilerPlate 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # TestngCucumberBoilerPlate ---
[INFO] Deleting /Users/cbellard/Documents/PowerleyAppiumCucumber/target
[INFO]
[INFO] --- maven-resources-plugin:2.7:resources (default-resources) # TestngCucumberBoilerPlate ---
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /Users/cbellard/Documents/PowerleyAppiumCucumber/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.2:compile (default-compile) # TestngCucumberBoilerPlate ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.7:testResources (default-testResources) # TestngCucumberBoilerPlate ---
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 13 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.2:testCompile (default-testCompile) # TestngCucumberBoilerPlate ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 49 source files to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/test-classes
[INFO] /Users/cbellard/Documents/PowerleyAppiumCucumber/src/test/java/main/CucumberRunner.java: Some input files use unchecked or unsafe operations.
[INFO] /Users/cbellard/Documents/PowerleyAppiumCucumber/src/test/java/main/CucumberRunner.java: Recompile with -Xlint:unchecked for details.
[INFO]
[INFO] --- maven-surefire-plugin:2.18.1:test (default-test) # TestngCucumberBoilerPlate ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-jar-plugin:2.6:jar (default-jar) # TestngCucumberBoilerPlate ---
[WARNING] JAR will be empty - no content was marked for inclusion!
[INFO] Building jar: /Users/cbellard/Documents/PowerleyAppiumCucumber/target/TestngCucumberBoilerPlate-0.0.1-SNAPSHOT.jar
[INFO]
[INFO] --- maven-jar-plugin:2.6:test-jar (default) # TestngCucumberBoilerPlate ---
[INFO] Building jar: /Users/cbellard/Documents/PowerleyAppiumCucumber/target/TestngCucumberBoilerPlate-0.0.1-SNAPSHOT-tests.jar
[INFO]
[INFO] --- maven-assembly-plugin:2.5.4:single (default) # TestngCucumberBoilerPlate ---
[INFO] Reading assembly descriptor: src/main/assembly/zip.xml
[INFO] Building zip: /Users/cbellard/Documents/PowerleyAppiumCucumber/target/zip-with-dependencies.zip
[INFO]
[INFO] --- maven-dependency-plugin:2.10:copy-dependencies (copy-dependencies) # TestngCucumberBoilerPlate ---
[INFO] Copying java-client-7.0.0.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/java-client-7.0.0.jar
[INFO] Copying byte-buddy-1.8.15.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/byte-buddy-1.8.15.jar
[INFO] Copying maven-settings-builder-3.0.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/maven-settings-builder-3.0.jar
[INFO] Copying httpcore-4.4.10.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/httpcore-4.4.10.jar
[INFO] Copying aether-util-1.7.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/aether-util-1.7.jar
[INFO] Copying cglib-3.2.8.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/cglib-3.2.8.jar
[INFO] Copying maven-core-3.0.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/maven-core-3.0.jar
[INFO] Copying maven-model-3.0.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/maven-model-3.0.jar
[INFO] Copying commons-validator-1.6.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/commons-validator-1.6.jar
[INFO] Copying animal-sniffer-annotations-1.14.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/animal-sniffer-annotations-1.14.jar
[INFO] Copying maven-artifact-3.0.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/maven-artifact-3.0.jar
[INFO] Copying jcommander-1.72.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/jcommander-1.72.jar
[INFO] Copying selenium-chrome-driver-3.141.59.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/selenium-chrome-driver-3.141.59.jar
[INFO] Copying selenium-opera-driver-3.141.59.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/selenium-opera-driver-3.141.59.jar
[INFO] Copying commons-io-2.6.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/commons-io-2.6.jar
[INFO] Copying maven-model-builder-3.0.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/maven-model-builder-3.0.jar
[INFO] Copying plexus-component-annotations-1.5.5.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/plexus-component-annotations-1.5.5.jar
[INFO] Copying maven-jar-plugin-3.1.1.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/maven-jar-plugin-3.1.1.jar
[INFO] Copying maven-repository-metadata-3.0.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/maven-repository-metadata-3.0.jar
[INFO] Copying ant-launcher-1.10.3.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/ant-launcher-1.10.3.jar
[INFO] Copying okio-1.14.0.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/okio-1.14.0.jar
[INFO] Copying spring-beans-5.1.0.RELEASE.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/spring-beans-5.1.0.RELEASE.jar
[INFO] Copying ant-1.10.3.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/ant-1.10.3.jar
[INFO] Copying commons-beanutils-1.9.2.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/commons-beanutils-1.9.2.jar
[INFO] Copying gson-2.8.5.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/gson-2.8.5.jar
[INFO] Copying selenium-support-3.141.59.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/selenium-support-3.141.59.jar
[INFO] Copying aether-api-1.7.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/aether-api-1.7.jar
[INFO] Copying plexus-archiver-3.7.0.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/plexus-archiver-3.7.0.jar
[INFO] Copying bridj-0.6.2.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/bridj-0.6.2.jar
[INFO] Copying commons-logging-1.2.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/commons-logging-1.2.jar
[INFO] Copying jxgrabkey-1.0.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/jxgrabkey-1.0.jar
[INFO] Copying sisu-guice-2.1.7-noaop.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/sisu-guice-2.1.7-noaop.jar
[INFO] Copying plexus-utils-3.1.0.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/plexus-utils-3.1.0.jar
[INFO] Copying cucumber-html-0.2.3.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/cucumber-html-0.2.3.jar
[INFO] Copying plexus-io-3.1.0.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/plexus-io-3.1.0.jar
[INFO] Copying asm-6.2.1.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/asm-6.2.1.jar
[INFO] Copying bsh-2.0b6.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/bsh-2.0b6.jar
[INFO] Copying plexus-cipher-1.4.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/plexus-cipher-1.4.jar
[INFO] Copying maven-shared-utils-3.2.1.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/maven-shared-utils-3.2.1.jar
[INFO] Copying okhttp-3.11.0.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/okhttp-3.11.0.jar
[INFO] Copying commons-lang3-3.8.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/commons-lang3-3.8.jar
[INFO] Copying maven-archiver-3.3.0.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/maven-archiver-3.3.0.jar
[INFO] Copying gherkin-2.12.2.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/gherkin-2.12.2.jar
[INFO] Copying snappy-0.4.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/snappy-0.4.jar
[INFO] Copying selenium-remote-driver-3.141.59.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/selenium-remote-driver-3.141.59.jar
[INFO] Copying maven-aether-provider-3.0.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/maven-aether-provider-3.0.jar
[INFO] Copying spring-jcl-5.1.0.RELEASE.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/spring-jcl-5.1.0.RELEASE.jar
[INFO] Copying jsr305-1.3.9.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/jsr305-1.3.9.jar
[INFO] Copying maven-settings-3.0.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/maven-settings-3.0.jar
[INFO] Copying checker-compat-qual-2.0.0.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/checker-compat-qual-2.0.0.jar
[INFO] Copying maven-plugin-api-3.0.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/maven-plugin-api-3.0.jar
[INFO] Copying sisu-inject-bean-1.4.2.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/sisu-inject-bean-1.4.2.jar
[INFO] Copying selenium-ie-driver-3.141.59.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/selenium-ie-driver-3.141.59.jar
[INFO] Copying testng-6.14.3.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/testng-6.14.3.jar
[INFO] Copying sisu-inject-plexus-1.4.2.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/sisu-inject-plexus-1.4.2.jar
[INFO] Copying plexus-interpolation-1.14.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/plexus-interpolation-1.14.jar
[INFO] Copying j2objc-annotations-1.1.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/j2objc-annotations-1.1.jar
[INFO] Copying commons-compress-1.18.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/commons-compress-1.18.jar
[INFO] Copying sikulixlibsmac-1.1.0.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/sikulixlibsmac-1.1.0.jar
[INFO] Copying cucumber-jvm-deps-1.0.5.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/cucumber-jvm-deps-1.0.5.jar
[INFO] Copying selenium-api-3.141.59.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/selenium-api-3.141.59.jar
[INFO] Copying spring-core-5.1.0.RELEASE.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/spring-core-5.1.0.RELEASE.jar
[INFO] Copying selenium-java-3.141.59.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/selenium-java-3.141.59.jar
[INFO] Copying selenium-edge-driver-3.141.59.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/selenium-edge-driver-3.141.59.jar
[INFO] Copying commons-exec-1.3.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/commons-exec-1.3.jar
[INFO] Copying plexus-classworlds-2.2.3.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/plexus-classworlds-2.2.3.jar
[INFO] Copying commons-cli-1.2.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/commons-cli-1.2.jar
[INFO] Copying commons-codec-1.10.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/commons-codec-1.10.jar
[INFO] Copying spring-aop-5.1.0.RELEASE.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/spring-aop-5.1.0.RELEASE.jar
[INFO] Copying error_prone_annotations-2.1.3.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/error_prone_annotations-2.1.3.jar
[INFO] Copying guava-25.0-jre.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/guava-25.0-jre.jar
[INFO] Copying cucumber-java-1.2.5.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/cucumber-java-1.2.5.jar
[INFO] Copying aether-spi-1.7.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/aether-spi-1.7.jar
[INFO] Copying plexus-sec-dispatcher-1.3.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/plexus-sec-dispatcher-1.3.jar
[INFO] Copying jintellitype-1.3.7.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/jintellitype-1.3.7.jar
[INFO] Copying cucumber-testng-1.2.5.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/cucumber-testng-1.2.5.jar
[INFO] Copying spring-expression-5.1.0.RELEASE.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/spring-expression-5.1.0.RELEASE.jar
[INFO] Copying commons-digester-1.8.1.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/commons-digester-1.8.1.jar
[INFO] Copying commons-collections-3.2.2.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/commons-collections-3.2.2.jar
[INFO] Copying cucumber-core-1.2.5.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/cucumber-core-1.2.5.jar
[INFO] Copying xz-1.8.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/xz-1.8.jar
[INFO] Copying selenium-firefox-driver-3.141.59.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/selenium-firefox-driver-3.141.59.jar
[INFO] Copying slf4j-api-1.7.25.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/slf4j-api-1.7.25.jar
[INFO] Copying swing-layout-1.0.3.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/swing-layout-1.0.3.jar
[INFO] Copying httpclient-4.5.6.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/httpclient-4.5.6.jar
[INFO] Copying sikulixapi-1.1.0.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/sikulixapi-1.1.0.jar
[INFO] Copying selenium-safari-driver-3.141.59.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/selenium-safari-driver-3.141.59.jar
[INFO] Copying spring-context-5.1.0.RELEASE.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/spring-context-5.1.0.RELEASE.jar
[INFO] Copying aether-impl-1.7.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/aether-impl-1.7.jar
[INFO] Copying aspectjweaver-1.9.1.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/aspectjweaver-1.9.1.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.540 s
[INFO] Finished at: 2019-02-08T14:51:24-05:00
[INFO] Final Memory: 22M/90M
[INFO] ------------------------------------------------------------------------
This 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/xsd/maven-4.0.0.xsd">
<repositories>
<repository>
<id>TestNG-Cucumber</id>
<name>testng-cucumber</name>
<url>https://github.com/igniteram</url>
</repository>
</repositories>
<packaging>jar</packaging>
<modelVersion>4.0.0</modelVersion>
<groupId>TestngCucumber</groupId>
<artifactId>TestngCucumberBoilerPlate</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.141.59</version>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-java</artifactId>
<version>1.2.5</version>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-testng</artifactId>
<version>1.2.5</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.14.3</version>
</dependency>
<dependency>
<groupId>io.appium</groupId>
<artifactId>java-client</artifactId>
<version>7.0.0</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.1</version>
<type>maven-plugin</type>
</dependency>
<!-- Added for comparing screenshots -->
<!-- https://mvnrepository.com/artifact/com.sikulix/sikulixapi -->
<dependency>
<groupId>com.sikulix</groupId>
<artifactId>sikulixapi</artifactId>
<version>1.1.0</version>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<testResources>
<testResource>
<directory>src/test/resources</directory>
<filtering>true</filtering>
</testResource>
</testResources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.5.4</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<finalName>zip-with-dependencies</finalName>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>src/main/assembly/zip.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.10</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/dependency-jars/</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.7</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-filtering</artifactId>
<version>1.3</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.18.1</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>testng.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
I haven't fully tested this but I think the build steps are out of order. Can you try having the maven-dependency-plugin first before the maven-assemble-plugin and let me know if that helps? Order matters in maven.
code snippet
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.10</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/dependency-jars/</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.5.4</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<finalName>zip-with-dependencies</finalName>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>src/main/assembly/zip.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>

maven test on scala code return successful build but There are no tests to run

I have the problem using mvn test to run the test code in my maven scala code. Here are the settings:
.
├── pom.xml
├── run
└── src
├── main
│   └── scala
│   └── com
│   └── myCompany
│   └── scala
│   └── MaxPrice.scala
├── resources
│   └── JCudaMultiplyBy2.ptx
└── test
├── resources
│   └── JCudaMultiplyBy2.ptx
└── scala
└── MyTest.scala
JCudaMultiplyBy2.ptx is the file will be used in MyTest.scala.
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.myCompany.scala</groupId>
<artifactId>sparkExample</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
<scala.version>2.10.5</scala.version> <!-- Well we can use 2.11 scala, but scala-maven-plugin may have issue with that, so if to use mvn -q scala:run, then keep 2.10 scala, otherwise, have to spark-submit -->
</properties>
<dependencies>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>${scala.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.scala-tools</groupId>
<artifactId>maven-scala-plugin</artifactId>
<version>2.11</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-core_2.10</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>
<groupId>org.jcuda</groupId>
<artifactId>jcuda</artifactId>
<version>0.8.0</version>
</dependency>
<dependency>
<groupId>org.jcuda</groupId>
<artifactId>jcublas</artifactId>
<version>0.8.0</version>
</dependency>
</dependencies>
<build>
<sourceDirectory>src/main/scala</sourceDirectory>
<testSourceDirectory>src/test/scala</testSourceDirectory>
<plugins>
<plugin>
<groupId>org.scala-tools</groupId>
<artifactId>maven-scala-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
<configuration>
<scalaVersion>${scala.version}</scalaVersion>
<args>
<!--arg>-target:jvm-1.5</arg-->
</args>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.8.1</version>
<configuration>
<includes>
<include>**/*Spec.class</include>
<include>**/*Test.class</include>
</includes>
</configuration>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<groupId>org.scala-tools</groupId>
<artifactId>maven-scala-plugin</artifactId>
<configuration>
<scalaVersion>${scala.version}</scalaVersion>
</configuration>
</plugin>
</plugins>
</reporting>
</project>
The MyTest.scala code is the same as the MaxPrice.scala code, and if I run mvn compile and then run mvn -q scala:run -DmainClass=com.myCompany.scala.MaxPrice -DaddArgs="local[*]", it works perfectly. Now I change the Object name of MaxPrice.scala into MyTest and also its file name into MyTest.scala. Putting MyTest.scala under src/test/scala and run mvn test, it doesn't work and give this results:
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.myCompany.scala:sparkExample:jar:1.0-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.scala-tools:maven-scala-plugin is missing. # line 48, column 15
[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] ------------------------------------------------------------------------
[INFO] Building sparkExample 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # sparkExample ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/yuxin/OwensGroup/MavenPract/maven-sparkJcublas/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.2:compile (default-compile) # sparkExample ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-scala-plugin:2.15.2:compile (default) # sparkExample ---
[INFO] Checking for multiple versions of scala
[WARNING] Expected all dependencies to require Scala version: 2.10.5
[WARNING] com.myCompany.scala:sparkExample:1.0-SNAPSHOT requires scala version: 2.10.5
[WARNING] com.twitter:chill_2.10:0.5.0 requires scala version: 2.10.4
[WARNING] Multiple versions of scala libraries detected!
[INFO] includes = [**/*.java,**/*.scala,]
[INFO] excludes = []
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # sparkExample ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.2:testCompile (default-testCompile) # sparkExample ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-scala-plugin:2.15.2:testCompile (default) # sparkExample ---
[INFO] Checking for multiple versions of scala
[WARNING] Expected all dependencies to require Scala version: 2.10.5
[WARNING] com.myCompany.scala:sparkExample:1.0-SNAPSHOT requires scala version: 2.10.5
[WARNING] com.twitter:chill_2.10:0.5.0 requires scala version: 2.10.4
[WARNING] Multiple versions of scala libraries detected!
[INFO] includes = [**/*.java,**/*.scala,]
[INFO] excludes = []
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.8.1:test (default-test) # sparkExample ---
[INFO] Surefire report directory: /home/yuxin/OwensGroup/MavenPract/maven-sparkJcublas/target/surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
There are no tests to run.
Results :
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.202 s
[INFO] Finished at: 2017-03-30T14:52:29-07:00
[INFO] Final Memory: 25M/592M
[INFO] ------------------------------------------------------------------------
Also if I run mvn test -Dtest=MyTest, it still gives the same result: no tests to run.
Anyone has an idea? I have search a lot but couldn't find the answer, help!
Apparently from the author you should use scala-maven-plugin instead of maven-scala-plugin (see here).
More importantly, to run scala tests, according to the (almighty) documentation, you should disable the surefire plugin:
To use the ScalaTest Maven plugin, you need to disable SureFire and
enable ScalaTest.
Add in the configuration section of the surefire plugin:
<skipTests>true</skipTests>

Apache IVY Unable to resolve dependencies for MAVEN Projects

I have a setup of Apache Ivy(Version 2.4.0) and Netbeans IDE(8.0.2). I have not been able to resolve dependencies for full blown maven projects(For example:org.glassfish.jersey). Apache Ivy successfully resolves dependencies for more specific modules like (org.glassfish.jersey.core).
Non working Example:
<dependency org="org.glassfish.jersey" name="project" rev="2.13" conf="solrj->*"/>
Working Examples:
<dependency org="org.apache.solr" name="solr-solrj" rev="5.0.0" conf="solrj->default"/>
<dependency org="org.glassfish.jersey.core" name="jersey-server" rev="2.13" conf="JerseyCore-2.13->default,optional"/>
<dependency org="org.glassfish.jersey.core" name="jersey-client" rev="2.13" conf="JerseyCore-2.13->default,optional"/>
<dependency org="org.glassfish.jersey.core" name="jersey-common" rev="2.13" conf="JerseyCore-2.13->default,optional"/>
ivy.xml
<ivy-module version="2.0">
<info organisation="org.sonatype.nexus.examples" module="simple-project" revision="1.0.0-SNAPSHOT"/>
<configurations>
<conf name="solrj" description="Jars from the SOLRJ Library Collection"/>
</configurations>
<dependencies>
<dependency org="org.glassfish.jersey" name="project" rev="2.13" conf="solrj->*"/>
<dependency org="org.apache.solr" name="solr-solrj" rev="5.0.0" conf="solrj->default"/>
</dependencies>
ivysettings.xml
<ivysettings>
<settings defaultResolver="ibiblio"/>
<resolvers>
<ibiblio name="ibiblio" m2compatible="true"/>
</resolvers>
build.xml(Just the IVY Part).
<!-- Resolve all the dependencies that we declared in the build.xml file.
Resolving means that ivy will download the jar file from the MAVEN 2 Repository
and put them under the directory that you specify in the build.xml file.
In my case this is where all the jar files will be downloaded "C:\Users\ajalgaon\Accurev\solrj\lib" -->
<target name="init">
<ivy:settings file="ivysettings.xml" />
<ivy:resolve/>
<ivy:report todir="prebuilt/ivy-report" graph="false"/>
<ivy:retrieve conf="solrj" pattern="prebuilt/jars/solrj-lib/[artifact].[ext]"/>
</target>
Apache IVY Successfully resolves dependencies for the solr-solrj module. But it does not resolve dependency for "org.glassfish.jersey". Apache IVY Does not resolve dependencies for anything that has the attribute name="project" in the ivy.xml file. Kindly let me know if I need to post more information here. Thanks a lot in advance.
Cannot reproduce your issue.
Example
├── build.xml
├── ivy.xml
└── target
├── ivy-reports
│   ├── ivy-report.css
│   └── org.sonatype.nexus.examples-simple-project-solrj.html
└── jars
├── commons-io.jar
├── httpclient.jar
├── httpcore.jar
├── httpmime.jar
├── noggit.jar
├── slf4j-api.jar
├── solr-solrj.jar
├── stax2-api.jar
├── woodstox-core-asl.jar
└── zookeeper.jar
ivy.xml
<ivy-module version="2.0">
<info organisation="org.sonatype.nexus.examples" module="simple-project" revision="1.0.0-SNAPSHOT"/>
<configurations>
<conf name="solrj" description="Jars from the SOLRJ Library Collection"/>
</configurations>
<dependencies>
<dependency org="org.glassfish.jersey" name="project" rev="2.13" conf="solrj->*"/>
<dependency org="org.apache.solr" name="solr-solrj" rev="5.0.0" conf="solrj->default"/>
</dependencies>
</ivy-module>
build.xml
<project name="demo" default="resolve" xmlns:ivy="antlib:org.apache.ivy.ant">
<property name="build.dir" location="target"/>
<available classname="org.apache.ivy.Main" property="ivy.installed"/>
<target name="resolve" depends="install-ivy" description="Use ivy to resolve classpaths">
<ivy:resolve/>
<ivy:report todir='${build.dir}/ivy-reports' graph='false' xml='false'/>
<ivy:retrieve conf="solrj" pattern="${build.dir}/jars/[artifact].[ext]"/>
</target>
<target name="install-ivy" description="Install ivy" unless="ivy.installed">
<mkdir dir="${user.home}/.ant/lib"/>
<get dest="${user.home}/.ant/lib/ivy.jar" src="http://search.maven.org/remotecontent?filepath=org/apache/ivy/ivy/2.4.0/ivy-2.4.0.jar"/>
<fail message="Ivy has been installed. Run the build again"/>
</target>
<target name="clean" description="Cleanup build files">
<delete dir="${build.dir}"/>
</target>
<target name="clean-all" depends="clean" description="Additionally purge ivy cache">
<ivy:cleancache/>
</target>
</project>

IDE where compile-on-save works in a multi modules maven project

When working with NetBeans and Maven all is fine except a minor hassle with multi maven projects. Imagine I have the 'tools' module dependent on the 'core' module. In order to use the recently changed 'core' from 'tools' I have to re-install the 'core'.
Or should I switch to a different IDE? But IntelliJ and Eclipse seem to have problems as well (is this true?). How do you do it?
Of course, this should work for running, debugging and testing a project.
[Update] NetBeans 7.4 has improved on this but as stated still some issues.
This is how it works in IntelliJ with a maven multi module project.
Structure:
.
├── pom.xml
├── module-1
| ├── pom.xml
| └── src
| └── main
| └── java
| └── com
| └── stackoverflow
| └── foo
| └── Foo.java
└── module-2
├── pom.xml
└── src
└── main
└── java
└── com
└── stackoverflow
└── bar
└── Bar.java
Bar extends Foo so module-2 has a dependency on module-1.
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.stackoverflow</groupId>
<artifactId>multi-module-idea</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>${project.artifactId}-${project.version}</name>
<properties>
<mainClass/>
<argument/>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<modules>
<module>module-1</module>
<module>module-2</module>
</modules>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.stackoverflow</groupId>
<artifactId>module-1-idea</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.14</version>
</dependency>
</dependencies>
</project>
module-1\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>
<parent>
<groupId>com.stackoverflow</groupId>
<artifactId>multi-module-idea</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>module-1-idea</artifactId>
<name>${project.artifactId}-${project.version}</name>
</project>
module-2\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>
<parent>
<groupId>com.stackoverflow</groupId>
<artifactId>multi-module-idea</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>module-2-idea</artifactId>
<name>${project.artifactId}-${project.version}</name>
<properties>
<mainClass>maba.java.module2.App</mainClass>
</properties>
<dependencies>
<dependency>
<groupId>com.stackoverflow</groupId>
<artifactId>module-1-idea</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
When this project is loaded into IntelliJ (by File | Open... and pointing to the pom.xml at the root) it will set up all module dependencies automatically. NB It is forbidden to use the maven-idea-plugin and mvn idea:idea. That module has not been updated since 2008.
Make sure that Make project automatically is checked (same as compile-on-save).
Now here is the code sample and everything looks nice (no compilation errors).
And now I change the getText() method to getTextMessage() in the Foo class and wait a couple of seconds (no need to save just wait for auto-save and then auto-compile) and the result is shown here.
Conclusion
IntelliJ can handle changes in other maven modules on the fly. Any changes in the dependent modules are immediately reflected even when using compile-on-save.

Import project generated by gwt-maven-plugin

i followed the instruction of gwt-maven-plugin, generated then imported the project below,
1) Generate the project
$ mvn archetype:generate \
-DarchetypeGroupId=org.codehaus.mojo \
-DarchetypeArtifactId=gwt-maven-plugin \
-DarchetypeVersion=2.5.0
...
Define value for property 'groupId': : org.codehaus.mojo
Define value for property 'artifactId': : gwt-maven-plugin-sample
Define value for property 'version': 1.0-SNAPSHOT: :
Define value for property 'package': org.codehaus.mojo: :
Define value for property 'module': : Sample
...
2) Check the generated 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">
<!-- POM file generated with GWT webAppCreator -->
<modelVersion>4.0.0</modelVersion>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin-sample</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>GWT Maven Archetype</name>
<properties>
<!-- Convenience property to set the GWT version -->
<gwtVersion>2.5.0</gwtVersion>
<!-- GWT needs at least java 1.5 -->
<webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId>
<version>${gwtVersion}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>${gwtVersion}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.7</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.0.0.GA</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.0.0.GA</version>
<classifier>sources</classifier>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<!-- Generate compiled stuff in the folder used for developing mode -->
<outputDirectory>${webappDirectory}/WEB-INF/classes</outputDirectory>
<plugins>
<!-- GWT Maven Plugin -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>2.5.0</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>test</goal>
<goal>i18n</goal>
<goal>generateAsync</goal>
</goals>
</execution>
</executions>
<!-- Plugin configuration. There are many available options, see
gwt-maven-plugin documentation at codehaus.org -->
<configuration>
<runTarget>Sample.html</runTarget>
<hostedWebapp>${webappDirectory}</hostedWebapp>
<i18nMessagesBundle>org.codehaus.mojo.client.Messages</i18nMessagesBundle>
</configuration>
</plugin>
<!-- Copy static web files before executing gwt:run -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>exploded</goal>
</goals>
</execution>
</executions>
<configuration>
<webappDirectory>${webappDirectory}</webappDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
3) Check the generated project
gwt-maven-plugin-sample/
├── .classpath
├── pom.xml
├── .project
├── SampleTest-dev.launch
├── SampleTest-prod.launch
├── .settings
│   ├── com.google.appengine.eclipse.core.prefs
│   ├── com.google.gdt.eclipse.core.prefs
│   ├── com.google.gwt.eclipse.core.prefs
│   ├── .jsdtscope
│   ├── org.eclipse.jdt.core.prefs
│   ├── org.eclipse.wst.common.component
│   ├── org.eclipse.wst.common.project.facet.core.xml
│   ├── org.eclipse.wst.jsdt.ui.superType.container
│   └── org.maven.ide.eclipse.prefs
├── src
│   ├── main
│   │   ├── java
│   │   │   └── org
│   │   │   └── codehaus
│   │   │   └── mojo
│   │   │   ├── client
│   │   │   │   ├── GreetingService.java
│   │   │   │   └── Sample.java
│   │   │   ├── server
│   │   │   │   └── GreetingServiceImpl.java
│   │   │   └── shared
│   │   │   └── FieldVerifier.java
│   │   ├── resources
│   │   │   └── org
│   │   │   └── codehaus
│   │   │   └── mojo
│   │   │   ├── client
│   │   │   │   ├── Messages_fr.properties
│   │   │   │   └── Messages.properties
│   │   │   └── Sample.gwt.xml
│   │   └── webapp
│   │   ├── Sample.css
│   │   ├── Sample.html
│   │   └── WEB-INF
│   │   └── web.xml
│   └── test
│   ├── java
│   │   └── org
│   │   └── codehaus
│   │   └── mojo
│   │   └── client
│   │   └── GwtTestSample.java
│   └── resources
│   └── org
│   └── codehaus
│   └── mojo
│   └── SampleJUnit.gwt.xml
└── target
└── generated-sources
└── gwt
└── org
└── codehaus
└── mojo
33 directories, 26 files
4) On Eclipse, choose "Import Existing Project to Workspace"
5) According to the instruction of gwt-maven-plugin, the imported project should have resulted in the project structure similar to below,
In the end by our comparing 4) to 5), the problem in sight seems that no maven dependencies were added by the import at all, in other words, the generated project was not validated as a maven project. So, what's wrong with the steps above and the configuration below?
gwt-maven-plugin 2.5.0
m2e 1.2.0.20120903-1050
eclipse 3.7.2
maven 3.0.4
#EDIT
Ran "mvn gwt:run" successfully, but failed to launch DevMode by GWT Eclipse Plugin,
#EDIT 2
Referring to the link from #Sachin Shekhar R, i've looked into the official GWT Wiki: working with maven, followed the instruction and tested DynaTable RequestFactory sample. Great, it does work!
Unfortunately, the Wiki echoes that gwt-maven-plugin does have issues with the archetype in use.
gwt-maven-plugin 2.5.0 works best with GWT 2.5.0. The statement Ran "mvn gwt:run" successfully, but failed to launch DevMode by GWT Eclipse Plugin is a bit confusing.
I also noticed that in your case -
1) The generated pom file in indicates 2.5.0 and eclipse screenshot indicates 2.0.4. This might because your GPE is pointing to GWT 2.0.4 and overriding the pom files directive.
2) If you are using maven gwt:run then GWT Eclipse Plugin is irrelevant. The dev mode gets launched either by
a) mvn gwt:run
b) by GWT Eclipse Plugin when you right click on project and select Debug As -> Web Application
3) Maven dependencies are being shown in the screenshot you have shared. Can you expand it and verify which jars are being picked up.
Edit -
You can try some additional troubleshooting tips from with http://code.google.com/p/google-web-toolkit/wiki/WorkingWithMaven
My guess would be the configuration # Project properties, Google > Web Application, the "This project has a WAR directory"