Why does console keeps saying "uber-jar-6.5.5 seems corrupted" - aem

I was installing my project from IntelliJ to aem using this command (mvn clean install -PautoInstall) and I keep having this error
The JAR/ZIP file (C:\Users....m2\repository\com\adobe\aem\uber-jar\6.5.5\uber-jar-6.5.5.jar) seems corrupted, error: error in opening zip file
I have already tried deleting and downloading the uber-jar but to no avail.
Here is my Core Pom.xml
4.0.0
com.startsite
startsite
1.0-SNAPSHOT
../pom.xml
<artifactId>startsite.core</artifactId>
<packaging>bundle</packaging>
<name>Start Site - Core</name>
<description>Core bundle for Start Site</description>
<build>
<plugins>
<plugin>
<groupId>org.apache.sling</groupId>
<artifactId>maven-sling-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<executions>
<execution>
<id>bundle-manifest</id>
<phase>process-classes</phase>
<goals>
<goal>manifest</goal>
</goals>
</execution>
</executions>
<configuration>
<instructions>
<!-- Import any version of javax.inject, to allow running on multiple versions of AEM -->
<Import-Package>javax.inject;version=0.0.0,*</Import-Package>
<Sling-Model-Packages>
com.startsite.core
</Sling-Model-Packages>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<!-- OSGi Dependencies -->
<dependency>
<groupId>org.osgi</groupId>
<artifactId>osgi.core</artifactId>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>osgi.cmpn</artifactId>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>osgi.annotation</artifactId>
</dependency>
<!-- Other Dependencies -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>javax.jcr</groupId>
<artifactId>jcr</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</dependency>
<dependency>
<groupId>com.adobe.aem</groupId>
<artifactId>uber-jar</artifactId>
<classifier>apis</classifier>
</dependency>
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.models.api</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
</dependency>
<dependency>
<groupId>junit-addons</groupId>
<artifactId>junit-addons</artifactId>
</dependency>
<dependency>
<groupId>com.adobe.aem</groupId>
<artifactId>uber-jar</artifactId>
<version>6.5.5</version>
</dependency>
<dependency>
<groupId>com.day.commons</groupId>
<artifactId>day.commons.datasource.poolservice</artifactId>
<version>1.0.10</version>
</dependency>
</dependencies>

Try deleting your local ~/.m2 repository and try again.

Why does console keeps saying "uber-jar-6.5.5 seems corrupted"
It will be saying that because the file is corrupt ... or not a JAR file at all.
Take a look at what is actually in the (supposed) JAR file:
Use jar -tvf <pathname> to list the index. That should tell you if the file is corrupt, etcetera.
On linux, use file <pathname> to try to determine what file type it really is.
If it is text, look at it using a text editor.
(My guess is that the file is not downloading properly. My second guess is that what you actually have there is an HTML document containing an error message from the failed download. If this is the case, there should be some clues in the error message as to why the download is failing.)

Take a look at the pom. I see the uber-jar declared twice, remove the first and keep only the one with the version on it. Also, the uber-jar should have the scope as provided:
<dependency>
<groupId>com.adobe.aem</groupId>
<artifactId>uber-jar</artifactId>
<version>6.5.8</version>
<scope>provided</scope>
</dependency>
Then, delete the uber-jar from your m2 folder and execute mvn -U clean install -PautoInstall

I found an alternate solution to solve this problem. I used Eclipse neon instead of the usual eclipse and intellij. Newly created project now works except the one that I have previously compiled on Intellij and eclipse.

Related

Liquibase maven plugin with JDK11 failing with ClassNotFoundException: XmlElement

