Maven - Depend on assembled zip

后端 未结 3 967
星月不相逢
星月不相逢 2020-11-30 02:18

I\'m trying to have a Project B pull down (and unpack) a ZIP built by Project A and deployed to a remote repository.

The ZIP is cre

3条回答
  •  执笔经年
    2020-11-30 03:07

    If you ever want to do something like this from the command line (e.g. from a script without having to write a pom.xml file), here's the way to do it...

    You can either specify the individual properties:

    mvn dependency:copy -DgroupId=org.apache.maven -DartifactId=maven-core -Dversion=2.2.1 -Dpackaging=zip -Dclassifier=thisistheattachedartifactsclassifier
    

    Or specify them all in one artifact parameter:

    mvn dependency:copy -Dartifact=org.apache.maven:maven-core:2.2.1:zip:thisistheattachedartifactsclassifier
    

    With the latter, it is important to keep the classifier at the end, after the packaging/type attribute. Like this: -Dartifact=groupId:artifactId:version:type:classifier

    You can also optionally specify the target directory using the -DoutputDirectory= parameter if required.

提交回复
热议问题