Maven Shade和Clover不适用于mvn网站

用户名

我有一个父项目和一些子项目。一些孩子彼此之间有依赖性。例如:父->子1,父->子2,子1->子2(子1取决于子2)这是我在pom中正在做的事情:

  <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-shade-plugin</artifactId>
      <version>2.3</version>
  </plugin>
        <plugin>
    <groupId>com.atlassian.maven.plugins</groupId>
    <artifactId>maven-clover2-plugin</artifactId>
    <version>3.1.10.1</version>
    <configuration>
      <jdk>${compile.source}</jdk>
      <generateHtml>true</generateHtml>
      <generatePdf>false</generatePdf>
      <generateXml>true</generateXml>
    </configuration>
    <executions>
      <execution>
        <phase>pre-site</phase>
        <goals>
          <goal>instrument</goal>
        </goals>
      </execution>
    </executions>
  </plugin>
  <reportPlugins>
              <plugin>
          <groupId>com.atlassian.maven.plugins</groupId>
          <artifactId>maven-clover2-plugin</artifactId>
          <version>3.1.10.1</version>
          <configuration>
            <jdk>${compile.source}</jdk>
            <generateHtml>true</generateHtml>
            <generatePdf>false</generatePdf>
            <generateXml>true</generateXml>
          </configuration>
        </plugin>
  </reportPlugins>

子pom看起来像这样:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-shade-plugin</artifactId>
    <executions>
      <execution>
        <phase>package</phase>
        <goals>
          <goal>shade</goal>
        </goals>
      </execution>
    </executions>
    <configuration>
      <createDependencyReducedPom>false</createDependencyReducedPom>
      <filters>
        <filter>
          <artifact>*:*</artifact>
          <excludes>
            <exclude>META-INF/*.SF</exclude>
            <exclude>META-INF/*.DSA</exclude>
            <exclude>META-INF/*.RSA</exclude>
            <exclude>META-INF/LICENSE</exclude>
            <exclude>config.properties</exclude>
          </excludes>
        </filter>
      </filters>
      <transformers>
        <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
        <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
          <mainClass>com.cerner.pophealth.program.runtime.pipeline.Main</mainClass>
        </transformer>
      </transformers>
    </configuration>
  </plugin>

我遇到的问题是mvm site-deploy会因以下错误而失败:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:1.7.1:shade (default) on project foo: Error creating shaded jar: error in opening zip file /foo/bar/target/classes -> [Help 1]

mvn site-deploy从foo-parent级别运行。

我注意到,即使在站点运行时,三叶草也会尝试在target / clover /文件夹中创建带阴影的jar。

任何帮助表示赞赏。

用户名

使用配置文件启用/禁用带阴影的插件。

   <profiles>
<profile>
  <id>shade</id>
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</profile>

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

maven -P 选项不适用于 mvn clean install

log4j2 JsonTemplateLayout 不适用于 maven shade 插件

声纳分析不适用于 Maven

scala 不适用于 kafka-streams-scala 和 maven

声纳 3.5.1 不适用于带有战争文件的 Java 8 和 maven 3.3.9

“运行任何内容”操作不适用于Maven命令

maven-source-plugin不适用于kotlin

Bluemix Build&Deploy管道不适用于Maven

jpl库不适用于Java Maven项目

Maven 3.2.5不适用于JDK6

Spring Cloud Contract测试适用于Maven,但不适用于JUnit

Maven 项目中的 JUnit 5 测试适用于 IntelliJ,但不适用于命令行

带有Maven插件的Eclipse不适用于最新版本,但适用于较旧的版本

适用于opencv_contrib的Maven

JAX-WS Maven插件不适用于JDK 8

sonar.host.url不适用于sonar-maven-plugin:2.7

Maven发布插件git push不适用于Git Deploy密钥

并且在多个文件条件下不适用于Maven配置文件

网址格式不适用于localhost url(没有Maven的球衣)

spring-boot-configuration-processor不适用于maven子模块项目

Gradle Maven插件“安装”任务不适用于Android库项目

Maven嵌入式部署不适用于org.apache.httpcomponents.httpclient版本4.4

龙目岛不适用于spring-boot-maven-plugin

Micronaut DI 不适用于 Maven 内置的 Graal Native Image

带有 AttributeConverter 的 Spring 启动测试不适用于 Maven 测试

JS适用于Firefox和Safari,但不适用于Chrome。这是我的网站

适用于源和目标的Maven编译器插件JDK版本

适用于多模块项目的Maven Jacoco配置

适用于QuickFIX / J库的Maven存储库