minify-maven-plugin icon indicating copy to clipboard operation
minify-maven-plugin copied to clipboard

Error when building the project: java.lang.NoClassDefFoundError: org/codehaus/plexus/util/IOUtil

Open sroui opened this issue 1 year ago • 1 comments

Hello, I am getting this error when trying to build a project by running the command mvn clean package. The project uses minify maven plugin.

([ERROR] Failed to execute goal com.samaxes.maven:minify-maven-plugin:1.7.6:minify (default-minify) on project Journl: java.lang.NoClassDefFoundError: org/codehaus/plexus/util/IOUtil: org.codehaus.plexus.util.IOUtil -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.samaxes.maven:minify-maven-plugin:1.7.6:minify (default-minify) on project Journl: java.lang.NoClassDefFoundError: org/codehaus/plexus/util/IOUtil)

mvn -v result:

Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
Apache Maven 3.9.4 (dfbb324ad4a7c8fb0bf182e6d91b0ae20e3d2dd9)
Maven home: /opt/homebrew/Cellar/maven/3.9.4/libexec
Java version: 17.0.7, vendor: Homebrew, runtime: /opt/homebrew/Cellar/openjdk@17/17.0.7/libexec/openjdk.jdk/Contents/Home
Default locale: en_MA, platform encoding: UTF-8
OS name: "mac os x", version: "13.6", arch: "aarch64", family: "mac"

the compiler configuration:

  <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-compiler-plugin</artifactId>
      <version>3.11.0</version>
      <configuration>

          <source>17</source>
          <target>17</target>
          <compilerArgs>
              <arg>-XDignore.symbol.file</arg>
          </compilerArgs>
          <fork>true</fork>

          <excludes>
          </excludes>
      </configuration>

      <executions>
          <execution>
              <id>default-testCompile</id>
              <phase>test-compile</phase>
              <configuration>
                  <testExcludes>
                      <testExclude>**/*.java</testExclude>
                  </testExcludes>
                  <skip>true</skip>
              </configuration>
              <goals>
                  <goal>testCompile</goal>
              </goals>
          </execution>
      </executions>
  </plugin>

sroui avatar Sep 29 '23 11:09 sroui

Origin of the problem: Compatibility issues with Maven 3.9.x - details in this PR

sroui avatar Sep 30 '23 14:09 sroui