I'm using
Apache Maven 3.3.9
Java version: 11.0.5
And the latest version of liquibase-maven-plugin as follows:
<plugin>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-maven-plugin</artifactId>
<configuration>
<changeLogFile>src\main\resources\changelog.yaml</changeLogFile>
<driver>oracle.jdbc.OracleDriver</driver>
<url>thin_url</url>
<username>user</username>
<password>password</password>
</configuration>
</plugin>
I've added in my poml.xml the following dependencies
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
<version>2.3.0.1</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.3.1</version>
</dependency>
but each time execute the plugin with mvn liquibase:update I've got an Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlElement exception.
Any clue what I'm doing wrong?
I was adding the dependencies in the wrong place. I was adding them as 'regular' dependencies in the pom. I didn't know that I had to add them in the plugin as follows:
<plugin>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-maven-plugin</artifactId>
<version>${liquibase.version}</version>
<configuration>
<changeLogFile>resources\changelog2.yml</changeLogFile>
<driver>oracle.jdbc.OracleDriver</driver>
<url>url</url>
<username>user</username>
<password>password</password>
<verbose>true</verbose>
</configuration>
<dependencies>
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>2.3.2</version>
</dependency>
</dependencies>
</plugin>
Java 9 (and above) removed some classes that used to be part of the standard Java runtime.
See this question and answer for more details:
How to resolve java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException in Java 9

Failed to execute goal com.google.appengine:appengine-maven-plugin:1.9.67:devserver

