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

java.lang.IllegalArgumentException: value already present #35

Closed
codeseedr opened this issue Dec 20, 2018 · 4 comments
Closed

java.lang.IllegalArgumentException: value already present #35

codeseedr opened this issue Dec 20, 2018 · 4 comments
Labels

Comments

@codeseedr
Copy link

codeseedr commented Dec 20, 2018

I just hit an issue with two dependencies that try to declare jdk tools jar as a dependency. Both do it a bit differently because they use different coordinates: one (org.jolokia:jolokia-jvm:jar:agent:1.5.0) -- com.sun:tools:1.8, and the other (org.neo4j:neo4j-dbms:3.4.11) -- jdk.tools:jdk.tools:1.6. As you probably imagine, they're both scope=system deps with systemPath=${java.home}/../lib/tools.jar.

In the above described environment plugin execution fails with:

java.lang.IllegalArgumentException: value already present: /Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home/jre/../lib/tools.jar
	at com.google.common.collect.HashBiMap.put(HashBiMap.java:238)
	at com.google.common.collect.HashBiMap.put(HashBiMap.java:215)
	at org.basepom.mojo.duplicatefinder.artifact.ArtifactFileResolver.<init>(ArtifactFileResolver.java:91)
	at org.basepom.mojo.duplicatefinder.DuplicateFinderMojo.execute(DuplicateFinderMojo.java:362)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
	... 20 more
@hgschmie
Copy link
Contributor

Thanks, I will investigate this.

hgschmie added a commit to hgschmie/duplicate-finder-maven-plugin that referenced this issue Oct 21, 2019
hgschmie added a commit to hgschmie/duplicate-finder-maven-plugin that referenced this issue Oct 22, 2019
@hgschmie
Copy link
Contributor

I have a basic fix for this; there are some challenges with the system classpath that I need to work through. I should be able to cut a new release some time this week.

@hgschmie hgschmie added the bug label Oct 22, 2019
@codeseedr
Copy link
Author

Sounds good, thanks!

hgschmie added a commit to hgschmie/duplicate-finder-maven-plugin that referenced this issue Oct 23, 2019
Multiple system dependencies can actually reference the same
file. Remove the BiHashMap, replace with a Multimap.
@hgschmie
Copy link
Contributor

resolved in accf195. Thank you for reporting this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants