1

我有一个多模块项目,我使用程序集插件将其组装到一个胖罐中。到目前为止,Thank 工作正常,但现在我想构建另一个仅包含 uber-pom 依赖项的特殊包的 jar。

一个例子:

我在子项目上有 3 个部门,我想有一个 jar

  • com.mycompany.api.*,
  • com.mycompany.settings.*
  • com.mycompany.public.*

但不是

  • com.mycompany.internal.*

这些包通过 3 个部门分发。

有没有机会用程序集插件实现类似的东西?

谢谢,扬

4

1 回答 1

3

Shade插件应该可以做类似的事情。

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <version>2.0</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <filters>
                <filter>
                  <artifact>*:*</artifact>
                  <includes>
                    <include>com/mycompany/api/*</include>
                    <include>com/mycompany/settings/*</include>
                    <include>com/mycompany/public/*</include>
                  </includes>
                </filter>
              </filters>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
于 2013-02-11T16:00:11.323 回答