Reputation: 11
Here is the Maven Repository that I'm trying to use. A snippet from my pom.xml
:
<dependency>
<groupId>edu.wpi.cscore.java</groupId>
<artifactId>cscore</artifactId>
<version>1.0.2</version>
</dependency>
When run, it grabs the cscore-1.0.2.pom
file just fine, but then it goes searching for cscore-1.0.2.jar
which doesn't exist - if you look in the repo, each JAR is platform-specific, and is named accordingly (e.g. cscore-1.0.2-linux.jar
).
I've tried:
<dependency>
<groupId>edu.wpi.cscore.java</groupId>
<artifactId>cscore</artifactId>
<version>1.0.2</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>edu.wpi.cscore.java</groupId>
<artifactId>cscore</artifactId>
<version>1.0.2-linux</version>
<type>jar</type>
</dependency>
It gets the cscore-1.0.2.pom
fine but then it goes looking in the 1.0.2-linux/
directory for the JAR, which simply doesn't exist. Is there a way to tell Maven that the JAR file it is looking for will be named something else? Or is this simply not a valid Maven repository?
Thanks!
Upvotes: 1
Views: 2044
Reputation: 45
There should be one [and only one] artifact addressable via a coordinate [group-id, artifact-id, version].
These platform-specific artifacts were likely pushed into the repository manually and can't be referred to individually via the expected maven dependency POM element.
The easiest short-term solution would be to manually extract the dependency/dependencies and install each one with its own unique maven coordinates in your local repository. Then refer to that artifact using its local coordinates from the element in your project's POM.
Unfortunately that makes it impossible for maven to automatically detect and download a newer version of the artifact in the remote repo.
The long-term solution would be to petition the keepers of the external dependency's project, asking them to re-consider how they identify and install their platform-specific artifacts.
Upvotes: 1