使用jenkins通过maven构建项目时出现警告信息:

[WARNING] Failed to getClass for org.apache.maven.plugin.source.SourceJarMojo

jenkins maven插件报错位置:https://github.com/jenkinsci/maven-plugin/blob/1b30d831d13ce8dce87d2b557ab3a255f0aea1fd/src/main/java/hudson/maven/ExecutedMojo.java#L110

[WARNING] Failed to getClass for org.apache.maven.plugin.source.SourceJarMojo

发生原因:未知,或许是maven plugin版本问题

解决方式:将pom.xml中的如下的配置的jar修改成jar-no-fork

<plugin>
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-source-plugin</artifactId>
                                <version>2.2.1</version>
                                <executions>
                                        <execution>
                                                <id>attach-sources</id>
                                                <phase>package</phase>
                                                <goals>
                                                        <goal>jar</goal>
                                                </goals>
                                        </execution>
                                </executions>
</plugin>
 

参考:https://issues.jenkins-ci.org/browse/JENKINS-27372

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-05
  • 2021-11-14
  • 2021-09-28
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-13
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-08
  • 2021-07-18
相关资源
相似解决方案