Maven with Java play 2 framework: Server not starting - java

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).

Related

Not able to deploy to Websphere Application server 8.5 through Jenkins

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.

openshift eclipse publish stuck

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

gwt-maven-plugin not finding sources in a maven module in a GWT maven reactor build

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"/>

GWT Code Server not finding a module in a newly generated project using a maven archetype

I've worked with GWT and eclipse for a while now and I wanted to play a bit with maven and the GWT plugin (gwt-maven-plugin, enter link description here). I tried to use it out of eclipse (Luna 4.4), but obviously I didn't do it correctly, as it was extremely brittle to the point that it broke on a regular basis as the IDE overwrote it's settings when I changed something small in the pom.xml. So I decided to take a step back and eliminate the black magic that eclipse is and start a new project from scratch from the command line.
However, I cannot seem to be getting the hang of running the actual application, because when I execute the code server, navigate to the page, I see the following message:
Can't find any GWT Modules on this page.
Obviously, the code server is running, however the module files seem to not have been hosted. AFAIK I see after several hours of educating myself (and finding http://blog.ltgt.net/how-does-gwts-super-dev-mode-work/), there should be a second process actually hosting the code in parallel to the code server. What is the appropriate way of doing this with maven? Should I open a second terminal and run a jetty or something else in parallel to the code server? If so, could someone please give me a hint how I can do it most efficiently?
Thanks in advance!
Here is how I created the project:
mvn archetype:generate \
-DarchetypeGroupId=org.codehaus.mojo \
-DarchetypeArtifactId=gwt-maven-plugin \
-DarchetypeVersion=2.7.0
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-archetype-plugin:2.2:generate (default-cli) > generate-sources # standalone-pom >>>
[INFO]
[INFO] <<< maven-archetype-plugin:2.2:generate (default-cli) < generate-sources # standalone-pom <<<
[INFO]
[INFO] --- maven-archetype-plugin:2.2:generate (default-cli) # standalone-pom ---
[INFO] Generating project in Interactive mode
[INFO] Archetype repository missing. Using the one from [org.codehaus.mojo:gwt-maven-plugin:2.7.0] found in catalog remote
Define value for property 'groupId': : com.mytest
Define value for property 'artifactId': : gwtmvntest
Define value for property 'version': 1.0-SNAPSHOT: :
Define value for property 'package': com.mytest: : com.mytest.gwtmvntest
Define value for property 'module': : GwtMvnTest
Confirm properties configuration:
groupId: com.mytest
artifactId: gwtmvntest
version: 1.0-SNAPSHOT
package: com.mytest.gwtmvntest
module: GwtMvnTest
Y: :
[INFO] ----------------------------------------------------------------------------
[INFO] Using following parameters for creating project from Archetype: gwt-maven-plugin:2.7.0
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: groupId, Value: com.mytest
[INFO] Parameter: artifactId, Value: gwtmvntest
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: package, Value: com.mytest.gwtmvntest
[INFO] Parameter: packageInPathFormat, Value: com/mytest/gwtmvntest
[INFO] Parameter: package, Value: com.mytest.gwtmvntest
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: module, Value: GwtMvnTest
[INFO] Parameter: groupId, Value: com.mytest
[INFO] Parameter: artifactId, Value: gwtmvntest
[INFO] project created from Archetype in dir: /private/tmp/mvn/gwtmvntest
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 08:12 min
[INFO] Finished at: 2015-01-14T12:59:17+01:00
[INFO] Final Memory: 15M/310M
[INFO] ------------------------------------------------------------------------
Here is how I compiled the project:
mvn compile gwt:compile
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building GWT Maven Archetype 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- gwt-maven-plugin:2.7.0:generateAsync (default) # gwtmvntest ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # gwtmvntest ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # gwtmvntest ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 6 source files to /private/tmp/mvn/gwtmvntest/target/gwtmvntest-1.0-SNAPSHOT/WEB-INF/classes
[INFO]
[INFO] --- gwt-maven-plugin:2.7.0:compile (default-cli) # gwtmvntest ---
[INFO] Compiling module com.mytest.gwtmvntest.GwtMvnTest
[INFO] Compiling 5 permutations
[INFO] Compiling permutation 0...
[INFO] Process output
[INFO] Compiling
[INFO] Compiling permutation 4...
[INFO] Process output
[INFO] Compiling
[INFO] Compiling permutation 3...
[INFO] Process output
[INFO] Compiling
[INFO] Compiling permutation 2...
[INFO] Process output
[INFO] Compiling
[INFO] Compiling permutation 1...
[INFO] Compile of permutations succeeded
[INFO] Compilation succeeded -- 13.866s
[INFO] Linking into /private/tmp/mvn/gwtmvntest/target/gwtmvntest-1.0-SNAPSHOT/GwtMvnTest
[INFO] Link succeeded
[INFO] Linking succeeded -- 0.171s
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 18.228 s
[INFO] Finished at: 2015-01-14T13:07:07+01:00
[INFO] Final Memory: 22M/310M
[INFO] ------------------------------------------------------------------------
Here is how I ran the project:
mvn gwt:run-codeserver
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building GWT Maven Archetype 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> gwt-maven-plugin:2.7.0:run-codeserver (default-cli) > process-classes # gwtmvntest >>>
[INFO]
[INFO] --- gwt-maven-plugin:2.7.0:generateAsync (default) # gwtmvntest ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # gwtmvntest ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # gwtmvntest ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] <<< gwt-maven-plugin:2.7.0:run-codeserver (default-cli) < process-classes # gwtmvntest <<<
[INFO]
[INFO] --- gwt-maven-plugin:2.7.0:run-codeserver (default-cli) # gwtmvntest ---
[INFO] Turning off precompile in incremental mode.
[INFO] Super Dev Mode starting up
[INFO] workDir: /var/folders/nk/58gyq85x7l3_mzb5rc0gw42w0000gn/T/gwt-codeserver-5859907708379954718.tmp
[INFO] Loading Java files in com.mytest.gwtmvntest.GwtMvnTest.
[INFO] Module setup completed in 11742 ms
[ERROR] 2015-01-14 13:14:35.800:INFO:oejs.Server:jetty-8.y.z-SNAPSHOT
[ERROR] 2015-01-14 13:14:35.833:INFO:oejs.AbstractConnector:Started SelectChannelConnector#127.0.0.1:9876
[INFO]
[INFO] The code server is ready at http://localhost:9876/
With GWT 2.7+ all you need is to launch mvn gwt:run and it'll use SuperDevMode under the cover, with "recompile on load" (instead of using bookmarklets).
Note that gwt:run won't copy your src/main/webapp or your dependencies, so you'll likely have to run mvn war:exploded (or mvn package) as a prerequisite (and every time you change a file in src/main/webapp or you need to refresh your dependencies)
That being said, unless your project is really simple, you should start using distinct Maven modules early for client and server code; this is because Maven insists that you cannot manage a "GWT client-side classpath" and a "server-side classpath" in the same POM.
I published archetypes to help setting everything up: https://github.com/tbroyer/gwt-maven-archetypes (I unfortunately haven't had the time yet to update them to GWT 2.7)
Either that or use Gradle…

maven copy test resources into jar fails

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".

Categories

Resources