Maven 3.5.2 cannot deploy artifact to Artifactory with error 417 - apache

I'm creating the simple pom project as the following:-
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.test</groupId>
<artifactId>test-maven</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>test-maven</name>
<distributionManagement>
<repository>
<id>central</id>
<name>myartifactory</name>
<url>
https://myhost/artifactory/libs-release-local
</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<name>myartifactory</name>
<url>
https://myhost/artifactory/libs-snapshot-local
</url>
</snapshotRepository>
</distributionManagement>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
The settings.xml is
<servers>
<server>
<id>central</id>
<username>my-user-id</username>
<password>some-encrypyted-password</password>
</server>
<server>
<id>snapshots</id>
<username>my-user-id</username>
<password>some-encrypyted-password</password>
</server>
</servers>
This project is able to be deployed to Artifactory 5.8.3 by using Maven 3.3.9: mvn clean deploy.
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T23:41:47+07:00)
Maven home: C:\Java.Application\Apache\apache-maven-3.3.9\bin\..
Java version: 1.8.0_121, vendor: Oracle Corporation
Java home: C:\Java.Application\Sun\Java\jdk1.8.0_121\jre
Default locale: en_US, platform encoding: UTF-8
OS name: "windows 10", version: "10.0", arch: "amd64", family: "dos"
But when I change to Maven 3.5.2
Apache Maven 3.5.2 (138edd61fd100ec658bfa2d307c43b76940a5d7d; 2017-10-18T14:58:13+07:00)
Maven home: C:\Java.Application\Apache\apache-maven-3.5.2\bin\..
Java version: 1.8.0_121, vendor: Oracle Corporation
Java home: C:\Java.Application\Sun\Java\jdk1.8.0_121\jre
Default locale: en_US, platform encoding: UTF-8
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
During the executing the mvn clean deploy there is an error as
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy
(default-deploy) on project test-maven: Failed to deploy artifacts:
Could not transfer artifact com.test:test-maven:pom:0.0.1-20180213.064245-2 from/to
snapshots (https://myhost/artifactory/libs-snapshot-local): Failed to transfer file:
https://myhost/artifactory/libs-snapshot-local/com/test/test-maven/
0.0.1-SNAPSHOT/test-maven-0.0.1-20180213.064245-2.pom.
Return code is: 417, ReasonPhrase: Expectation Failed. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException:
Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy
(default-deploy) on project test-maven:
Failed to deploy artifacts: Could not transfer artifact...
.../0.0.1-SNAPSHOT/test-maven-0.0.1-20180213.064245-2.pom.
Return code is: 417, ReasonPhrase: Expectation Failed.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:213)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
Am I doing something wrong? Could you please help to advise?
EDIT 1
There is no any log printing at artifactory.log at that time.
The request.log
20180213162947|1|REQUEST|some-ip|non_authenticated_user|GET|/libs-snapshot-local/com/test/test-maven/0.0.1-SNAPSHOT/maven-metadata.xml|HTTP/1.0|401|0
20180213162947|193|REQUEST|some-ip|my-user|GET|/libs-snapshot-local/com/test/test-maven/0.0.1-SNAPSHOT/maven-metadata.xml|HTTP/1.0|200|605
20180213162947|3|REQUEST|some-ip|my-user|GET|/libs-snapshot-local/com/test/test-maven/0.0.1-SNAPSHOT/maven-metadata.xml.sha1|HTTP/1.0|200|40
The access.log
2018-02-13 16:29:47,347 [ACCEPTED DOWNLOAD] libs-snapshot-local:com/test/test-maven/0.0.1-SNAPSHOT/maven-metadata.xml for my-user/some-ip.
2018-02-13 16:29:47,437 [ACCEPTED DOWNLOAD] libs-snapshot-local:com/test/test-maven/0.0.1-SNAPSHOT/maven-metadata.xml.sha1 for my-user/some-ip.
EDIT 2
The mvn clean deploy -e -X log
[INFO]
[INFO] --- maven-deploy-plugin:2.8.2:deploy (default-deploy) # test-maven ---
[DEBUG] Dependency collection stats: {ConflictMarker.analyzeTime=129185, ConflictMarker.markTime=69136, ConflictMarker.nodeCount=36, ConflictIdSorter.graphTime=58074, ConflictIdSorter.topsortTime=20149, ConflictIdSorter.conflictIdCount=16, ConflictIdSorter.conflictIdCycleCount=0, ConflictResolver.totalTime=960001, ConflictResolver.conflictItemCount=36, DefaultDependencyCollector.collectTime=76597424, DefaultDependencyCollector.transformTime=1258668}
[DEBUG] org.apache.maven.plugins:maven-deploy-plugin:jar:2.8.2:
[DEBUG] org.apache.maven:maven-plugin-api:jar:2.2.1:compile
[DEBUG] org.apache.maven:maven-project:jar:2.2.1:compile
[DEBUG] org.apache.maven:maven-settings:jar:2.2.1:compile
[DEBUG] org.apache.maven:maven-profile:jar:2.2.1:compile
[DEBUG] org.apache.maven:maven-artifact-manager:jar:2.2.1:compile
[DEBUG] org.apache.maven:maven-repository-metadata:jar:2.2.1:compile
[DEBUG] backport-util-concurrent:backport-util-concurrent:jar:3.1:compile
[DEBUG] org.apache.maven:maven-plugin-registry:jar:2.2.1:compile
[DEBUG] org.codehaus.plexus:plexus-interpolation:jar:1.11:compile
[DEBUG] org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1:compile
[DEBUG] junit:junit:jar:3.8.1:compile
[DEBUG] classworlds:classworlds:jar:1.1-alpha-2:compile
[DEBUG] org.apache.maven:maven-model:jar:2.2.1:compile
[DEBUG] org.apache.maven:maven-artifact:jar:2.2.1:compile
[DEBUG] org.codehaus.plexus:plexus-utils:jar:3.0.15:compile
[DEBUG] Created new class realm plugin>org.apache.maven.plugins:maven-deploy-plugin:2.8.2
[DEBUG] Importing foreign packages into class realm plugin>org.apache.maven.plugins:maven-deploy-plugin:2.8.2
[DEBUG] Imported: < maven.api
[DEBUG] Populating class realm plugin>org.apache.maven.plugins:maven-deploy-plugin:2.8.2
[DEBUG] Included: org.apache.maven.plugins:maven-deploy-plugin:jar:2.8.2
[DEBUG] Included: backport-util-concurrent:backport-util-concurrent:jar:3.1
[DEBUG] Included: org.codehaus.plexus:plexus-interpolation:jar:1.11
[DEBUG] Included: junit:junit:jar:3.8.1
[DEBUG] Included: org.codehaus.plexus:plexus-utils:jar:3.0.15
[DEBUG] Configuring mojo org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy from plugin realm ClassRealm[plugin>org.apache.maven.plugins:maven-deploy-plugin:2.8.2, parent: sun.misc.Launcher$AppClassLoader#55f96302]
[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy' with basic configurator -->
[DEBUG] (f) artifact = com.test:test-maven:pom:0.0.1-SNAPSHOT
[DEBUG] (f) attachedArtifacts = []
[DEBUG] (f) deployAtEnd = false
[DEBUG] (s) localRepository = id: local
url: file:///D:/M2/Repository/
layout: default
snapshots: [enabled => true, update => always]
releases: [enabled => true, update => always]
[DEBUG] (f) offline = false
[DEBUG] (f) packaging = pom
[DEBUG] (f) pomFile = D:\JavaPrj\sample\test-maven\pom.xml
[DEBUG] (f) project = MavenProject: com.test:test-maven:0.0.1-SNAPSHOT # D:\JavaPrj\sample\test-maven\pom.xml
[DEBUG] (f) reactorProjects = [MavenProject: com.test:test-maven:0.0.1-SNAPSHOT # D:\JavaPrj\sample\test-maven\pom.xml]
[DEBUG] (f) retryFailedDeploymentCount = 1
[DEBUG] (f) skip = false
[DEBUG] (f) updateReleaseInfo = false
[DEBUG] -- end configuration --
[DEBUG] Using transporter WagonTransporter with priority -1.0 for https://myhost/artifactory/libs-snapshot-local
[DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for https://myhost/artifactory/libs-snapshot-local with username=my-user, password=***
Downloading from snapshots: https://myhost/artifactory/libs-snapshot-local/com/test/test-maven/0.0.1-SNAPSHOT/maven-metadata.xml
Progress (1): maven-metadata.xml (605 B)
Downloaded from snapshots: https://myhost/artifactory/libs-snapshot-local/com/test/test-maven/0.0.1-SNAPSHOT/maven-metadata.xml (605 B at 961 B/s)
[DEBUG] Writing tracking file D:\M2\Repository\com\test\test-maven\0.0.1-SNAPSHOT\resolver-status.properties
Uploading to snapshots: https://myhost/artifactory/libs-snapshot-local/com/test/test-maven/0.0.1-SNAPSHOT/test-maven-0.0.1-20180213.092946-2.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.018 s
[INFO] Finished at: 2018-02-13T16:29:46+07:00
[INFO] Final Memory: 11M/162M
[INFO] ------------------------------------------------------------------------
EDIT 3
Add the Apache httpd access_log.
my-ip - - [13/Feb/2018:17:40:48 +0700] "GET /artifactory/libs-snapshot-local/com/test/test-maven/0.0.1-SNAPSHOT/maven-metadata.xml HTTP/1.1" 401 91
my-ip - - [13/Feb/2018:17:40:48 +0700] "GET /artifactory/libs-snapshot-local/com/test/test-maven/0.0.1-SNAPSHOT/maven-metadata.xml HTTP/1.1" 200 605
my-ip - - [13/Feb/2018:17:40:48 +0700] "GET /artifactory/libs-snapshot-local/com/test/test-maven/0.0.1-SNAPSHOT/maven-metadata.xml.sha1 HTTP/1.1" 200 40
my-ip - - [13/Feb/2018:17:40:48 +0700] "PUT /artifactory/libs-snapshot-local/com/test/test-maven/0.0.1-SNAPSHOT/test-maven-0.0.1-20180213.104048-2.pom HTTP/1.1" 417 364
EDIT 4
Regarding to the Configuring a Reverse Proxy, this generating is not available for the Artifactory OSS version.
Here is my Apache httpd setting.
<Location /artifactory/>
ProxyPass https://myhost:62443/artifactory/
ProxyPassReverse https://myhost/artifactory/
SetEnv force-proxy-request-1.0 1
SetEnv proxy-nokeepalive 1
</Location>
The artifactory/tomcat/conf/server.xml
<Server port="8015" shutdown="SHUTDOWN">
<Service name="Catalina">
<!--Connector port="8081" sendReasonPhrase="true"/-->
<!-- Define a SSL Coyote HTTP/1.1 Connector on port 8443 -->
<Connector
protocol="org.apache.coyote.http11.Http11NioProtocol"
port="62443" maxThreads="200" URIEncoding="UTF-8"
scheme="https" secure="true" SSLEnabled="true"
keystoreFile="/path/to/jks" keystorePass="some-password"
clientAuth="false" sslProtocol="TLS"/>
<!-- Must be at least the value of artifactory.access.client.max.connections -->
<Connector port="8040" sendReasonPhrase="true" maxThreads="50"/>
<!-- This is the optional AJP connector -->
<Connector port="8019" protocol="AJP/1.3" sendReasonPhrase="true"/>
<Engine name="Catalina" defaultHost="localhost">
<Host name="localhost" appBase="webapps" startStopThreads="2"/>
</Engine>
</Service>
</Server>
EDIT 5
I would like to highlight some significant as the following: -
By using the Maven 3.3.9 to deploy this project against the existing Artifactory with Apache httpd is worked properly. Please correct me if I'm wrong. I understand that there is no any issue about the configuration.
The only changing is the Maven 3.5.2.
I've no any clue why this issue occur.
EDIT 6
Since there is an exception about the wagon
Caused by: org.apache.maven.wagon.TransferFailedException:
Failed to transfer file: https://myhost/artifactory/libs-snapshot-local/com/test/test-maven/0.0.1-SNAPSHOT/test-maven-0.0.1-20180214.065633-7.pom. Return code is: 417, ReasonPhrase: Expectation Failed.
at org.apache.maven.wagon.shared.http.AbstractHttpClientWagon.put (AbstractHttpClientWagon.java:635)
at org.apache.maven.wagon.shared.http.AbstractHttpClientWagon.put (AbstractHttpClientWagon.java:557)
at org.apache.maven.wagon.shared.http.AbstractHttpClientWagon.put (AbstractHttpClientWagon.java:539)
at org.apache.maven.wagon.shared.http.AbstractHttpClientWagon.put (AbstractHttpClientWagon.java:533)
at org.apache.maven.wagon.shared.http.AbstractHttpClientWagon.put (AbstractHttpClientWagon.java:513)
I've compared the wagon from maven_home/lib between Maven 3.3.9 and 3.5.2, and found that the 3.3.9 use wagon version 2.10 and 3.5.2 use wagon 2.12.
Try 1
I copy the maven_home/lib from Maven 3.3.9 to Maven 3.5.2, the mvn clean deploy works properly.
Try 2
Copy maven_home/lib from Maven 3.5.2 to Maven 3.3.9, the same exception occurs.
Try 3
I'm updating the pom to use the latest wagon 3.0.0 as the following: -
<properties>
<my.wagon.vesion>3.0.0</my.wagon.vesion>
</properties>
<build>
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-file</artifactId>
<version>${my.wagon.vesion}</version>
</extension>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-http-shared</artifactId>
<version>${my.wagon.vesion}</version>
</extension>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-http</artifactId>
<version>${my.wagon.vesion}</version>
</extension>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-provider-api</artifactId>
<version>${my.wagon.vesion}</version>
</extension>
</extensions>
</build>
Luckily when I execute mvn clean deploy -e -X against the wagon 3.0.0 there is a HTTP header/request/response printing so that I've found the response as
[DEBUG] http-outgoing-0 << "<h1>Expectation Failed</h1>[\n]"
[DEBUG] http-outgoing-0 << "<p>The expectation given in the Expect request-header[\n]"
[DEBUG] http-outgoing-0 << "field could not be met by this server.[\n]"
[DEBUG] http-outgoing-0 << "The client sent<pre>[\n]"
[DEBUG] http-outgoing-0 << " Expect: 100-continue[\n]"
[DEBUG] http-outgoing-0 << "</pre>[\n]"
[DEBUG] http-outgoing-0 << "</p><p>Only the 100-continue expectation is supported.</p>[\n]"
[DEBUG] http-outgoing-0 << "</body></html>[\n]"
[DEBUG] http-outgoing-0 << HTTP/1.1 417 Expectation Failed
Then I google the term Only the 100-continue expectation is supported. and found some significant from StackOverflow: Apache and mod_proxy not handling HTTP 100-continue from client HTTP 417.
Try 4
I've set the httpd.conf as mentioning from the thread above.
<IfModule mod_headers.c>
RequestHeader unset Expect early
</IfModule>
At the moment I can execute the mvn clean deploy by using the Maven 3.5.2 properly.

Since the root cause is
[DEBUG] http-outgoing-0 << "<h1>Expectation Failed</h1>[\n]"
[DEBUG] http-outgoing-0 << "<p>The expectation given in the Expect request-header[\n]"
[DEBUG] http-outgoing-0 << "field could not be met by this server.[\n]"
[DEBUG] http-outgoing-0 << "The client sent<pre>[\n]"
[DEBUG] http-outgoing-0 << " Expect: 100-continue[\n]"
[DEBUG] http-outgoing-0 << "</pre>[\n]"
[DEBUG] http-outgoing-0 << "</p><p>Only the 100-continue expectation is supported.</p>[\n]"
[DEBUG] http-outgoing-0 << "</body></html>[\n]"
[DEBUG] http-outgoing-0 << HTTP/1.1 417 Expectation Failed
The StackOverflow answer advise to remove the Expect header by setting the Apache httpd.conf as
<IfModule mod_headers.c>
RequestHeader unset Expect early
</IfModule>
At the moment I can execute the mvn clean deploy by using the Maven 3.5.2 properly.

If you can not fix your current problem, you can try other deployment mechanisms like maven Artifactory plugin or deploying from CI. In one of Artifactory's blog posts it is advised to deploy from Jenkins(or other CI in non-cloud environments) to aquire cleaner pom.xml's.
https://www.jfrog.com/confluence/display/RTF/Maven+Artifactory+Plugin
https://jfrog.com/blog/dont-let-maven-deploy-plugin-trip-you/

Related

Not a valid command: idea-shell (similar: shell, oldshell)

I have trouble refreshing my SBT project in Intellij. And I am not the only one.
This is the sbt-console:
/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/bin/java -agentlib:jdwp=transport=dt_socket,address=localhost:51917,suspend=n,server=y -Xdebug -server -Xmx1028M -Dfile.encoding=UTF-8 -Didea.runid=2017.2 -Didea.managed=true -jar "/Users/pascal.mengelt/Library/Application Support/IntelliJIdea2018.1/Scala/launcher/sbt-launch.jar" idea-shell
Listening for transport dt_socket at address: 51917
[info] Loading settings from idea.sbt ...
[info] Loading global plugins from /Users/user/.sbt/1.0/plugins
[info] Loading settings from plugins.sbt ...
[info] Loading project definition from /Users/pascal.mengelt/GitHub/scala/scala-adapters-wizard/project
[info] Loading settings from build.sbt ...
[info] Set current project to wizardDemo (in build file:/Users/pascal.mengelt/GitHub/scala/scala-adapters-wizard/)
[error] Not a valid command: idea-shell (similar: shell, oldshell)
[error] Not a valid project ID: idea-shell
[error] Expected ':'
[error] Not a valid key: idea-shell (similar: daemonShell)
[error] idea-shell
[error] ^
[INFO] [04/13/2018 13:13:19.377] [Thread-2] [CoordinatedShutdown(akka://sbt-web)] Starting coordinated shutdown from JVM shutdown hook
I found the Intellij issue for that (with workaround):
SCL-12430 Not a valid key: idea-shell
Yes ,delete the ~/.sbt/{0.13|1.0}/plugins/target
Here the command provided by Mateusz Kubuszok:
rm -rf ~/.sbt/{0.13,1.0}/plugins/target

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.

Mongodb-Hadoop Adaptor

For getting started with the mongodb-hadoop adaptor i am referring to the manual
The current hadoop version running on my system is 0.20.2.
So i edited the build.sbt file to
hadoopRelease in ThisBuild := "0.20.2".
But when i try the next command of "sbt package", i get the following error.
[error] Hadoop Release '%s' is an invalid/unsupported release. Valid entries are in 0.20.2
[error] Use 'last' for the full log.
The full log is
[info] Loading project definition from E:\softwares\mine\mongo-hadoop\project
[debug] Running task... Cancelable: false, check cycles: false
[debug]
[debug] Initial source changes:
[debug] removed:Set()
[debug] added: Set()
[debug] modified: Set()
[debug] Removed products: Set()
[debug] Modified external sources: Set()
[debug] Modified binary dependencies: Set()
[debug] Initial directly invalidated sources: Set()
[debug]
[debug] Sources indirectly invalidated by:
[debug] product: Set()
[debug] binary dep: Set()
[debug] external source: Set()
[debug] Initially invalidated: Set()
[debug] Copy resource mappings:
[debug]
java.lang.RuntimeException: Hadoop Release '%s' is an invalid/unsupported release. Valid entries are in 0.20.2
at scala.sys.package$.error(package.scala:27)
at MongoHadoopBuild$$anonfun$streamingSettings$6$$anonfun$apply$8.apply(MongoHadoopBuild.scala:152)
at MongoHadoopBuild$$anonfun$streamingSettings$6$$anonfun$apply$8.apply(MongoHadoopBuild.scala:152)
at scala.collection.MapLike$class.getOrElse(MapLike.scala:122)
at scala.collection.immutable.HashMap.getOrElse(HashMap.scala:38)
at MongoHadoopBuild$$anonfun$streamingSettings$6.apply(MongoHadoopBuild.scala:152)
at MongoHadoopBuild$$anonfun$streamingSettings$6.apply(MongoHadoopBuild.scala:151)
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:49)
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:49)
at sbt.EvaluateSettings$$anonfun$sbt$EvaluateSettings$$single$1.apply(INode.scala:159)
at sbt.EvaluateSettings$$anonfun$sbt$EvaluateSettings$$single$1.apply(INode.scala:159)
at sbt.EvaluateSettings$MixedNode.evaluate0(INode.scala:177)
at sbt.EvaluateSettings$INode.evaluate(INode.scala:132)
at sbt.EvaluateSettings$$anonfun$sbt$EvaluateSettings$$submitEvaluate$1.apply$mcV$sp(INode.scala:64)
at sbt.EvaluateSettings.sbt$EvaluateSettings$$run0(INode.scala:73)
at sbt.EvaluateSettings$$anon$3.run(INode.scala:69)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
[error] Hadoop Release '%s' is an invalid/unsupported release. Valid entries are in 0.20.2
Try to replace
hadoopRelease in ThisBuild := "0.20.2".
with
hadoopRelease in ThisBuild := "0.20".
For me it worked when I made 1.0.4 to 1.0.
Though I have to admit I did not check if the resutling jar worked.
EDIT: Jar did not work. Complained of some missing classes.

maven-glassfish-plugin tries to start the domain when it is already started

I have just started using maven-glassfish-plugin. I got the start-domain goal working. However when I try to execute the deploy goal, the plugin thinks that the domain is not started and tries to restart it - this obviously fails. See log below:
> mvn glassfish:start-domain
[INFO] --- maven-glassfish-plugin:2.1:start-domain (default-cli) # arquillian-sample ---
[INFO] Deprecated syntax, instead use:
[INFO] asadmin --passwordfile C:\apps\glassfish-3.0.1\glassfish/domains/domain1/config/domain-passwords --interactive=false --user admin --echo --terse=false start-domain [options] ...
[INFO] asadmin --host localhost --port 4848 --user admin --passwordfile C:\apps\glassfish-3.0.1\glassfish/domains/domain1/config/domain-passwords --interactive=false --echo=true --terse=false start-domain --debug=true --domaindir C:\apps\glassfish-3.0.1\glassfish\domains --help=false --upgrade=false --verbose=false domain1
[INFO] Waiting for DAS to start ...
[INFO] Started domain: domain1
[INFO] Domain location: C:\apps\glassfish-3.0.1\glassfish\domains\domain1
[INFO] Log file: C:\apps\glassfish-3.0.1\glassfish\domains\domain1\logs\server.log
[INFO] Admin port for the domain: 4848
[INFO] Debug port for the domain: 9009
[INFO] Command start-domain executed successfully.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
> mvn glassfish:deploy
[INFO] --- maven-glassfish-plugin:2.1:deploy (default-cli) # arquillian-sample ---
[INFO] Domain domain1 isn't started. Starting it for you.
[INFO] Deprecated syntax, instead use:
[INFO] asadmin --passwordfile C:\apps\glassfish-3.0.1\glassfish/domains/domain1/config/domain-passwords --interactive=false --user admin --echo --terse=false start-domain [options] ...
[INFO] asadmin --host localhost --port 4848 --user admin --passwordfile C:\apps\glassfish-3.0.1\glassfish/domains/domain1/config/domain-passwords --interactive=false --echo=true --terse=false start-domain --debug=true --domaindir C:\apps\glassfish-3.0.1\glassfish\domains --help=false --upgrade=false --verbose=false domain1
[INFO] There is a process already using the admin port 4848 -- it probably is another instance of a GlassFish server.
[INFO] Command start-domain failed.
[ERROR] Unable to start domain "domain1".
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
Why can't the plugin detect that the domain has already started?
Why am I getting all the "Deprecated syntax" warnings?
To workaround issue #1, I simply tried to issue the deploy goal when the server is not running. This time the deploy goal successfully started the server, but the deployment failed with the message "CLI136 Port 0 should be a numeric value". See below:
> mvn glassfish:deploy
[INFO] --- maven-glassfish-plugin:2.1:deploy (default-cli) # arquillian-sample ---
[INFO] Domain domain1 isn't started. Starting it for you.
[INFO] Deprecated syntax, instead use:
[INFO] asadmin --passwordfile C:\apps\glassfish-3.0.1\glassfish/domains/domain1/config/domain-passwords --interactive=false --user admin --echo --terse=false start-domain [options] ...
[INFO] asadmin --host localhost --port 4848 --user admin --passwordfile C:\apps\glassfish-3.0.1\glassfish/domains/domain1/config/domain-passwords --interactive=false --echo=true --terse=false start-domain --debug=true --domaindir C:\apps\glassfish-3.0.1\glassfish\domains --help=false --upgrade=false --verbose=false domain1
[INFO] Waiting for DAS to start ...
[INFO] Started domain: domain1
[INFO] Domain location: C:\apps\glassfish-3.0.1\glassfish\domains\domain1
[INFO] Log file: C:\apps\glassfish-3.0.1\glassfish\domains\domain1\logs\server.log
[INFO] Admin port for the domain: 4848
[INFO] Debug port for the domain: 9009
[INFO] Command start-domain executed successfully.
[INFO] Command deploy failed.
[ERROR] CLI136 Port 0 should be a numeric value.
[ERROR] Deployment of S:\Projects\archfirstunf\java\trunk\examples\arquillian-sample\target\arquillian-sample.war failed.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
What am I doing wrong?
Here's my plugin configuration:
<plugin>
<groupId>org.glassfish.maven.plugin</groupId>
<artifactId>maven-glassfish-plugin</artifactId>
<version>2.1</version>
<configuration>
<glassfishDirectory>${glassfish.directory}</glassfishDirectory>
<user>admin</user>
<passwordFile>${glassfish.directory}/domains/domain1/config/domain-passwords</passwordFile>
<domain>
<name>domain1</name>
</domain>
<components>
<component>
<name>${project.artifactId}</name>
<artifact>target/${project.build.finalName}.war</artifact>
</component>
</components>
<debug>true</debug>
<terse>false</terse>
<echo>true</echo>
</configuration>
</plugin>
I'm using the following configuration (note the httpPort and adminPort in the domain element):
<plugin>
<groupId>org.glassfish.maven.plugin</groupId>
<artifactId>maven-glassfish-plugin</artifactId>
<version>2.1</version>
<configuration>
<glassfishDirectory>${glassfish.directory}</glassfishDirectory>
<user>admin</user>
<passwordFile>${glassfish.directory}/domains/domain1/config/domain-passwords</passwordFile>
<domain>
<name>domain1</name>
<httpPort>8080</httpPort>
<adminPort>4848</adminPort>
</domain>
<components>
<component>
<name>${project.artifactId}</name>
<artifact>target/${project.build.finalName}.war</artifact>
</component>
</components>
<debug>true</debug>
<terse>false</terse>
<echo>true</echo>
</configuration>
</plugin>
Without them, things weren't working as expected (although they are supposed to be optional). But starting, deploying (with or without the server started), etc just works fine for me.
PS: I don't remember if this is important but I'm using version 2.2-SNAPSHOT Of the plugin.
Update: Here is the exact configuration I use:
<plugin>
<groupId>org.glassfish.maven.plugin</groupId>
<artifactId>maven-glassfish-plugin</artifactId>
<version>2.2-SNAPSHOT</version>
<configuration>
<glassfishDirectory>${glassfish.home}</glassfishDirectory>
<user>${domain.username}</user>
<passwordFile>${glassfish.home}/domains/${project.artifactId}/master-password</passwordFile>
<autoCreate>true</autoCreate>
<debug>true</debug>
<echo>true</echo>
<skip>${test.int.skip}</skip>
<domain>
<name>${project.artifactId}</name>
<httpPort>8080</httpPort>
<adminPort>4848</adminPort> <!-- [ERROR] CLI136 Port 0 should be a numeric value. -->
</domain>
<components>
<component>
<name>${project.artifactId}</name>
<!--artifact>${project.build.directory}/${project.build.finalName}.war</artifact-->
<artifact>${project.build.directory}/${project.build.finalName}</artifact>
</component>
</components>
</configuration>
</plugin>
And here is the output I get:
$ mvn glassfish:deploy
[INFO] Scanning for projects...
...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building maven-glassfish-testcase Maven Webapp 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-glassfish-plugin:2.2-SNAPSHOT:deploy (default-cli) # maven-glassfish-testcase ---
...
[INFO] asadmin --host localhost --port 4848 --user admin --passwordfile /home/pascal/opt/glassfishv3/glassfish/domains/maven-glassfish-testcase/master-password --interactive=false --echo=true --terse=true deploy --name maven-glassfish-testcase --force=false --precompilejsp=false --verify=false --enabled=true --generatermistubs=false --availabilityenabled=false --keepreposdir=false --keepfailedstubs=false --logReportedErrors=true --upload=false --help=false /home/pascal/Projects/stackoverflow/maven-glassfish-testcase/target/maven-glassfish-testcase
[INFO] Application deployed successfully with name maven-glassfish-testcase.
[INFO]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
...
Note that I don't get any weird "deprecated" message. And things just work fine.
Adding httpPort and adminPort adds a new complication - now authentication is failing when I do the deploy (even though the same authentication is passing for the start-domain goal).
> mvn glassfish:start-domain
[INFO] --- maven-glassfish-plugin:2.2-SNAPSHOT:start-domain (default-cli) # arquillian-sample ---
[INFO] Deprecated syntax, instead use:
[INFO] asadmin --passwordfile C:\apps\glassfish-3.0.1\glassfish/domains/domain1/config/domain-passwords --interactive=false --user admin --echo --terse=false start-domain [options] ...
[INFO] asadmin --host localhost --port 4848 --user admin --passwordfile C:\apps\glassfish-3.0.1\glassfish/domains/domain1/config/domain-passwords --interactive=false --echo=true --terse=false start-domain --debug=true --domaindir C:\apps\glassfish-3.0.1\glassfish\domains --help=false --upgrade=false --verbose=false domain1
[INFO] Waiting for DAS to start ...........
[INFO] Started domain: domain1
[INFO] Domain location: C:\apps\glassfish-3.0.1\glassfish\domains\domain1
[INFO] Log file: C:\apps\glassfish-3.0.1\glassfish\domains\domain1\logs\server.log
[INFO] Admin port for the domain: 4848
[INFO] Debug port for the domain: 9009
[INFO] Command start-domain executed successfully.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
> mvn glassfish:deploy
[INFO] --- maven-glassfish-plugin:2.2-SNAPSHOT:deploy (default-cli) # arquillian-sample ---
[INFO] Deprecated syntax, instead use:
[INFO] asadmin --port 4848 --host localhost --passwordfile C:\apps\glassfish-3.0.1\glassfish/domains/domain1/config/domain-passwords --interactive=false --user admin --echo --terse=false deploy [options] ...
[INFO] Command deploy failed.
[ERROR] Authentication failed for user: admin
[ERROR] (Usually, this means invalid user name and/or password)
[ERROR] Deployment of S:\Projects\archfirstunf\java\trunk\examples\arquillian-sample\target\arquillian-sample.war failed.
[ERROR] For more detail on what might be causing the problem try running maven with the --debug option
[ERROR] or setting the maven-glassfish-plugin "echo" property to "true".
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.973s
[INFO] Finished at: Wed Nov 10 01:51:04 EST 2010
[INFO] Final Memory: 10M/183M
[INFO] ------------------------------------------------------------------------
Changing version to 2.2-SNAPSHOT makes no difference. BTW the snapshot is not available in the java.net repository - I had to go here to get it:
<pluginRepository>
<id>ocean</id>
<url>http://maven.ocean.net.au/snapshot</url>
<releases>
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</pluginRepository>

How to get maven gwt 2.0 build working

EDIT: Added some of the output of the mvn -X -e commands at the end
My company is developing a GWT application. We've been using maven 2 and GWT 1.7 successfully for quite a while. We recently decided to upgrade to GWT 2.0. We've already updated the eclipse project and we are able to successfully run the application in dev-mode.
We are struggling to get the application built using maven though. I'm hoping somebody can tell me what I'm doing wrong here since I'm running out of time on this.
The exacty bit of the output that worries me is the 'GWT compilation skipped' message:
[INFO] Copying 119 resources
[INFO] [compiler:compile {execution: default-compile}]
[INFO] Compiling 704 source files to K:\iCura\assessor\target\classes
[INFO] [gwt:compile {execution: default}]
[INFO] using GWT jars for specified version 2.0.0
[INFO] establishing classpath list (scope = compile)
[INFO] com.curasoftware.assessor.Assessor is up to date. GWT compilation skipped
[INFO] [jspc:compile {execution: jspc}]
[INFO] Built File: \index.jsp
I'm pasting the gwt-maven-plugin section below. If you need anything else please ask.
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>1.2</version>
<configuration>
<localWorkers>1</localWorkers>
<warSourceDirectory>${basedir}/war</warSourceDirectory>
<logLevel>ALL</logLevel>
<module>${cura.assessor.module}</module>
<!-- use style OBF for prod -->
<style>OBFUSCATED</style>
<extraJvmArgs>-Xmx2048m -Xss1024k</extraJvmArgs>
<gwtVersion>${version.gwt}</gwtVersion>
<disableCastChecking>true</disableCastChecking>
<soyc>false</soyc>
</configuration>
<executions>
<execution>
<goals>
<!-- plugin goals -->
<goal>clean</goal>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
I executed mvn clean install -X -e and this is some of the output that I get:
[DEBUG] Configuring mojo 'org.codehaus.mojo:gwt-maven-plugin:1.2:compile' -->
[DEBUG] (f) disableCastChecking = true
[DEBUG] (f) disableClassMetadata = false
[DEBUG] (f) draftCompile = false
[DEBUG] (f) enableAssertions = false
[DEBUG] (f) extra = K:\iCura\assessor\target\extra
[DEBUG] (f) extraJvmArgs = -Xmx2048m -Xss1024k
[DEBUG] (f) force = false
[DEBUG] (f) gen = K:\iCura\assessor\target\.generated
[DEBUG] (f) generateDirectory = K:\iCura\assessor\target\generated-sources\gwt
[DEBUG] (f) gwtVersion = 2.0.0
[DEBUG] (f) inplace = false
[DEBUG] (f) localRepository = Repository[local|file://K:/iCura/lib]
[DEBUG] (f) localWorkers = 1
[DEBUG] (f) logLevel = ALL
[DEBUG] (f) module = com.curasoftware.assessor.Assessor
[DEBUG] (f) project = MavenProject: com.curasoftware.assessor:assessor:3.5.0.0 # K:\iCura\assessor\pom.xml
[DEBUG] (f) remoteRepositories = [Repository[gwt-maven|http://gwt-maven.googlecode.com/svn/trunk/mavenrepo/], Repository[main-maven|http://www.ibiblio.org/maven2/], Repository[central|http://repo1.maven.org/maven2]]
[DEBUG] (f) skip = false
[DEBUG] (f) sourceDirectory = K:\iCura\assessor\src
[DEBUG] (f) soyc = false
[DEBUG] (f) style = OBFUSCATED
[DEBUG] (f) treeLogger = false
[DEBUG] (f) validateOnly = false
[DEBUG] (f) warSourceDirectory = K:\iCura\assessor\war
[DEBUG] (f) webappDirectory = K:\iCura\assessor\target\assessor
[DEBUG] -- end configuration --
and then this:
[DEBUG] SOYC has been disabled by user
[DEBUG] GWT module com.curasoftware.assessor.Assessor found in K:\iCura\assessor\src
[INFO] com.curasoftware.assessor.Assessor is up to date. GWT compilation skipped
[DEBUG] com.curasoftware.assessor:assessor:war:3.5.0.0 (selected for null)
[DEBUG] com.curasoftware.dto:dto-gen:jar:3.5.0.0:compile (selected for compile)
...
It's finding the correct sourceDirectory. That folders has a 'com' folder within which ultimately is the source of the application organized in folders as per the package structure.
As stated by Geoffrey Wiseman, you may be running into jira.codehaus.org/browse/MGWT-151, which happens when the module you're building doesn't have an entry point (presumably because you're inheriting from a module that does). While the issue says that it's fixed in 2.1.0, you can actually use the 1.3-SNAPSHOT version of the gwt-maven-plugin and it will work fine.
Try removing the declaration, as per the compile example in the plugin documentation
You can also ignore the ''module'' parameter, so that the plugin will scan your project for gwt.xml module files.