Tcharl
Tcharl

Reputation: 341

Javaagent path not well interpreted on maven/linux/tomcat

I've not any idea of what's going on on my CI server but maybe someone can help.

I've configured a maven project with a jacoco agent weaved surefire test: The working agent line (that is correctly handled on my laptop) includes a path:

javaagent:/var/lib/jenkins/.m2/repository/org/jacoco/org.jacoco.agent/0.7.0.201403182114/org.jacoco.agent-0.7.0.201403182114-runtime.jar=destfile=/var/lib/jenkins/jobs/Osgiliath enterprise/workspace/net.osgiliath.framework/net.osgiliath.features.karaf-features/net.osgiliath.features.karaf-features.itests/net.osgiliath.features.karaf-features.itests.cdi/target/jacoco-ut.exec,append=true,includes=net.osgiliath.features.karaf-features.itests.cdi.*,excludes=*.itests.*:*.mock.*:*.model.*:*.coverage.*"

The issue is when I launch these tests on my CI server (Fedora 19, Oracle Java 1.7, surefire 2.17, Tomcat, Maven 3.2.1 provided by Jenkins), the same line is not well interpreted by surefire or failsafe, it becomes: Error: Could not find or load main class "-javaagent:.var.lib.jenkins..m2.repository.org.jacoco.org.jacoco.agent.0.7.0.201403182114.org.jacoco.agent-0.7.0.201403182114-runtime.jar=destfile=.var.lib.jenkins.jobs.Osgiliath enterprise.workspace.target.jacoco-it.exec,append=true,includes=net.osgiliath.messaging.*,excludes=*.itests.*:*.mock.*:*.model.*:*.coverage.*"

Notice the dots instead of slashes in the argLine path.

Do someone have an idea of where can this issue come from? It's really annoying as I can't use my CI server for this kind of project.

Thank you in advance

Upvotes: 1

Views: 491

Answers (2)

Cosima
Cosima

Reputation: 31

We had quite a similar error in my dev team. But in our case it was not just fixed with the build machine's encoding (the encoding was UTF-8 from the very beginning). We also had to put the of the surefire configuration into exactly one line.

Upvotes: 0

Tcharl
Tcharl

Reputation: 341

Ok, it was an encoding problem on my linux: X13... instead of UTF-8.

I see Green buttons now :D

Upvotes: 0

Related Questions