Hey i have a problem starting my maven project on devserver and update calls.
I buils my maven project to run with google cloud engine, but im getting this issue and cant start my server.
This is my pom.xml :
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<groupId>trainingBuddyServer</groupId>
<artifactId>Training-Buddy-Server</artifactId>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.showDeprecation>true</maven.compiler.showDeprecation>
<archiveClasses>true</archiveClasses>
</properties>
<prerequisites>
<maven>3.5</maven>
</prerequisites>
<dependencies>
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-api-1.0-sdk</artifactId>
<version>1.9.67</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<type>jar</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>22.0</version>
</dependency>
<dependency>
<groupId>com.googlecode.objectify</groupId>
<artifactId>objectify</artifactId>
<version>5.1.17</version>
</dependency>
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-api-1.0-sdk</artifactId>
<version>1.9.67</version>
</dependency>
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-endpoints</artifactId>
<version>1.9.67</version>
</dependency>
<dependency>
<groupId>com.google.endpoints</groupId>
<artifactId>endpoints-framework</artifactId>
<version>2.0.7</version>
</dependency>
<dependency>
<groupId>com.google.endpoints</groupId>
<artifactId>endpoints-management-control-appengine</artifactId>
<version>1.0.3</version>
</dependency>
<dependency>
<groupId>com.google.endpoints</groupId>
<artifactId>endpoints-framework-auth</artifactId>
<version>1.0.3</version>
</dependency>
<!-- Test Dependencies -->
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-testing</artifactId>
<version>1.9.67</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-api-stubs</artifactId>
<version>1.9.67</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-tools-sdk</artifactId>
<version>1.9.67</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.truth</groupId>
<artifactId>truth</artifactId>
<version>0.33</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.10.19</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<!-- for hot reload of the web application-->
<outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes</outputDirectory>
<plugins>
<plugin>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>1.9.67</version>
<configuration>
<appId>trainingbuddy-221215</appId> <!-- Override appengine-web.xml <project> -->
<version>1</version>
<fullScanSeconds>1</fullScanSeconds>
<retainUploadDir>true</retainUploadDir>
</configuration>
</plugin>
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>1.3.1</version>
<configuration>
<deploy.promote>true</deploy.promote>
<deploy.stopPreviousVersion>true</deploy.stopPreviousVersion>
</configuration>
</plugin>
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.4.1</version>
<executions>
<execution>
<id>enforce-maven</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireMavenVersion>
<version>3.5</version>
</requireMavenVersion>
<requirePluginVersions>
<message>Best Practice is to always define plugin versions!</message>
<banLatest>true</banLatest>
<banRelease>true</banRelease>
<phases>clean,deploy,verify,appengine:run,appengine:deploy,appengine:update,appengine:devappaserver,site</phases>
</requirePluginVersions>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
I think its something wrong with pom file, because error says that it cant find this element "com.google.appengine:appengine-maven-plugin:1.9.67:devserver". So this is teh error if it will help :
[INFO] --- appengine-maven-plugin:1.9.67:devserver (default-cli) # Training-Buddy-Server ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.212 s
[INFO] Finished at: 2018-11-01T23:37:27+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.google.appengine:appengine-maven-plugin:1.9.67:devserver (default-cli) on project Training-Buddy-Server: The parameters 'project' for goal com.google.appengine:appengine-maven-plugin:1.9.67:devserver are missing or invalid -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginParameterException
Maybe someone know how to fix this?
Adding the
<project>YOUR PROJECT ID</project>
Indeed solves it for me also, however I'm not using the newer gclod maven plugin but the older appengine one:
<groupId>com.google.cloud.tools</groupId>
<artifactId>appengine-maven-plugin</artifactId>
vs mine
<groupId>com.google.appengine</groupId>
<artifactId>appengine-maven-plugin</artifactId>
At some point I should probably move on to the gcloud plugin but right now I haven't got time.
The old appengine plugin also works with the (undocumented) "project" configuration tag. Really confusing and also poor work by google since their getting (started examples) doesn't work, from 1.9.67 and above. Also if it's required from now on we should have gotten some information about it.
For the record I'm posting my multi module/services parent pom snippet including the pluginmanagement with the old appengine plugin:
<pluginManagement>
<plugins>
<plugin>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>${appengine.target.version}</version>
<configuration>
<project>YOUR PROJECT ID</project> <!-- WHAT DO WE NEED THIS FOR-->
<jvmFlags>
<jvmFlag>-Ddatastore.backing_store=${project.basedir}/local_db.bin</jvmFlag>
</jvmFlags>
<fullScanSeconds>-1</fullScanSeconds>
</configuration>
</plugin>
</plugins>
</pluginManagement>
Did you manage to solve this? I've been using my multi module project pom(s) for at least 3 years with no problems, however since 1.9.67 I'm no longer able to deploy or running devserver via appengine maven plugin, with the same error:
The parameters 'project' for goal com.google.appengine:appengine-maven-plugin:1.9.67:devserver are missing or invalid
Using 1.9.65 works for me, so as a short time solution you should be able to use that version instead, however I don't know how old versions your allowed to deploy.
I had the same issue with latest AppEngine. It worked fine with lower than 1.9.64, but it generated the same error with the later version. Today I solved that issue by adding filed on the pom.xml as
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>1.3.1</version>
<configuration>
<project>your project ID on Google Cloud </project>
<deploy.promote>true</deploy.promote>
<deploy.stopPreviousVersion>true</deploy.stopPreviousVersion>
</configuration>
</plugin>
This is a problem since 1.9.66:
The parameters 'project' for goal
com.google.appengine:appengine-maven-plugin:1.9.66:... are missing or
invalid

spring-boot-maven-plugin include other projects from workspace

