How to get 'mvn lagom:runAll' to get my service listening on a port? - lagom

I was having problems getting my first service to run and decided to add the hello-api and hello-impl projects from the lagom Maven archtype project to see if it would work. It did but mine do not.
Background
Since other team members are pure Java developers, I was trying to avoid leveraging sbt and activator. Thus, the objective is that everything works in maven.
Here's a snippet of the 'mvn install' script output to show the other services built.
$ mvn install
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] Archetype - mai-svcs
[INFO] mai-svc-common
[INFO] mai-actors-api <======= WANT THE SERVICE FOR THIS ONE TO RUN
[INFO] mai-namespace-api
[INFO] mai-actors-impl
[INFO] mai-namespace-impl
[INFO] mai-i18n-phrases-api
[INFO] hello-api
[INFO] hello-impl
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Archetype - mai-svcs 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Archetype - mai-svcs ............................... SUCCESS [ 2.774 s]
[INFO] mai-svc-common ..................................... SUCCESS [ 7.190 s]
[INFO] mai-actors-api ..................................... SUCCESS [ 24.706 s]
[INFO] mai-namespace-api .................................. SUCCESS [ 12.628 s]
[INFO] mai-actors-impl .................................... SUCCESS [ 29.061 s]
[INFO] mai-namespace-impl ................................. SUCCESS [ 21.294 s]
[INFO] mai-i18n-phrases-api ............................... SUCCESS [ 22.091 s]
[INFO] hello-api .......................................... SUCCESS [ 3.546 s]
NOTES: An MAIActorsModule class analogous to the HelloModule class was created and the application.conf file added in the src/main/resources folder.
When the command 'mvn lagom:runAll' is issued, initially, the services are the hello service port is logged but no other service's port is.
$ mvn lagom:runAll
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] Archetype - mai-svcs
[INFO] mai-svc-common
[INFO] mai-actors-api
[INFO] mai-namespace-api
[INFO] mai-actors-impl
[INFO] mai-namespace-impl
[INFO] mai-i18n-phrases-api
[INFO] hello-api
[INFO] hello-impl
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Archetype - mai-svcs 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- lagom-maven-plugin:1.2.1:runAll (default-cli) # mai-svcs ---
[INFO] Starting Kafka
[INFO] Starting Cassandra
.[INFO] Did not find Netty's native epoll transport in the classpath, defaulting to NIO.
....[INFO] Using data-center name 'datacenter1' for DCAwareRoundRobinPolicy (if this is incorrect, please provide the correct datacenter name with DCAwareRoundRobinPolicy constructor)
[INFO] New Cassandra host /127.0.0.1:4000 added
[INFO] Cassandra server running at 127.0.0.1:4000
[INFO] Service locator is running at http://localhost:8000
[INFO] Service gateway is running at http://localhost:9000
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\Users\lusp\mai_svcs\mai-svcs\hello-api\src\main\resources
[INFO] Nothing to compile - all classes are up to date
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
**[INFO] Nothing to compile - all classes are up to date
[INFO] Service hello-impl listening for HTTP on 0:0:0:0:0:0:0:0:57797
// ----- NO ENTRY FOR mai-actors-impl!!! -----
[INFO] (Service started, press enter to stop and go back to the console...)**
What step(s) did I miss?

Each of your <service>-impl projects need to:
Invoke the lagom-maven-plugin
Configure it with the property <lagomService>true</lagomService>
Here's an example snippet of what you need to add to your pom.xml file in each service implementation project:
<build>
<plugins>
<plugin>
<groupId>com.lightbend.lagom</groupId>
<artifactId>lagom-maven-plugin</artifactId>
<configuration>
<lagomService>true</lagomService>
</configuration>
</plugin>
</plugins>
</build>
The Lagom documentation has more details in the page titled Defining a Lagom build

Related

When I run my test through jenkins chrome browser is not triggered and also showing testng.xml file is not matching

