Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Blocker
-
Resolution: Fixed
-
Affects Version/s: 3.0-alpha-6, 3.0-alpha-7, 3.0-beta-1
-
Fix Version/s: 3.0-beta-2
-
Component/s: None
-
Labels:None
-
Environment:Windows XP 32bits SP3
-
Complexity:Intermediate
-
Number of attachments :2
Description
When launching a maven build, the -javaagent argument is ignored since Maven 3, and was processed with maven 2.X.X.
The use case is a build with jetty:run goal (org.mortbay.jetty:jetty-maven-plugin 8.0.0.M1) with -javaagent:"$
{settings.localRepository}/org/springframework/spring-instrument/$
{spring-version}/spring-instrument-${spring-version}.jar"
-
Hide
- TestJavaAgent.zip
- 03/Aug/10 8:50 AM
- 7 kB
- Damien Feugas
-
- TestJavaAgent/.classpath 0.5 kB
- TestJavaAgent/.project 0.8 kB
- TestJavaAgent/.../org.eclipse.jdt.core.prefs 0.7 kB
- TestJavaAgent/.../org.maven.ide.eclipse.prefs 0.3 kB
- TestJavaAgent/pom.xml 3 kB
- TestJavaAgent/src/.../aspect/TestAspect.java 0.5 kB
- TestJavaAgent/src/.../TestController.java 0.3 kB
- TestJavaAgent/src/.../ApplicationContext.xml 0.7 kB
- TestJavaAgent/src/main/.../META-INF/aop.xml 0.3 kB
- TestJavaAgent/src/main/.../WEB-INF/web.xml 1 kB
-
Hide
- TestJavaAgent -v2.zip
- 03/Aug/10 8:56 AM
- 7 kB
- Damien Feugas
-
- TestJavaAgent/.classpath 0.5 kB
- TestJavaAgent/.project 0.8 kB
- TestJavaAgent/.../org.eclipse.jdt.core.prefs 0.7 kB
- TestJavaAgent/.../org.maven.ide.eclipse.prefs 0.3 kB
- TestJavaAgent/pom.xml 3 kB
- TestJavaAgent/src/.../aspect/TestAspect.java 0.5 kB
- TestJavaAgent/src/.../TestController.java 0.3 kB
- TestJavaAgent/src/.../ApplicationContext.xml 0.7 kB
- TestJavaAgent/src/main/.../META-INF/aop.xml 0.3 kB
- TestJavaAgent/src/main/.../WEB-INF/web.xml 1 kB
Issue Links
- relates to
-
MNG-4787
Allow class realm manager delegates to alter public part of Maven core realm
-
Activity
All my apologies... I didn't take the time to make a proper bug report.
So, here it is, a maven project that reproduce the problem.
To reproduce the bug:
1- set your PATH and M2_HOME to an Maven 3 installation.
2- catch the artifact org.springframework:spring-instrument 3.0.2.RELEASE
3- set MAVEN_OPTS to -javaagent:YOUR_REPO/org/springframework/spring-instrument/3.0.2.RELEASE/spring-instrument-3.0.2.RELEASE.jar
4- run mvn jetty:run
You'll get an exception :
java.lang.IllegalStateException: Must start with Java agent to use InstrumentationLoadTimeWeaver. See Spring documentation
Now :
1- change your PATH and M2_HOME to a Maven 2 installation
2- check that your repository was not any spaces in its path (cause the jetty plugin to fail)
3- run mvn jetty:run
Everything's fine, and if you go to http://localhost:8080/test/, you'll get
Hello World ! - intercepted !
We need more information than that, -javaagent is a JVM option, not a Maven option, and a quick test showed that setting it via MAVEN_OPTS is still effective, i.e. the JVM tries to load the agent. So please re-open with a minimal demo project that allows to reproduce your issue.