I have a spring STS project which depends on two other projects in the same workspace. I have included them in my pom.xml but when I build jar they are excluded from the generated jar.Could you please let me know how to include these two dependent projects in the build.
I have below entries in pom.xml
<dependencies>
<dependency>
<groupId>org.acord.standards.life</groupId>
<artifactId>txlife</artifactId>
<version>2.37.00</version>
</dependency>
<dependency>
<groupId>com.xxx.service.query</groupId>
<artifactId>queryutil</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.acord.standards.life</groupId>
<artifactId>txlife</artifactId>
<version>2.37.00</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.xxx.service.query</groupId>
<artifactId>queryutil</artifactId>
<version>1.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
<configuration>
<attach>true</attach>
<!-- <includes>
<include>
<groupId>org.acord.standards.life</groupId>
<artifactId>txlife</artifactId>
<version>2.37.00</version>
<classifier>2.37.00</classifier>
</include>
<include>
<groupId>com.xxx.service.query</groupId>
<artifactId>queryutil</artifactId>
<version>1.0</version>
<classifier>1.0</classifier>
</include>
</includes> -->
</configuration>
</plugin>
</plugins>
</build>
I solve this problem following this documentation from Spring.io.
An alternative approach is you run Maven Install for each dependency project and, after it, set them in your pom.xml (in your main project). For example, I have a main spring project called Alna Rest that depends of others particular spring projects how Alna Data and Alna Service, then, in my Alna Rest project my pom.xml has this:
<dependency>
<groupId>com.alna.data</groupId>
<artifactId>alna-data</artifactId>
<version>0.0.1</version>
</dependency>
<dependency>
<groupId>com.alna.service</groupId>
<artifactId>alna-service</artifactId>
<version>0.0.1</version>
</dependency>
After it I can run Maven Install in my Alna Rest project that the Spring Boot Maven Plugin build an executable jar with all projects dependencies.
Well, this works for me. But I don't know if it is the better approach for build a project that requires many othes spring boot projects. Then I recommend you search more about this.

Groovy Eclipse compiler plugin for maven not compiling anything

I'm trying to understand the correct setup of a Java and Groovy project in Maven, compiling the source files with groovy-eclipse-compiler.
According to the plugin site, if you have files in src/main/java and src/test/java the compiler should find both Java and Groovy by default.
Setting up the build like the example makes target/classes empty.
<build>
...
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<compilerId>groovy-eclipse-compiler</compilerId>
<!-- set verbose to be true if you want lots of uninteresting messages -->
<!-- <verbose>true</verbose> -->
</configuration>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-compiler</artifactId>
<version>2.7.0-01</version>
</dependency>
</dependencies>
</plugin>
...
</plugins>
</build>
The only way I found to make it work was to use the build-helper-maven-plugin. This is the option used by the Archetype too:
mvn archetype:generate \
-DarchetypeGroupId=org.codehaus.groovy \
-DarchetypeArtifactId=groovy-eclipse-quickstart \
-DarchetypeVersion=2.5.2-SNAPSHOT \
-DgroupId=foo \
-DartifactId=bar \
-Dversion=1 \
-DinteractiveMode=false \
-DarchetypeRepository=https://nexus.codehaus.org/content/repositories/snapshots/
So, it's the page outdated? Isn't enough have Java files in the src folder?
I'm able to get this to work. Here is what I did:
create the archetype as you did above.
edit the pom.xml to the file below
mv everything from src/main/groovy to src/main/java and the same for the tests.
remove the empty groovy dirs
rename all *.java files to *.groovy
mvn clean compile
I get some expected compile errors due to differences in Java vs groovy syntax, but all groovy files are recognized.
Does this work for you? If not what is different?
Here is the pom file I am using:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>foo</groupId>
<artifactId>bar</artifactId>
<version>1</version>
<name>bar Groovy Eclipse Maven Java App</name>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<compilerId>groovy-eclipse-compiler</compilerId>
</configuration>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-compiler</artifactId>
<version>2.7.0-01</version>
<exclusions>
<exclusion>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-batch</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-batch</artifactId>
<version>2.1.1-01</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>2.1.1</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
EDIT
Since I misunderstood the actual question, and you do want to keep the files separate, then there are 2 options:
using the build-helper-plugin as you have done
Use the groovy-eclipse-compiler mojo:
<plugin>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-compiler</artifactId>
<version>2.7.0-01</version>
<extensions>true</extensions>
</plugin>
</build>
This is all described on the groovy-eclipse-compiler page.

"Couldn't contact the RemoteTestNG client" error when trying to run tests

