JRuby - loading resource from classloader failed - maven

I am running a mvn install goal with the plugin gem-maven-plugin, see below pom.xml -
<plugin>
<groupId>de.saumya.mojo</groupId>
<artifactId>gem-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>initialize</goal>
</goals>
</execution>
</executions>
</plugin>
The build is failing with the error message:
[ERROR] Failed to execute goal de.saumya.mojo:gem-maven-plugin:2.0.1:initialize
Caused by: java.io.FileNotFoundException: loading resource from classloader failed: META-INF/jruby.home/bin/gem
I am building using Windows, but the software has been ported from Linux.
The file path META-INF/jruby.home/bin/gem does not exist on my system (it is a Unix/Linux path), is there a way to fix this error?
jRuby version: jruby 9.1.2.0
OS: Windows Server 2012 R2

This was caused by a corrupted JRuby .jar file, copied from a corrupt repository.
Might help someone in the future.

Related

Create an EAR using Maven

I want to create an EAR using Maven, but since I'm in a pure Tycho world, I can't use the maven-ear-plugin, just the maven-assembly-plugin (which is fine).
There are multiple questions even on this very site that indicate that the maven-assembly-plugin can build EARs, even though the documentation says no.
However, when I use define the EAR format like this:
<formats>
<format>ear</format>
</formats>
I get the following exception:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:3.0:single (make-assembly) on project org.acme.application: Failed to create assembly: Error creating assembly archive default: appxml attribute is required -> [Help 1]
(I tried a couple of versions for the maven-assembly-plugin, so it's not that.)
Since a EAR is just a renamed JAR, I'm now using the JAR format and this other Maven plug-in:
<plugin>
<groupId>com.coderplus.maven.plugins</groupId>
<artifactId>copy-rename-maven-plugin</artifactId>
<version>1.0</version>
<executions>
<execution>
<id>rename-ear</id>
<phase>verify</phase>
<goals>
<goal>rename</goal>
</goals>
<configuration>
<sourceFile>${basedir}/target/${earName}.jar</sourceFile>
<destinationFile>${basedir}/target/${earName}.ear</destinationFile>
</configuration>
</execution>
</executions>
</plugin>
Which works nicely in creating an EAR, however with mvn install it brings the following exception:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.5.2:install (default-install) on project org.acme.application: Failed to install artifact group:org.acme.application:jar:1.9.126-SNAPSHOT: C:\workspace\Application\target\Application.jar (Das System kann die angegebene Datei nicht finden) -> [Help 1]
(It's German for "Cannot find file", one day I'll get him to print out readable error messages.)
Of course, now I could copy the JAR to an EAR instead of just renaming it, but I thought I get a 2nd oppinion first: Is it possible to create an EAR with the maven-assembly-plugin? If so, how?

Could not transfer artifact jlibs:jlibs-xml:pom:1.0 from/to kepler

I am running the pom.xml with in the Myeclipse window. Getting the error related to Kepler repository. Not sure why I am seeing this error. Please refer the error stack below -
[ERROR] Failed to execute goal org.raml.plugins:jaxrs-raml-maven-plugin:1.3.3:generate-raml (default) on project Service: Execution default of goal org.raml.plugins:jaxrs-raml-maven-plugin:1.3.3:generate-raml failed: Plugin org.raml.plugins:jaxrs-raml-maven-plugin:1.3.3 or one of its dependencies could not be resolved: Failed to collect dependencies for org.raml.plugins:jaxrs-raml-maven-plugin:jar:1.3.3 (): Failed to read artifact descriptor for jlibs:jlibs-xml:jar:1.0: Could not transfer artifact jlibs:jlibs-xml:pom:1.0 from/to kepler (http://download.eclipse.org/releases/kepler): No connector available to access repository kepler (http://download.eclipse.org/releases/kepler) of type p2 using the available factories AsyncRepositoryConnectorFactory, WagonRepositoryConnectorFactory -> [Help 1]
I am using the below maven code -
<plugin>
<groupId>org.raml.plugins</groupId>
<artifactId>jaxrs-raml-maven-plugin</artifactId>
<version>1.3.3</version>
<configuration>
<sourcePaths>
<param>${basedir}/src/main/java/Service.java</param>
</sourcePaths>
<sourceDirectory>${basedir}/src/main/java</sourceDirectory>
<outputFile>${project.build.directory}/generated-sources/jaxrs-raml/example.raml</outputFile>
</configuration>
<executions>
<execution>
<goals>
<goal>generate-raml</goal>
</goals>
<phase>process-classes</phase>
</execution>
</executions>
Not facing similar while running the plug in code for "raml-jaxrs-maven-plugin"
Any help would be appreciated.

ERROR [WsdlTestCase] Failed to create test step for [X]

I get this error ERROR [WsdlTestCase] Failed to create test step for [X] when executing my soapui project from Maven.
Tests work fine from the SOAPUI client software. My Soap-ui.error log is empty.
There doesn't seem to be enough information to let me debug this - I'm guessing there's some dependency I'm missing, but my tests are fairly simple (REST requests with a few assertions on the HTTP response). I assumed the core maven plugin would suffice.
My maven config is as below (I've also included the eviware repository -http://www.eviware.com/repository/maven2/)
<plugin>
<groupId>eviware</groupId>
<artifactId>maven-soapui-plugin</artifactId>
<version>2.0.2</version>
<executions>
<execution>
<phase>integration-test</phase>
<id>soapui-tests</id>
<configuration>
<projectFile>${basedir}/src/test/resources/MyTestSuite.xml</projectFile>
<outputFolder>${basedir}/target/soapui</outputFolder>
<junitReport>true</junitReport>
<exportwAll>true</exportwAll>
<printReport>true</printReport>
</configuration>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
</plugin>
the preceeding messages are :
[DefaultSoapUICore] Missing folder [/var/lib/jenkins/jobs/Build-Mule-Configuration/workspace/ext] for external libraries 2015-07-01 15:10:48,961 INFO
[DefaultSoapUICore] Creating new settings at [/var/lib/jenkins/jobs/Build-Mule-Configuration/workspace/soapui-settings.xml]
I've moved up to the 4.6.1 version of the soapui plugin as detailed here
(http://www.soapui.org/test-automation/maven/maven-2-x.html), the tests are now at least attempting to execute. As I understand it the version I've outlined above should work but perhaps it doesn't recognise the current SOAP UI project syntax.
As an aside the 4.6.1 version of the plugin seems to have a much larger number of dependancies and for me is causing memory issues.

How to specify the platform when generating POMs with Tycho?

My company has been building their Eclipse RCP Application with Ant as a PDE-build. I'm trying to migrate the build process to Tycho but I am getting several errors of the same kind. I only want to build for Windows 64-bit but Tycho keeps looking for Cocoa plugins, which are marked as optional in the features.
How can I tell Tycho not to bother about anything that is not related to Windows 64 bit?
The manifest files do already exist, and I tried to generate the POMs with:
mvn org.eclipse.tycho:maven-tycho-plugin:generate-poms -Dtycho.targetPlatform=<path to target> -DgroupId=myGroupId
The error I get is:
[ERROR] Internal error: java.lang.RuntimeException: Could not resolve plugin org.eclipse.e4.ui.workbench.renderers.swt.cocoa_0.11.0.v20120716-173435;
I'm using Java 1.7.0_11, Maven 3.1.0, and Tycho 0.18.1.
I think you just need to set the platform in the target-platform-configuration plugin configuration as follows:
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho.version}</version>
<configuration>
<environments>
<environment>
<os>win32</os>
<ws>win32</ws>
<arch>x86_64</arch>
</environment>
</configuration>
</plugin>

Sonar and Jacoco : How to ? (Compatibility with Cobertura)

I know there are lot of questions about Sonar and Jacoco not generating the report correctly on SO but none of them helped me solve my problem:
Here is the deal :
I have a project using Cobertura to calculate code coverage and I can't change that. Sonar must use Cobertura for the server-side. But on the other hand I have this client (we're talking about a webapplication using smartGWT in java) which is tested with Selenium RC (because that's the only way to test smartGWT).
Cobertura can't calculate Selenium tests' coverage because those tests are done on the deployed application. Jacoco can calculate that because it is launched as a java agent. So everything is working fine on my computer. The jacoco.exec is generated successfully. But it seems that Sonar can't find how to read that file or maybe it's just cobertura and jacoco that are conflicted...
Here is the error that Jenkins generate :
[INFO] Surefire report directory: D:\JENKINS-SONAR\jobs\agepro PROTO\workspace\target\surefire-reports
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:323)
at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:338)
Caused by: java.io.FileNotFoundException: D:\JENKINS-SONAR\jobs\agepro (Accès refusé)
at java.io.FileOutputStream.openAppend(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:177)
at org.jacoco.agent.rt_9w37ty.controller.LocalController.startup(LocalController.java:46)
at org.jacoco.agent.rt_9w37ty.JacocoAgent.init(JacocoAgent.java:83)
at org.jacoco.agent.rt_9w37ty.JacocoAgent.premain(JacocoAgent.java:165)
... 6 more
FATAL ERROR in native method: processing of -javaagent failed
Exception in thread "main"
And here is my configuration of the surefire plugin :
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>-javaagent:${sonar.jacoco.jar}=destfile=${sonar.jacoco.reportPath}</argLine>
<excludes>
<exclude>**/Selenium*.java</exclude>
</excludes>
</configuration>
<executions>
<execution>
<id>surefire-integration-test</id>
<phase>integration-test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<!-- <argLine>-javaagent:${sonar.jacoco.jar}=destfile=${sonar.jacoco.reportPath}</argLine> -->
<excludes>
<exclude>none</exclude>
</excludes>
<includes>
<include>**/Selenium*.java</include>
</includes>
<goal>selenium-test</goal>
</configuration>
</execution>
</executions>
</plugin>
Do you see any mistake I could have made ? Or maybe I have to set another path for the jacoco jar or something else ? Thanks for your help anyway.
The name reportPath is a bit misleading.
The setting sonar.jacoco.reportPath needs to point to a file and not to a directory.
You seem to have set it to: D:\JENKINS-SONAR\jobs\agepro: But I think you mean D:\JENKINS-SONAR\jobs\agepro\jacoco.exec
On further inspection I noticed that the problem might be that you working directory "agepro PROTO" has a space in it.
This breaks the syntax for the java agent configuration. Can you get rid of the space(I don't know if destfile='${sonar.jacoco.reportPath}' would work)

Resources