How to build a distro minus packages in maven?

I have a maven project with the following packages (for illustration only):

Root: src/main/java

  • /com/foo

  • /com/foo/api

  • /com/foo/impl

Now I want to create a jar that only includes the code in /com/foo/api

and /com/foo/impl

.

How do I hack the pom.xml for this? Thanks everyone.

+1


source to share


1 answer


Simply, use the tag <includes>

in the plugin jar:

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-jar-plugin</artifactId>
  <configuration>
    <includes>
      <include>/com/foo/api/*</include>
      <include>/com/foo/impl/*</include>
    </includes>
  </configuration>
</plugin>

      



There is a section on inclusion / exclusion in the usage section of the plugin document.

+1


source







All Articles