I have an environment where I need to have multiple JDKs installed to compile different projects. However, the aspectj-maven-plugin declares a dependency on com.sun:tools with the version set to the jre version and a systemPath set to JAVA_HOME.
Naturally, this will be wrong unless the JDK at JAVA_HOME is the intendend JDK for a given project.
Previously, I had some issues with our own code requiring tools.jar, so I resolved the problem by installing the tools.jar in our Nexus instance and adding a proper dependency to our pom files.
What I would like to do is force the aspectj-maven-plugin to use the tools.jar in our Nexus instance just like our own code now does instead of using a system scope dependency.
I tried to add a dependency on the plugin with a nested exclusion on the com.sun:tools dependency, but it did not seem to work.
I also tried to override the dependencies of the plugin by including a dependency on com.sun:tools:1.8 which can be found in our Nexus, but for some reason it only attempts to download this from Maven Central and ignores our Nexus instance.
I feel like I am close, but I am missing the precise incantation to get it to work.
Any ideas?