Chrome browser is not launching when I click the build now link in jenkins, but showing build is success.
Solution provided in Jenkins : Selenium GUI tests are not visible on Windows are not working for me. Someone please help me in this.
Started by user Karthick Ragu
Running as SYSTEM
Building in workspace C:\Program Files\Jenkins\workspace\killerFramework
Parsing POMs
Established TCP socket on 51445
[karthick.framework] $ "C:\Program Files\Java\jdk1.8.0_181/bin/java" -cp "C:\Program Files\Jenkins\plugins\maven-plugin\WEB-INF\lib\maven35-agent-1.13.jar;C:\Program Files\Jenkins\tools\hudson.tasks.Maven_MavenInstallation\TestMaven\boot\plexus-classworlds-2.6.0.jar;C:\Program Files\Jenkins\tools\hudson.tasks.Maven_MavenInstallation\TestMaven/conf/logging" jenkins.maven3.agent.Maven35Main "C:\Program Files\Jenkins\tools\hudson.tasks.Maven_MavenInstallation\TestMaven" "C:\Program Files\Jenkins\war\WEB-INF\lib\remoting-3.35.jar" "C:\Program Files\Jenkins\plugins\maven-plugin\WEB-INF\lib\maven35-interceptor-1.13.jar" "C:\Program Files\Jenkins\plugins\maven-plugin\WEB-INF\lib\maven3-interceptor-commons-1.13.jar" 51445
<===[JENKINS REMOTING CAPACITY]===>channel started
Executing Maven: -B -f D:\LEARNING\sel\karthick.framework\pom.xml clean test
[INFO] Scanning for projects...
[INFO]
[INFO] --------------< web.automation.killer:karthick.framework >--------------
[INFO] Building karthick.framework 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # karthick.framework ---
[INFO] Deleting D:\LEARNING\sel\karthick.framework\target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # karthick.framework ---
[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.8.1:compile (default-compile) # karthick.framework ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # karthick.framework ---
[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.8.1:testCompile (default-testCompile) # karthick.framework ---
[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 3 source files to D:\LEARNING\sel\karthick.framework\target\test-classes
[INFO]
[INFO] --- maven-surefire-plugin:3.0.0-M3:test (default-test) # karthick.framework ---
[JENKINS] Recording test results
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 15.339 s
[INFO] Finished at: 2019-10-06T23:35:41+05:30
[INFO] ------------------------------------------------------------------------
Waiting for Jenkins to finish collecting data
[JENKINS] Archiving D:\LEARNING\sel\karthick.framework\pom.xml to web.automation.killer/karthick.framework/0.0.1-SNAPSHOT/karthick.framework-0.0.1-SNAPSHOT.pom
channel stopped
TestNG Reports Processing: START
Looking for TestNG results report in workspace using pattern: **/testng-results.xml
Did not find any matching files.
Finished: SUCCESS
The error is loud and clear
Looking for TestNG results report in workspace using pattern:
**/testng-results.xml Did not find any matching files.
That mean Jenkins not able to found xml file as per the path you have provided in jenkins.
Check if the path or filename is fine.
Put the full absolute path first to check and then try to create ** relative path

Jenkins not running TestNG Tests

I've got an TestNG project which was running on Jenkins. For some reason which I don't know it stopped running the tests. It compiles perfectly but it doesn't run the the test. Here is the output of a run:
<===[JENKINS REMOTING CAPACITY]===>channel started
log4j:WARN No appenders could be found for logger
(org.apache.commons.beanutils.converters.BooleanConverter).
log4j:WARN Please initialize the log4j system properly.
Executing Maven: -B -f C:\Java\jenkins-1.523\workspace\TEST_HEAD_NOEXPORT\CMS-WEB SELENIUM-WEB-TEST\pom.xml clean install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building TEST-CMS-WEB 0.0.1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) # Web ---
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) # Web ---
[debug] execute contextualize
[INFO] Using 'cp1252' encoding to copy filtered resources.
[INFO] Copying 69 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) # Web ---
[INFO] Compiling 73 source files to C:\Java\jenkins-1.523\workspace\TEST_HEAD_NOEXPORT\CMS-WEB\SELENIUM-WEB-TEST\target\classes
[INFO]
[INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) # Web ---
[debug] execute contextualize
[INFO] Using 'cp1252' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Java\jenkins-1.523\workspace\TEST_HEAD_NOEXPORT\CMS-WEB\SELENIUM-WEB-TEST\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) # Web ---
[INFO] Compiling 2 source files to C:\Java\jenkins-1.523\workspace\TEST_HEAD_NOEXPORT\CMS-WEB\SELENIUM-WEB-TEST\target\test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) # Web ---
[JENKINS] Recording test results
[INFO]
[INFO] --- maven-jar-plugin:2.3.2:jar (default-jar) # Web ---
[INFO] Building jar: C:\Java\jenkins-1.523\workspace\TEST_HEAD_NOEXPORT\CMS-WEB\SELENIUM-WEB-TEST\target\Web-0.0.1.jar
[INFO]
[INFO] --- maven-install-plugin:2.3.1:install (default-install) # Web ---
[INFO] Installing C:\Java\jenkins-1.523\workspace\TEST_HEAD_NOEXPORT\CMS-WEB\SELENIUM-WEB-TEST\target\Web-0.0.1.jar to C:\.m2\repository\Test\Web\0.0.1\Web-0.0.1.jar
[INFO] Installing C:\Java\jenkins-1.523\workspace\TEST_HEAD_NOEXPORT\CMS-WEB\SELENIUM-WEB-TEST\pom.xml to C:\.m2\repository\Test\Web\0.0.1\Web-0.0.1.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.211s
[INFO] Finished at: Wed Jan 15 14:21:03 UYST 2014
[INFO] Final Memory: 26M/310M
[INFO] ------------------------------------------------------------------------
[JENKINS] Archiving C:\Java\jenkins-1.523\workspace\TEST_HEAD_NOEXPORT\CMS-WEB\SELENIUM-WEB-TEST\pom.xml to C:\Java\jenkins-1.523\jobs\TEST_HEAD_NOEXPORT\modules\Test$Web\builds\2014-01-15_14-20-56\archive\Test\Web\0.0.1\Web-0.0.1.pom
[JENKINS] Archiving C:\Java\jenkins-1.523\workspace\TEST_HEAD_NOEXPORT\CMS-WEB\SELENIUM-WEB-TEST\target\Web-0.0.1.jar to C:\Java\jenkins-1.523\jobs\TEST_HEAD_NOEXPORT\modules\Test$Web\builds\2014-01-15_14-20-56\archive\Test\Web\0.0.1\Web-0.0.1.jar
Waiting for Jenkins to finish collecting data
If anyone knows what could be happening I would appreciate the help.
If your using Maven Surefire, did you correctly specify a "test include" filter? The test phase will search the packages in src/test/java for classes containing the #Test annotation. It's easy to misconfigure Maven for the location of the src/test/java directory and so just be careful and you will figure it out.
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M3</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>testng.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
Include maven surefire plugin end of the properties & before the dependencies. Use your "TestNG" XML file name.Use above code.

Error while executing atlas-create-jira-plugin

I am getting this error while executing atlas-create-jira-plugin command, I am starting Jira plugin development:
A new plugin structure is required for JIRA 5 plugins due to significant changes in the APIs.
Create a plugin for?
1) JIRA 5
2) JIRA 4 (or earlier)
#?1
Executing: "C:\atlassian-plugin-sdk\apache-maven\bin\mvn.bat" com.atlassian.maven.plugins:maven-jira-plugin:4.1.6:create
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Default Project
[INFO] task-segment: [com.atlassian.maven.plugins:maven-jira-plugin:4.1.6:create] (aggregator-style)
[INFO] ------------------------------------------------------------------------
Downloading: http://www.laughingpanda.org/maven2/org/twdata/maven/maven-cli-plugin-parent/0.7/maven-cli-plugin-parent-0.
7.pom
[WARNING] *** CHECKSUM FAILED - Checksum failed on download: local = '21a121ae3afd67024dd862f90189be2fb4931146'; remote
= '<!DOCTYPE' - RETRYING
Downloading: http://www.laughingpanda.org/maven2/org/twdata/maven/maven-cli-plugin-parent/0.7/maven-cli-plugin-parent-0.
7.pom
[WARNING] *** CHECKSUM FAILED - Checksum failed on download: local = '21a121ae3afd67024dd862f90189be2fb4931146'; remote
= '<!DOCTYPE' - IGNORING
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).
Project ID: null:maven-cli-plugin:maven-plugin:0.7
Reason: Cannot find parent: org.twdata.maven:maven-cli-plugin-parent for project: null:maven-cli-plugin:maven-plugin:0.7
for project null:maven-cli-plugin:maven-plugin:0.7
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 16 seconds
[INFO] Finished at: Tue Apr 30 15:43:10 IST 2013
[INFO] Final Memory: 18M/43M
Please let me know how can I proceed.
Thanks,
Rhishi

