I need some resources that are under:
src/main/resources/__files/
Now when creating my jar with maven those are not included.
This is my pomfile:
http://pastebin.com/xMtJDei2
when creating my app I get this:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building wiremock 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # wiremock ---
[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:compile (default-compile) # wiremock ---
[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 1 source file to /Users/betauser/Documents/Development/wiremock/target/classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # wiremock ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /Users/betauser/Documents/Development/wiremock/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.2:testCompile (default-testCompile) # wiremock ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) # wiremock ---
[INFO] No tests to run.
[INFO]
[INFO] --- maven-jar-plugin:2.2:jar (default-jar) # wiremock ---
[INFO] Building jar: /Users/betauser/Documents/Development/wiremock/target/WiremockServer.jar
[INFO]
[INFO] --- maven-dependency-plugin:2.9:copy-dependencies (copy-dependencies) # wiremock ---
[INFO] Copying slf4j-api-1.7.6.jar to /Users/betauser/Documents/Development/wiremock/target/dependency-jars/slf4j-api-1.7.6.jar
[INFO] Copying wiremock-1.52-standalone.jar to /Users/betauser/Documents/Development/wiremock/target/dependency-jars/wiremock-1.52-standalone.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.229 s
[INFO] Finished at: 2014-12-11T14:40:16+01:00
[INFO] Final Memory: 14M/81M
[INFO] ------------------------------------------------------------------------
Process finished with exit code 0
and when I run my program and I ask the file I get:
java.io.FileNotFoundException: /Users/betauser/Documents/Development/wiremock/target/src/main/resources/__files/test-long.mp3 (No such file or directory)
I wonder about the output ".../target/src/main/resources/..." .
The directory structure "src/main/resources" can't exist below "target", if your artifact builds properly.
The files you create in /src/main/resources and below belong to the classpath of your application.
Open your artifact (jar) which was created during the build process. There you should find a directory entry named "__files".
Related
I'm using the Selenium plugin with Maven and TestNG on Intellij IDEA. I'm trying to run my projects from the command line using "mvn clean test". This command works fine when I make a new project which comes with "MainPageTest.java" as it's test class. When I change the class/file name to "Runner.java" or anything else I can run it from the IDE but not from the command line.
This is the thread when it works.
[INFO] Scanning for projects...
[INFO]
[INFO] --------------------------< com.example:demo >--------------------------
[INFO] Building demo 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # demo ---
[INFO] Deleting C:\Users\Admin\IdeaProjects\demo\target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # demo ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\Users\Admin\IdeaProjects\demo\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # demo ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 1 source file to C:\Users\Admin\IdeaProjects\demo\target\classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # demo ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\Users\Admin\IdeaProjects\demo\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) # demo ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 1 source file to C:\Users\Admin\IdeaProjects\demo\target\test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.22.2:test (default-test) # demo ---
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running com.example.demo.MainPageTest
// WebDriver related stuff
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 17.200 s
[INFO] Finished at: 2020-12-16T22:42:10-05:00
[INFO] --------------------------------------
This is when I change the name of the class:
[INFO] Scanning for projects...
[INFO]
[INFO] --------------------------< com.example:demo >--------------------------
[INFO] Building demo 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # demo ---
[INFO] Deleting C:\Users\Admin\IdeaProjects\demo\target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # demo ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\Users\Admin\IdeaProjects\demo\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # demo ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 1 source file to C:\Users\Admin\IdeaProjects\demo\target\classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # demo ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\Users\Admin\IdeaProjects\demo\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) # demo ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 1 source file to C:\Users\Admin\IdeaProjects\demo\target\test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.22.2:test (default-test) # demo ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.076 s
[INFO] Finished at: 2020-12-16T22:47:44-05:00
[INFO] ------------------------------------------------------------------------
As you can see, there are no errors, but it doesn't run the test. I've tried rebuilding the project, running mvn clean install, and adding a testng.xml file but nothing works and there's no mention of MainPageTest anywhere else in the project / config. Someone please help. Thank you.
I figured it out, all I did was specify my testng.xml in my pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="All Test Suite">
<test verbose="2" preserve-order="true" name="C:/Users/Admin/IdeaProjects/demo">
<classes>
<class name="com.example.demo.Runner">
<methods>
<include name="test1"/>
<include name="test2"/>
<include name="test3"/>
<include name="test4"/>
</methods>
</class>
</classes>
</test>
</suite>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
<configuration>
<testFailureIgnore>true</testFailureIgnore>
<suiteXmlFiles>
<!-- TestNG suite XML files -->
<suiteXmlFile>testng.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
I am getting below error:
"No deployable artifacts found in path" while doing deploy through Jenkins.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Activation 0.1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # Activation ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # Activation ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.2:compile (default-compile) # Activation ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 9 source files to C:\Users\.jenkins\workspace\TestBuild\target\classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # Activation ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.2:testCompile (default-testCompile) # Activation ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) # Activation ---
[JENKINS] Recording test results
[INFO]
[INFO] --- maven-war-plugin:2.2:war (default-war) # Activation ---
[INFO] Packaging webapp
[INFO] Assembling webapp [Activation] in [C:\Users\.jenkins\workspace\TestBuild\target\Activation-0.1]
[INFO] Processing war project
[INFO] Copying webapp resources [C:\Users\.jenkins\workspace\TestBuild\src\main\webapp]
[INFO] Webapp assembled in [462 msecs]
[INFO] Building war: C:\Users\.jenkins\workspace\TestBuild\target\Activation-0.1.war
[INFO] WEB-INF\web.xml already added, skipping
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) # Activation ---
[INFO] Installing C:\Users\.jenkins\workspace\TestBuild\target\Activation-0.1.war to C:\Users\.m2\repository\com\ibm\rest\Activation\0.1\Activation-0.1.war
[INFO] Installing C:\Users\.jenkins\workspace\TestBuild\pom.xml to C:\Users\.m2\repository\com\ibm\rest\Activation\0.1\Activation-0.1.pom
[JENKINS] Archiving disabled
[JENKINS] Archiving disabled
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.926 s
[INFO] Finished at: 2017-12-17T15:19:38+05:30
[INFO] Final Memory: 23M/254M
[INFO] ------------------------------------------------------------------------
channel stopped
Connecting to IBM WebSphere Application Server...
No deployable artifacts found in path: C:\Users\.jenkins\workspace\modules/**lastSuccessful/**/Activation-*.ear
Error deploying to IBM WebSphere Application Server: java.lang.Exception: No deployable artifacts found!
at org.jenkinsci.plugins.websphere_deployer.WebSphereDeployerPlugin.gatherArtifactPaths(WebSphereDeployerPlugin.java:286)
at org.jenkinsci.plugins.websphere_deployer.WebSphereDeployerPlugin.perform(WebSphereDeployerPlugin.java:196)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1073)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
at hudson.model.Run.execute(Run.java:1749)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:421)
Below are my Jenkins Configurations:
Someone please suggest me what I am missing. I downloaded Maven Pluggin and Websphere Deploy Pluggin. My build is getting successful and also project is being copied in .jenkins/workplace folder but when it is trying to deploy to WAS , I am getting this error. Please guide me.
Just use **/*.ear if you're only deploying 1 EAR file for the "EAR Path". It should find it. If you're deploying a WAR use **/*.war and it will generate the EAR for you.
I tried to publish my java /spring boot app to openshift cloud platform via eclipse openshift plugin and it stucks at 'Preparing build for deployment'. For to be sure I waited for all day but there were no changes.
restarting the app and cleaning it did not worked
Is there any way to solve this, or any other way to deploy my spring boot app to openshift by using ssh connection etc...
here is console output:
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # site ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 1406 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # site ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 13 source files to /var/lib/openshift/581b33a789f5cf45fd000026/app-root/runtime/repo/target/classes
[WARNING] /var/lib/openshift/581b33a789f5cf45fd000026/app-root/runtime/repo/src/main/java/org/site/models/AnasayfaDuzen.java: /var/lib/openshift/581b33a789f5cf45fd000026/app-root/runtime/repo/src/main/java/org/site/models/AnasayfaDuzen.java uses or overrides a deprecated API.
[WARNING] /var/lib/openshift/581b33a789f5cf45fd000026/app-root/runtime/repo/src/main/java/org/site/models/AnasayfaDuzen.java: Recompile with -Xlint:deprecation for details.
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # site ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /var/lib/openshift/581b33a789f5cf45fd000026/app-root/runtime/repo/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) # site ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /var/lib/openshift/581b33a789f5cf45fd000026/app-root/runtime/repo/target/test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.18.1:test (default-test) # site ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-war-plugin:2.4:war (default-war) # site ---
[INFO] Packaging webapp
[INFO] Assembling webapp [site] in [/var/lib/openshift/581b33a789f5cf45fd000026/app-root/runtime/repo/target/site]
[INFO] Processing war project
[INFO] Webapp assembled in [10915 msecs]
[INFO] Building war: /var/lib/openshift/581b33a789f5cf45fd000026/app-root/runtime/repo/webapps/ROOT.war
[INFO]
[INFO] --- spring-boot-maven-plugin:1.4.1.RELEASE:repackage (default) # site ---
[INFO] Replacing main artifact webapps/ROOT.war to /var/lib/openshift/581b33a789f5cf45fd000026/app-root/runtime/repo/target/site.war
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 44.136s
[INFO] Finished at: Thu Dec 15 01:22:27 EST 2016
[INFO] Final Memory: 25M/170M
[INFO] ------------------------------------------------------------------------
Preparing build for deployment
thanks for any help
Have you tried checking your log files for further information about the problem that you are having?
You can check your log files by using the rhc tail command, or by sshing into your application and looking in the ~/app-root/logs directory.
You can learn more about checking your log files in our Developer Portal
I have a java play 2 project that i'm trying to run using maven. I added the play2-maven-plugin to my pom.xml.
When I try to run the following command mvn clean compile play2:run, I get the following:
```
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building my_project 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # my_project ---
[INFO] Deleting /Users/sergenasr/my_project/target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # my_project ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 2 resources
[INFO] Copying 3 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # my_project ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] >>> play2-maven-plugin:1.0.0-alpha5:run (default-cli) > process-classes # my_project >>>
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # my_project ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 2 resources
[INFO] Copying 3 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # my_project ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] <<< play2-maven-plugin:1.0.0-alpha5:run (default-cli) < process-classes # my_project <<<
[INFO]
[INFO] --- play2-maven-plugin:1.0.0-alpha5:run (default-cli) # my_project ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 35.640 s
[INFO] Finished at: 2016-11-01T22:07:17-07:00
[INFO] Final Memory: 11M/125M
[INFO] ------------------------------------------------------------------------
```
However, I don't see the server running.
Also, note that I can run the server normally using activator, then ~run. What am I doing wrong?
Use the latest 1.0.0-beta5 plugin version.
Read general plugin usage document.
Read plugin usage page for Play! Framework version used in your project (there are links on general usage page).
I have the goal of creating a maven reactor build for a modular RequestFactory project. I'm using Thomas Broyer's maven archetype as suggested by him in GWT Code Server not finding a module in a newly generated project using a maven archetype,
Thanks to his effort, it works immediately out of the box and without any problems whatsoever. It creates three modules (with names ending in client, server, shared).
What bugs me is that three projects have their java sources in the same package. One of the things I tried to do, after the project was up and running, was to refactor the packages of the three maven modules to actually end in their respective names. This works for all but the client project, since the GWT compiler (gwt-maven-plugin) does not seem to look for sources outside of the client project's own package when building the client package.
Hence, if the shared project has it's own package that is not a subpackage of the client's, this will result in GWT not being able to resolve all sources in shared.
My question is, am I missing something obvious, or am I trying to do something that is not recommended at all? Any pointers would be greatly appreciated.
I have been toying around with GWT and maven for a while now, but am still no expert so please bear with me :-). Here is what I did in detail:
Created the project using Thomas Broyer's archetype (the first time I selected "N" in order to be able to input a module name different than "App" the second time):
mvn archetype:generate \
-DarchetypeCatalog=https://oss.sonatype.org/content/repositories/snapshots/ \
-DarchetypeGroupId=net.ltgt.gwt.archetypes \
-DarchetypeArtifactId=modular-requestfactory \
-DarchetypeVersion=1.0-SNAPSHOT
Define value for property 'groupId': : com.example
Define value for property 'artifactId': : my-modular-app
Define value for property 'version': 1.0-SNAPSHOT: :
Define value for property 'package': com.example: : com.example.my.modular.app
Define value for property 'module': App: : MyModularApp
Define value for property 'module-short-name': ${module.toLowerCase()}: :
Confirm properties configuration:
groupId: com.example
artifactId: my-modular-app
version: 1.0-SNAPSHOT
package: com.example.my.modular.app
module: MyModularApp
module-short-name: ${module.toLowerCase()}
Y: : Y
[INFO] ----------------------------------------------------------------------------
[INFO] Using following parameters for creating project from Archetype: modular-requestfactory:1.0-SNAPSHOT
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: groupId, Value: com.example
[INFO] Parameter: artifactId, Value: my-modular-app
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: package, Value: com.example.my.modular.app
[INFO] Parameter: packageInPathFormat, Value: com/example/my/modular/app
[INFO] Parameter: package, Value: com.example.my.modular.app
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: module, Value: MyModularApp
[INFO] Parameter: groupId, Value: com.example
Feb 22, 2015 12:51:56 PM org.apache.velocity.runtime.log.JdkLogChute log
INFO: FileResourceLoader : adding path '.'
[INFO] Parameter: module-short-name, Value: mymodularapp
[INFO] Parameter: artifactId, Value: my-modular-app
[INFO] Parent element not overwritten in /private/tmp/mvn/my-modular-app/my-modular-app-client/pom.xml
[INFO] Parent element not overwritten in /private/tmp/mvn/my-modular-app/my-modular-app-shared/pom.xml
[INFO] Parent element not overwritten in /private/tmp/mvn/my-modular-app/my-modular-app-server/pom.xml
[INFO] project created from Archetype in dir: /private/tmp/mvn/my-modular-app
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:35 min
[INFO] Finished at: 2015-02-22T12:51:56+01:00
[INFO] Final Memory: 16M/216M
[INFO] ------------------------------------------------------------------------
Executed mvn clean install -Dgwt.draftCompile. Worked like a charm.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] my-modular-app
[INFO] my-modular-app-shared
[INFO] my-modular-app-client
[INFO] my-modular-app-server
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building my-modular-app 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # my-modular-app ---
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) # my-modular-app ---
[INFO] Installing /private/tmp/mvn/my-modular-app/pom.xml to /Users/nick/.m2/repository/com/example/my-modular-app/1.0-SNAPSHOT/my-modular-app-1.0-SNAPSHOT.pom
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building my-modular-app-shared 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # my-modular-app-shared ---
[INFO] Deleting /private/tmp/mvn/my-modular-app/my-modular-app-shared/target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # my-modular-app-shared ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /private/tmp/mvn/my-modular-app/my-modular-app-shared/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.2:compile (default-compile) # my-modular-app-shared ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 4 source files to /private/tmp/mvn/my-modular-app/my-modular-app-shared/target/classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # my-modular-app-shared ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /private/tmp/mvn/my-modular-app/my-modular-app-shared/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.2:testCompile (default-testCompile) # my-modular-app-shared ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) # my-modular-app-shared ---
[INFO] No tests to run.
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) # my-modular-app-shared ---
[INFO] Building jar: /private/tmp/mvn/my-modular-app/my-modular-app-shared/target/my-modular-app-shared-1.0-SNAPSHOT.jar
[INFO]
[INFO] --- maven-source-plugin:2.4:jar-no-fork (attach-sources) # my-modular-app-shared ---
[INFO] Building jar: /private/tmp/mvn/my-modular-app/my-modular-app-shared/target/my-modular-app-shared-1.0-SNAPSHOT-sources.jar
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) # my-modular-app-shared ---
[INFO] Installing /private/tmp/mvn/my-modular-app/my-modular-app-shared/target/my-modular-app-shared-1.0-SNAPSHOT.jar to /Users/nick/.m2/repository/com/example/my-modular-app-shared/1.0-SNAPSHOT/my-modular-app-shared-1.0-SNAPSHOT.jar
[INFO] Installing /private/tmp/mvn/my-modular-app/my-modular-app-shared/pom.xml to /Users/nick/.m2/repository/com/example/my-modular-app-shared/1.0-SNAPSHOT/my-modular-app-shared-1.0-SNAPSHOT.pom
[INFO] Installing /private/tmp/mvn/my-modular-app/my-modular-app-shared/target/my-modular-app-shared-1.0-SNAPSHOT-sources.jar to /Users/nick/.m2/repository/com/example/my-modular-app-shared/1.0-SNAPSHOT/my-modular-app-shared-1.0-SNAPSHOT-sources.jar
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building my-modular-app-client 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # my-modular-app-client ---
[INFO] Deleting /private/tmp/mvn/my-modular-app/my-modular-app-client/target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # my-modular-app-client ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /private/tmp/mvn/my-modular-app/my-modular-app-client/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.2:compile (default-compile) # my-modular-app-client ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /private/tmp/mvn/my-modular-app/my-modular-app-client/target/classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # my-modular-app-client ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /private/tmp/mvn/my-modular-app/my-modular-app-client/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.2:testCompile (default-testCompile) # my-modular-app-client ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) # my-modular-app-client ---
[INFO] No tests to run.
[INFO]
[INFO] --- gwt-maven-plugin:2.7.0:compile (gwt-compile) # my-modular-app-client ---
[INFO] Compiling module com.example.my.modular.app.MyModularApp
[INFO] Compiling 3 permutations
[INFO] Compiling permutation 0...
[INFO] Process output
[INFO] Compiling
[INFO] Compiling permutation 1...
[INFO] Process output
[INFO] Compiling
[INFO] Compiling permutation 2...
[INFO] Compile of permutations succeeded
[INFO] Compilation succeeded -- 8.061s
[INFO] Linking into /private/tmp/mvn/my-modular-app/my-modular-app-client/target/my-modular-app-client-1.0-SNAPSHOT/mymodularapp
[INFO] Link succeeded
[INFO] Linking succeeded -- 0.331s
[INFO]
[INFO] --- maven-war-plugin:2.5:war (default-war) # my-modular-app-client ---
[INFO] Packaging webapp
[INFO] Assembling webapp [my-modular-app-client] in [/private/tmp/mvn/my-modular-app/my-modular-app-client/target/my-modular-app-client-1.0-SNAPSHOT]
[INFO] Processing war project
[INFO] Copying webapp resources [/private/tmp/mvn/my-modular-app/my-modular-app-client/src/main/webapp]
[INFO] Webapp assembled in [29 msecs]
[INFO] Building war: /private/tmp/mvn/my-modular-app/my-modular-app-client/target/my-modular-app-client-1.0-SNAPSHOT.war
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) # my-modular-app-client ---
[INFO] Installing /private/tmp/mvn/my-modular-app/my-modular-app-client/target/my-modular-app-client-1.0-SNAPSHOT.war to /Users/nick/.m2/repository/com/example/my-modular-app-client/1.0-SNAPSHOT/my-modular-app-client-1.0-SNAPSHOT.war
[INFO] Installing /private/tmp/mvn/my-modular-app/my-modular-app-client/pom.xml to /Users/nick/.m2/repository/com/example/my-modular-app-client/1.0-SNAPSHOT/my-modular-app-client-1.0-SNAPSHOT.pom
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building my-modular-app-server 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # my-modular-app-server ---
[INFO] Deleting /private/tmp/mvn/my-modular-app/my-modular-app-server/target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # my-modular-app-server ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /private/tmp/mvn/my-modular-app/my-modular-app-server/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.2:compile (default-compile) # my-modular-app-server ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to /private/tmp/mvn/my-modular-app/my-modular-app-server/target/classes
[INFO]
[INFO] --- exec-maven-plugin:1.3.2:exec (requestfactory-validation-tool) # my-modular-app-server ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # my-modular-app-server ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /private/tmp/mvn/my-modular-app/my-modular-app-server/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.2:testCompile (default-testCompile) # my-modular-app-server ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) # my-modular-app-server ---
[INFO] No tests to run.
[INFO]
[INFO] --- maven-war-plugin:2.5:war (default-war) # my-modular-app-server ---
[INFO] Packaging webapp
[INFO] Assembling webapp [my-modular-app-server] in [/private/tmp/mvn/my-modular-app/my-modular-app-server/target/my-modular-app-server-1.0-SNAPSHOT]
[INFO] Processing war project
[INFO] Copying webapp resources [/private/tmp/mvn/my-modular-app/my-modular-app-server/src/main/webapp]
[INFO] Processing overlay [ id com.example:my-modular-app-client]
[INFO] Webapp assembled in [50 msecs]
[INFO] Building war: /private/tmp/mvn/my-modular-app/my-modular-app-server/target/my-modular-app-server-1.0-SNAPSHOT.war
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) # my-modular-app-server ---
[INFO] Installing /private/tmp/mvn/my-modular-app/my-modular-app-server/target/my-modular-app-server-1.0-SNAPSHOT.war to /Users/nick/.m2/repository/com/example/my-modular-app-server/1.0-SNAPSHOT/my-modular-app-server-1.0-SNAPSHOT.war
[INFO] Installing /private/tmp/mvn/my-modular-app/my-modular-app-server/pom.xml to /Users/nick/.m2/repository/com/example/my-modular-app-server/1.0-SNAPSHOT/my-modular-app-server-1.0-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] my-modular-app ..................................... SUCCESS [ 0.185 s]
[INFO] my-modular-app-shared .............................. SUCCESS [ 1.014 s]
[INFO] my-modular-app-client .............................. SUCCESS [ 10.829 s]
[INFO] my-modular-app-server .............................. SUCCESS [ 1.170 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 13.341 s
[INFO] Finished at: 2015-02-22T12:55:14+01:00
[INFO] Final Memory: 27M/257M
[INFO] ------------------------------------------------------------------------
Aftwerwards, I refactored the project structure so that each of the client, server, shared has it's own subpackage.
(check) Refactor project my-modular-app-shared:
Rename package com.example.my.modular.app -> com.example.my.modular.app.shared
Replace server's pom.xml reference from com.example.my.modular.app.MyModularAppFactory -> com.example.my.modular.app.shared.MyModularAppFactory
Execute mvn clean install -Dgwt.draftCompile with success.
(check) Refactor project my-modular-app-server:
Rename package com.example.my.modular.app -> com.example.my.modular.app.server
Update GreetingResponseProxy's #ProxyForName("com.example.my.modular.app.GreetingResponse") -> #ProxyForName("com.example.my.modular.app.server.GreetingResponse")
Update GreetingContext's #ServiceName("com.example.my.modular.app.GreetingService") -> #ServiceName("com.example.my.modular.app.server.GreetingService")
Execute mvn clean install -Dgwt.draftCompile with success.
(fail) Refactor project my-modular-app-client:
Rename package com.example.my.modular.app -> com.example.my.modular.app.client
Update client's MyModuleApp.gwt.xml com.example.my.modular.app.MyModularApp -> com.example.my.modular.app.client.MyModularApp
Update client pom.xml's gwt-maven-plugin module entry com.example.my.modular.app.MyModularApp -> com.example.my.modular.app.client.MyModularApp
[INFO] Compiling module com.example.my.modular.app.client.MyModularApp
[INFO] Tracing compile failure path for type 'com.example.my.modular.app.client.MyModularApp'
[INFO] [ERROR] Errors in 'file:/private/tmp/mvn/my-modular-app/my-modular-app-client/src/main/java/com/example/my/modular/app/client/MyModularApp.java'
[INFO] [ERROR] Line 41: No source code is available for type com.example.my.modular.app.shared.MyModularAppFactory; did you forget to inherit a required module?
[INFO] [ERROR] Line 135: No source code is available for type com.example.my.modular.app.shared.GreetingResponseProxy; did you forget to inherit a required module?
[INFO] [ERROR] Line 125: No source code is available for type com.example.my.modular.app.shared.FieldVerifier; did you forget to inherit a required module?
[INFO] Finding entry point classes
[INFO] Tracing compile failure path for type 'com.example.my.modular.app.client.MyModularApp'
[INFO] [ERROR] Errors in 'file:/private/tmp/mvn/my-modular-app/my-modular-app-client/src/main/java/com/example/my/modular/app/client/MyModularApp.java'
[INFO] [ERROR] Line 41: No source code is available for type com.example.my.modular.app.shared.MyModularAppFactory; did you forget to inherit a required module?
[INFO] [ERROR] Line 135: No source code is available for type com.example.my.modular.app.shared.GreetingResponseProxy; did you forget to inherit a required module?
[INFO] [ERROR] Line 125: No source code is available for type com.example.my.modular.app.shared.FieldVerifier; did you forget to inherit a required module?
[INFO] [ERROR] Hint: Check the inheritance chain from your module; it may not be inheriting a required module or a module may not be adding its source path entries properly
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] my-modular-app ..................................... SUCCESS [ 0.180 s]
[INFO] my-modular-app-shared .............................. SUCCESS [ 0.999 s]
[INFO] my-modular-app-client .............................. FAILURE [ 5.156 s]
[INFO] my-modular-app-server .............................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.473 s
There is nothing else in the pom.xml and source files that appears in need to be changed. All Java compilations work out perfectly. However, the end result is a fail, since the GWT compiler (gwt-maven-plugin) does not seem to look for sources outside of the client project's own package when building the client package. Hence, if the shared project has it's own subpackage that is not a subpackage of the client's this will result in gwt-maven-plugin not being able to resolve any sources in shared.
So anything that is under shared is not found by the GWT compiler. Interestingly, if I rename the package in my-modular-app-shared to com.example.my.modular.app.client instead of com.example.my.modular.app.shared and update the references, everything works as a charm.
It seems to me that the problem is that gwt-maven-plugin is confined to the package of the client and all other referenced projects ought to have all GWT relevant sources in subpackages of the client package. The question is, how can I tell the GWT compiler to look in a different package when traversing different maven modules?
Any help/pointers greatly appreciated, and thanks in advance!
PS: I managed to create a workaround by adding the following GWT module in the client project (package com.example.my.modular.app) and inheriting it in the MyModularApp.gwt.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC
"-//Google Inc.//DTD Google Web Toolkit 1.6.4//EN"
"http://google-web-toolkit.googlecode.com/svn/tags/2.4.0/distro-source/core/src/gwt-module.dtd">
<module>
<source path="shared"/>
</module>
So to rephrase the question: there an automatic way of achieving this instead of having the need to declare artificial modules?
This is just how GWT works, the compiler only sees classes from the source path which is a subset of the classpath.
Generally, people put their gwt.xml in the com.example.my.modular.app package and add client and shared subpackages to the source path:
<source path="client"/>
<source path="shared"/>