Skip to content

The Unified and Autonomous Development Platform

Fix issue #526 - NoSuchMethodError: org.apache.commons.codec.binary.Hex.encodeHexString

Robin Shen9c79b784ef96
diff --git a/pom.xml b/pom.xml
index e6a511ff0f..9591d09b03 100644
--- a/pom.xml
+++ b/pom.xml
@@ -35,20 +35,6 @@
</plugins>
</pluginManagement>
<plugins>
- <plugin>
- <artifactId>maven-jar-plugin</artifactId>
- <version>3.0.2</version>
- <executions>
- <execution>
- <id>default-jar</id>
- <phase>never</phase>
- <configuration>
- <finalName>unwanted</finalName>
- <classifier>unwanted</classifier>
- </configuration>
- </execution>
- </executions>
- </plugin>
<plugin>
<groupId>io.onedev</groupId>
<artifactId>plugin-maven</artifactId>
@@ -71,6 +57,20 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>3.0.2</version>
+ <executions>
+ <execution>
+ <id>default-jar</id>
+ <phase>never</phase>
+ <configuration>
+ <finalName>unwanted</finalName>
+ <classifier>unwanted</classifier>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
<resources>
<resource>
diff --git a/server-plugin/pom.xml b/server-plugin/pom.xml
index 293a391d48..6933b93eec 100644
--- a/server-plugin/pom.xml
+++ b/server-plugin/pom.xml
@@ -45,5 +45,6 @@
<module>server-plugin-report-spotbugs</module>
<module>server-plugin-report-pmd</module>
<module>server-plugin-report-cpd</module>
+ <module>server-plugin-report-cpd2</module>
</modules>
</project>
\ No newline at end of file
diff --git a/server-plugin/server-plugin-archetype/src/main/resources/archetype-resources/pom.xml b/server-plugin/server-plugin-archetype/src/main/resources/archetype-resources/pom.xml
index 27ddb85016..dbd97df1b5 100644
--- a/server-plugin/server-plugin-archetype/src/main/resources/archetype-resources/pom.xml
+++ b/server-plugin/server-plugin-archetype/src/main/resources/archetype-resources/pom.xml
@@ -27,63 +27,45 @@
<target>1.8</target>
</configuration>
</plugin>
- <plugin>
- <groupId>org.eclipse.m2e</groupId>
- <artifactId>lifecycle-mapping</artifactId>
- <version>1.0.0</version>
- <configuration>
- <lifecycleMappingMetadata>
- <pluginExecutions>
- <pluginExecution>
- <pluginExecutionFilter>
- <groupId>io.onedev</groupId>
- <artifactId>plugin-maven</artifactId>
- <versionRange>[2.0.0,]</versionRange>
- <goals>
- <goal>populate-resources</goal>
- </goals>
- </pluginExecutionFilter>
- <action>
- <execute>
- <runOnIncremental>true</runOnIncremental>
- <runOnConfiguration>true</runOnConfiguration>
- </execute>
- </action>
- </pluginExecution>
- <pluginExecution>
- <pluginExecutionFilter>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <versionRange>[1.0.0,]</versionRange>
- <goals>
- <goal>jar</goal>
- </goals>
- </pluginExecutionFilter>
- <action>
- <ignore/>
- </action>
- </pluginExecution>
- </pluginExecutions>
- </lifecycleMappingMetadata>
- </configuration>
- </plugin>
- <plugin>
- <artifactId>maven-jar-plugin</artifactId>
- <version>3.0.2</version>
- <executions>
- <execution>
- <id>default-jar</id>
- <phase>never</phase>
- <configuration>
- <finalName>unwanted</finalName>
- <classifier>unwanted</classifier>
- </configuration>
- </execution>
- </executions>
- </plugin>
</plugins>
</pluginManagement>
<plugins>
+ <plugin>
+ <groupId>io.onedev</groupId>
+ <artifactId>plugin-maven</artifactId>
+ <version>2.0.9</version>
+ <executions>
+ <execution>
+ <?m2e execute onConfiguration,onIncremental?>
+ <id>populate-resources</id>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>populate-resources</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>package-artifacts</id>
+ <phase>package</phase>
+ <goals>
+ <goal>package-artifacts</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>3.0.2</version>
+ <executions>
+ <execution>
+ <id>default-jar</id>
+ <phase>never</phase>
+ <configuration>
+ <finalName>unwanted</finalName>
+ <classifier>unwanted</classifier>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.1</version>
@@ -111,27 +93,6 @@
</execution>
</executions>
</plugin>
- <plugin>
- <groupId>io.onedev</groupId>
- <artifactId>plugin-maven</artifactId>
- <version>2.0.9</version>
- <executions>
- <execution>
- <id>populate-resources</id>
- <phase>compile</phase>
- <goals>
- <goal>populate-resources</goal>
- </goals>
- </execution>
- <execution>
- <id>package-artifacts</id>
- <phase>package</phase>
- <goals>
- <goal>package-artifacts</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
</plugins>
</build>
<dependencies>
diff --git a/server-product/pom.xml b/server-product/pom.xml
index 0c00df34fc..48aaa662c5 100644
--- a/server-product/pom.xml
+++ b/server-product/pom.xml
@@ -140,10 +140,23 @@
<artifactId>server-plugin-import-bitbucketcloud</artifactId>
<version>${project.version}</version>
</dependency>
+
+ <!-- Add explicit dependencies to make sure standalone plugins use expected lib version -->
+ <dependency>
+ <groupId>commons-codec</groupId>
+ <artifactId>commons-codec</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-collections4</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ </dependency>
</dependencies>
<properties>
<executables>bin/*.sh, boot/wrapper-*</executables>
<moduleClass>io.onedev.server.product.ProductModule</moduleClass>
</properties>
-
</project>
\ No newline at end of file