1
votes

I have a Maven project with several modules, with a structure similar to:

project
  module-1
    pom.xml
  module-2
    pom.xml
  ..
  module-N
    pom.xml
  pom.xml

I have defined the Artifactory Maven plugin in the parent pom.xml which is under project, like it is done in the examples they offer on their website and I've also tried the example they have in git.

My problem is that I don't want to publish to Artifactory all the artifacts generated by the parent pom, but only those under certain modules, so I tried defining the plugin in the parent pom with the tag <publishArtifacts>false</publishArtifacts> and then defining the plugin again on the modules which contain artifacts I really do want to deploy with <publishArtifacts>true</publishArtifacts>, however no artifact is deployed.

If I try the other way, only specifying I do not want to publish Artifacts on the modules I don't, it does deploy all ignoring that configuration.

How should this be done using this plugin?

1

1 Answers

1
votes

You can use the publisher\excludePatterns in the artifactory plugin section of the pom.xml to exclude artifacts from being published.

you can declare multiple patterns with wildcards, and separate each with a comma.

For example, if you are using the sample from "https://github.com/JFrogDev/project-examples/tree/master/artifactory-maven-plugin-example"

then, setting you're pom with

<excludePatterns>multi3*.war,multi2*.jar</excludePatterns>

would exclude those files from being published to Artifactory.

hope that helps...