Getting start with Maven

I am very new to Maven.I have installed the maven on my local machine.
After installation for trial basis i was trying to execute mvn archetype:generate -DarchetypeGroupId=org.apache.maven.archetypes -DgroupId=com.mycompany.app -DartifactId=my-app
for that i am getting below error message.
C:\work\maven2.2\bin>mvn archetype:generate -DarchetypeGroupId=org.apache
.maven.archetypes -DgroupId=com.mycompany.app -DartifactId=my-app
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'archetype'.
[INFO] org.apache.maven.plugins: checking for updates from central
[WARNING] repository metadata for: 'org.apache.maven.plugins' could not be retri
eved from repository: central due to an error: Error transferring file: repo1.ma
ven.org
[INFO] Repository 'central' will be blacklisted
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] The plugin 'org.apache.maven.plugins:maven-archetype-plugin' does not exi
st or no valid version could be found
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2 seconds
[INFO] Finished at: Tue Aug 30 11:45:49 IST 2011
[INFO] Final Memory: 1M/59M
[INFO] ------------------------------------------------------------------------
Can any one help me if i need to have a prerequisite setting for the same?
Thanks in advance. :)
It's comand is correct and on my computer run correctly. But you have Error transferring file. So on this branch you may read about this error.
EDIT:
Tutorials:
First of all read this article : maven in 5 minutes
For more information : Maven Getting Started Guide
The second article will give you all you need to understend maven.

Maven2 problem to access plugins repository !

i just come to install maven2, after configuring the settings.xml in ${user.home}/.m2 and fixing a proxy error. Now by executing the command :
mvn -U archetype:create -DgroupId=maven-test -DartifactId=maven-test
-DpackageName=net.ensode.maventest
i get this error :
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'archetype'.
[INFO] org.apache.maven.plugins: checking for updates from central
[WARNING] repository metadata for: 'org.apache.maven.plugins' could not be retri
eved from repository: central due to an error: Authorization failed: Access deni
ed to: http://repo2.maven.org/maven2/org/apache/maven/plugins/maven-metadata.xml
[INFO] Repository 'central' will be blacklisted
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] The plugin 'org.apache.maven.plugins:maven-archetype-plugin' does not exi
st or no valid version could be found
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Thu Apr 29 16:05:40 CEST 2010
[INFO] Final Memory: 2M/247M
[INFO] ------------------------------------------------------------------------
any idea of what could cause it ?
thanks !
I think that the most likely cause is that your proxy requires you to authenticate, and you haven't configured the authentication details into your settings.xml file.