Issue
Working with TestNG on a maven managed project, i can't seem to run tests via the TestNG eclipse plugin. When trying to run tests, the following error message pops up (inside a dialog window):
Couldn't contact the RemoteTestNG client. Make sure you don't have an
older version of testng.jar on your class path.
Reason:
Timeout while trying to contact RemoteTestNG.
How to resolve this?
Things I have tried
(After asking all my peers at the office QA department on this, and looking up information via the common search engines and on TestNG forums)
Making sure I don't have an older version on my class path (naturally).
Eliminating possible collisions between maven imported jars and jars used by the TestNG eclipse plugin (both are of version 6.7, and the project's pom.xml confirmed to use only its own dependent jar).
Performing maven update and build after said changes.
Running on a different JRE (specifically 1.7.0).
Relevant information
Environment:
OS: Win XP pro SP3
JRE: 1.6.0 update 31
TestNG: 6.7
Maven: 3.0.3
IDE: Eclipse Juno Java EE SR1
pom.xml content:
<?xml version="1.0" encoding="UTF-8" ?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>SGTest</artifactId>
<name>SGTest</name>
<description>Service Grid Test project for XAP</description>
<parent>
<groupId>com.my_product.quality.sgtest</groupId>
<artifactId>SGTest-parent</artifactId>
<version>3.0.0</version>
<relativePath>http://mvn-srv:8081/artifactory/libs-snapshot-local/com/my_product/quality/sgtest/SGTest-parent/3.0.0/SGTest-parent-3.0.0.pom</relativePath>
</parent>
<properties>
<xap.home>${env.XAP_LATEST}</xap.home>
</properties>
<dependencies>
<dependency>
<groupId>com.my_product</groupId>
<artifactId>my_opensource_product</artifactId>
<version>${gsVersion}</version>
<scope>system</scope>
<systemPath>${xap.home}/lib/required/my_opensource_product.jar</systemPath>
</dependency>
<dependency>
<groupId>com.my_product</groupId>
<artifactId>gs-runtime</artifactId>
<version>${gsVersion}</version>
<scope>system</scope>
<systemPath>${xap.home}/lib/required/gs-runtime.jar</systemPath>
</dependency>
<dependency>
<groupId>com.my_product.quality</groupId>
<artifactId>DashboardReporter</artifactId>
<version>0.0.1</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>apps</artifactId>
<version>${project.version}</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>com.my_product.quality</groupId>
<artifactId>webuitf</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.my_product.quality</groupId>
<artifactId>wanem</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.my_opensource_product.xenserver</groupId>
<artifactId>xenserver-machine-provisioning</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>org.swift.common</groupId>
<artifactId>confluence-soap</artifactId>
<version>0.5</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.7</version>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant-jsch</artifactId>
<version>1.8.3</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
</dependency>
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
<version>1.4.2</version>
</dependency>
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4.5</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>1.8.6</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-vfs2</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>org.hyperic</groupId>
<artifactId>sigar</artifactId>
<version>1.6.5</version>
<scope>system</scope>
<systemPath>${xap.home}/lib/platform/sigar/sigar.jar</systemPath>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jms</artifactId>
<version>3.1.1.RELEASE</version>
</dependency>
<dependency>
<groupId>hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>1.8.0.10</version>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<version>1.3</version>
</dependency>
</dependencies>
<build>
<testSourceDirectory>src/main/java</testSourceDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12.4</version>
<configuration>
<classpathDependencyExcludes>
<classpathDependencyExcludes>com.my_product.quality.sgtest.apps.security:processor</classpathDependencyExcludes>
<classpathDependencyExcludes>com.my_product.quality.sgtest.apps.archives:customSecurityProcessor</classpathDependencyExcludes>
<classpathDependencyScopeExclude>runtime</classpathDependencyScopeExclude>
</classpathDependencyExcludes>
<argLine>-Xmx2048m -XX:MaxPermSize=512m</argLine>
<includes>
<include>${includes}</include>
</includes>
<excludes>
<exclude>${excludes}</exclude>
</excludes>
<disableXmlReport>true</disableXmlReport>
<reportsDirectory>${sgtest.summary.dir}</reportsDirectory>
<reportFormat>xml</reportFormat>
<properties>
<property>
<name>configfailurepolicy</name>
<value>continue</value>
</property>
<property>
<name>suitename</name>
<value>${sgtest.suiteName}${sgtest.suiteId}</value>
</property>
<property>
<name>testname</name>
<value>${sgtest.suiteName}${sgtest.suiteId}</value>
</property>
<property>
<name>outputDir</name>
<value>${sgtest.summary.dir}</value>
</property>
<property>
<name>listener</name>
<value>framework.testng.SGTestNGListener,framework.testng.SGTestNgSuiteSplitter,framework.testng.report.TestNgReporterImpl</value>
</property>
</properties>
<systemProperties>
<sgtest.suiteId>${sgtest.suiteId}</sgtest.suiteId>
<sgtest.numOfSuites>${sgtest.numOfSuites}</sgtest.numOfSuites>
<selenium.browser>${selenium.browser}</selenium.browser>
<org.apache.commons.logging.Log>org.apache.commons.logging.impl.Jdk14Logger</org.apache.commons.logging.Log>
<com.gs.logging.level.config>true</com.gs.logging.level.config>
<java.util.logging.config.file>${basedir}/logging/sgtest_logging.properties</java.util.logging.config.file>
<sgtest.buildFolder>${sgtest.buildFolder}</sgtest.buildFolder>
<sgtest.url>http://192.168.9.121:8087/sgtest3.0-xap/</sgtest.url>
<sgtest.disconnect.machines>${sgtest.disconnect.machines}</sgtest.disconnect.machines>
<com.gs.work>${com.gs.work}</com.gs.work>
<com.gs.deploy>${com.gs.deploy}"</com.gs.deploy>
<cppOS>${cppOS}</cppOS>
</systemProperties>
<testFailureIgnore>true</testFailureIgnore>
<detail>true</detail>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.3</version>
<configuration>
<descriptors>
<descriptor>src/main/assembly/assembly.xml</descriptor>
</descriptors>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
<executions>
<execution>
<id>make-assembly</id> <!-- this is used for inheritance merges -->
<phase>package</phase> <!-- bind to the packaging phase -->
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
I was able to make the exact problem occur by configuring my TestNG launch configuration (within eclipse) incorrectly.
Specifically I specified for it to pass the following as a JVM argument:
-runTestAsTool=true
instead of
-DrunTestAsTool=true
Adding the missing D fixed it for me.
So maybe double-check how your launch configuration is configured.
This issue originates from a problem which occurs when running long Java classpaths on Windows (these exceed the process creation command limit). It had been reported on the Eclipse bug tracking system, and was also discussed here on Stackoverflow.
To work around this on Eclipse Juno releases, we can either bypass the command limit (using the solutions suggested in the above linked post), or apply the patch from the reported bug.
Ivan Sim posted the patching instructions on his coderwall, but I'll include an excerpt for the sake of completeness:
Download bug3271933.4.2hack.zip from the above link
Back up existing eclipse/plugins/org.eclipse.jdt.launching_3.4.*.jar
Copy and paste classes in the patch to org/eclipse/jdt/internal/launching in your org.eclipse.jdt.launching
JAR (replace existing files)
Edit the META-INF /MANIFEST.MF file in your org.eclipse.jdt.launching JAR file by removing everything starting
from the first "NAME:" entry. Make sure you leave two (2) line break
characters at the end of the file.
Re-start eclipse
Please make sure the Sock5 proxy on your Mac OS or Windows is turned off.
It seems TestNG tries to connect to JVM instance via creating socket to 'localhost' and in my /etc/hosts (I use linux) file I renamed localhost to something else so it bombed.
Changed back to localhost and all is good.