Reputation: 3043
Our Ivy repo is set up as described here: http://ant.apache.org/ivy/history/latest-milestone/terminology.html
I'm attempting to access it from maven. The paths map to the module no problem. We have a module foo, and then foo creates artifacts foo-api.2.1.0.jar and foo.2.1.0.jar (the implementation). Its the foo-api.2.1.0.jar that is the problem.
I've tried the maven classifier, but then it wants to find foo.2.1.0-api.jar, not foo-api.2.1.0.jar.
The diagram in the link implies that an ivy.xml or pom.xml could create the example layout they have for mymod-api, mymod-impl. How does one do that with a pom?
Update:
A suggestion was to make the maven artifacts be mymod-api and mymod-impl, but this then has maven query the repo for:
/com/mycorp/foo-api/2.1.0.0/foo-api.jar
/com/mycorp/foo/2.1.0.0/foo.jar
Whereas Ivy puts them:
/com/mycorp/foo/2.1.0.0/foo-api.jar
/com/mycorp/foo/2.1.0.0/foo.jar
Consequently, just using maven artifacts renders them undiscoverable.
Update 2:
We are using the Nexus repo manager.
Upvotes: 3
Views: 469
Reputation: 77951
If you are using Nexus, as your repository manager, then check out this answer on how to configure your ivy build:
Use public maven repository with ivy
Publishing files to Nexus from ivy is described here:
how to publish 3rdparty artifacts with ivy and nexus
Apologies in advance, it's very comprehensive and will also explain the significance of classifiers in Maven.
When publishing to Nexus:
<ivy:publish resolver="deploy"...>
<artifacts pattern="${build.dr}/[artifact](-[classifier]).[ext]"/>
</ivy:publish>
make sure you're using an ibilio resolver:
<ivysettings>
<settings defaultResolver="central"/>
<credentials host="somehost" realm="Sonatype Nexus Repository Manager" username="????" passwd="????"/>
<resolvers>
<ibiblio name="central" m2compatible="true"/>
<ibiblio name="deploy" root="http://somehost/nexus/content/repositories/repo" m2compatible="true"/>
</resolvers>
</ivysettings>
The "gotcha" is m2compatible="true". For historical reasons the resolver supports the much older Maven 1 respository format (Ibilio is the old name for Maven Central).
Upvotes: 1
Reputation: 6499
You don't want the classifier, that'll do what you said. What you need is that the artifact id to be "foo-api" for that artifact. It's not a problem, it's working as intended.
Upvotes: 1