Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect aspectjweaver jar used for 'javaagent:' if aspectjweaver-1.8.6-sources.jar is present. #8

Closed
scottweaver opened this issue Nov 16, 2016 · 1 comment

Comments

@scottweaver
Copy link

scottweaver commented Nov 16, 2016

OS: OS X, El Capitan
Scala version: 2.11.8
Java Version: 1.8.0_77
SBT Version: 0.13.13

If the aspectjweaver-1.8.6-sources.jar is present under .ivy2/cache/org.aspectj/aspectjweaver/srcs, the sbt-aspectj-runner will erroneously use that jar for the javaagent instead of correctly using .ivy2/cache/org.aspectj/aspectjweaver/jars/aspectjweaver-1.8.6.jar.

The following error is raised when executing aspectj-runner:run:

[info] Error occurred during initialization of VM
[error] Failed to find Premain-Class manifest attribute in /Users/sweaver/.ivy2/cache/org.aspectj/aspectjweaver/srcs/aspectjweaver-1.8.6-sources.jar
[info] agent library failed to init: instrument
java.lang.RuntimeException: Nonzero exit code returned from runner: 1
	at scala.sys.package$.error(package.scala:27)

Steps to reproduce:

  1. Explicitly add the aspectj weaver as a dependency and have it set to download sources:
    "org.aspectj" % "aspectjweaver" % aspectJVersion withSources() withJavadoc()
  2. Make sure that fork in run := true
  3. Reload/start SBT.
  4. Execute aspectj-runner:run
  5. Should fail

Work-around

  1. Remove 'withSources()' from the dependency:
    "org.aspectj" % "aspectjweaver" % aspectJVersion withJavadoc()
  2. Delete ivy2/cache/org.aspectj/aspectjweaver/srcs/aspectjweaver-1.8.6-sources.jar
  3. Reload/start SBT.
  4. Execute aspectj-runner:run
  5. Should run as expected
@scottweaver scottweaver changed the title Incorrect aspectweaver jar used for 'javaagent:' if aspectjweaver-1.8.6-sources.jar is present. Incorrect aspectjweaver jar used for 'javaagent:' if aspectjweaver-1.8.6-sources.jar is present. Nov 16, 2016
scottweaver pushed a commit to scottweaver/sbt-aspectj-runner that referenced this issue Nov 16, 2016
… the source jar instead of the binary jar for aspectj weaver.

- Bump SBT version to 0.13.13
- Issue kamon-io#8: Change settings in ping pong example to demonstrate and reproduce the source jar issue.
scottweaver pushed a commit to scottweaver/sbt-aspectj-runner that referenced this issue Nov 17, 2016
- Remove as many SBT deprecation warnings as possible.
- Bump AspectJ to 1.8.9
dpsoft added a commit that referenced this issue Nov 17, 2016
- Issue #8: Add artifactFilter to prevent inadvertently using the sou…
@dpsoft
Copy link
Contributor

dpsoft commented Nov 17, 2016

related to #9

@dpsoft dpsoft closed this as completed Nov 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants