Question

I had a hard time understanding how to install or deploy a jar file with its accompanying sources (or any additional classifier for that matter). The documentation wasn't clear to me and left me to do some trial and error.

Was it helpful?

Solution

Here is an example of how to use a classifier with maven ant run tasks:

<target name="install-jar">
    ...
    <artifact:pom id="sharedPom" file="shared/pom.xml" />
    <artifact:install file="${classesdir}/shared.jar" >
        <pom refid="sharedPom" />
        <attach file="${builddir}/shared-sources.jar" classifier="sources" />
    </artifact:install>
</target>

The attach referenced to in the documentation is meant to be a sub-element. Hope this helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top