exec-maven-plugin: java.lang.String cannot be cast to org.codehaus.mojo.exec.Modulepath
I had some pomfiles which didn’t specify a version for exec-maven-plugin
. (Ignoring warnings at my own peril!)
When the new version became available in Maven Central, I started seeing errors along the lines of:
A type incompatibility occured while executing org.codehaus.mojo:exec-maven-plugin:1.6.0:exec: java.lang.String cannot be cast to org.codehaus.mojo.exec.Modulepath
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.codehaus.mojo:exec-maven-plugin:1.6.0
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/home/user/.m2/repository/org/codehaus/mojo/exec-maven-plugin/1.6.0/exec-maven-plugin-1.6.0.jar
[ERROR] urls[1] = file:/home/user/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.11/plexus-interpolation-1.11.jar
[ERROR] urls[2] = file:/home/user/.m2/repository/backport-util-concurrent/backport-util-concurrent/3.1/backport-util-concurrent-3.1.jar
[ERROR] urls[3] = file:/home/user/.m2/repository/org/slf4j/slf4j-jdk14/1.5.6/slf4j-jdk14-1.5.6.jar
[ERROR] urls[4] = file:/home/user/.m2/repository/org/slf4j/slf4j-api/1.5.6/slf4j-api-1.5.6.jar
[ERROR] urls[5] = file:/home/user/.m2/repository/org/slf4j/jcl-over-slf4j/1.5.6/jcl-over-slf4j-1.5.6.jar
[ERROR] urls[6] = file:/home/user/.m2/repository/org/apache/maven/reporting/maven-reporting-api/2.2.1/maven-reporting-api-2.2.1.jar
[ERROR] urls[7] = file:/home/user/.m2/repository/org/apache/maven/doxia/doxia-sink-api/1.1/doxia-sink-api-1.1.jar
[ERROR] urls[8] = file:/home/user/.m2/repository/org/apache/maven/doxia/doxia-logging-api/1.1/doxia-logging-api-1.1.jar
[ERROR] urls[9] = file:/home/user/.m2/repository/commons-cli/commons-cli/1.2/commons-cli-1.2.jar
[ERROR] urls[10] = file:/home/user/.m2/repository/org/codehaus/plexus/plexus-interactivity-api/1.0-alpha-4/plexus-interactivity-api-1.0-alpha-4.jar
[ERROR] urls[11] = file:/home/user/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar
[ERROR] urls[12] = file:/home/user/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
[ERROR] urls[13] = file:/home/user/.m2/repository/org/codehaus/plexus/plexus-utils/3.0.20/plexus-utils-3.0.20.jar
[ERROR] urls[14] = file:/home/user/.m2/repository/org/apache/commons/commons-exec/1.3/commons-exec-1.3.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]
There isn’t any stack dump
I’m using Maven 3.2.5 and JDK 1.7.0_71, which are both older.
Obviously, I can fix the problem by going to the previous version of the plugin (1.5.0).
Is this an actual issue, or am I simply using a toolstack that’s “too old”?
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 5
- Comments: 20
Commits related to this issue
- #75 Supporting module path given as string — committed to gunnarmorling/exec-maven-plugin by gunnarmorling 6 years ago
- #75 java.lang.String cannot be cast to org.codehaus.mojo.exec.Modulepath — committed to mojohaus/exec-maven-plugin by rfscholte 5 years ago
- #75 java.lang.String cannot be cast to org.codehaus.mojo.exec.Modulepath — committed to mojohaus/exec-maven-plugin by rfscholte 5 years ago
Short term fix is to set
<longModulepath>false</longModulepath>
.+1