我正在尝试在时间上优化我的构建过程(开发中)以构建 maven 多模块项目的整个树。一些 POM 实际上是很少(并且通常)永远不会更改的源/库的聚合。所以具体的子问题是
如果 POM:project/build/sourceDirectory 属性中指定的源没有更改,是否可以以某种方式将 maven 配置为不构建 pom?
或者是否可以(至少)有条件地禁用 maven-bundle-plugin?- 它需要大部分时间。
Google 找不到任何相关的 Q#1。典型的解决方案不适用于#2 - 当我尝试为 maven-bundle-plugin 指定“执行”时(像这样)
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>${maven-bundle-plugin.version}</version>
<extensions>true</extensions>
<executions>
<execution>
<id>osgi-bundle</id>
<phase>bundle</phase>
<goals>
<goal>bundle</goal>
</goals>
我在输出中收到此错误
[bundle:bundle]
Bundle artifact-id:bundle-id:bundle:0.1.0-SNAPSHOT : The JAR is empty: dot
Error(s) found in bundle configuration
任何帮助表示赞赏。我知道以下内容:
*禁用父 POM 中定义的 Maven 插件
(maven-bundle-plugin 不能使用 'executions' 标签)
*如果文件不存在,则跳过执行 maven 插件(maven-bundle -plugin 没有跳过配置选项)
*如何在多 maven 模块中跳过生命周期阶段(与之前相同)
* 如果将整个 maven-bundle-plugin 移动到配置文件中,maven 无法识别 Packaging=bundle。