0

I've been compiling my project happily for over a year now with Maven and suddenly today I'm getting the error mentioned in the title, ie :

Unable to find the mojo 'xjc' (or one of its required components) in the plugin org.codehaus.mojo:jaxb2-maven-plugin'

Bad version number in .class file

The logs quoted below appears just before the error message but not sure if it's relevant. As I understand it, there is some conflicting versions but why does it pop out now ?

this realm = app0.child-container[org.codehaus.mojo:jaxb2-maven-plugin:1.6]
urls[0] = file:/C:/Users/SRAHAINGOSON/.m2/repository/PBIL/org/codehaus/mojo/jaxb2-maven-plugin/1.6/jaxb2-maven-plugin-1.6.jar
urls[1] = file:/C:/Users/SRAHAINGOSON/.m2/repository/PBIL/org/codehaus/plexus/plexus-utils/3.0.16/plexus-utils-3.0.16.jar
urls[2] = file:/C:/Users/SRAHAINGOSON/.m2/repository/PBIL/com/sun/xml/bind/jaxb-xjc/2.2.7/jaxb-xjc-2.2.7.jar
urls[3] = file:/C:/Users/SRAHAINGOSON/.m2/repository/PBIL/com/sun/xml/bind/jaxb-core/2.2.7/jaxb-core-2.2.7.jar
urls[4] = file:/C:/Users/SRAHAINGOSON/.m2/repository/PBIL/javax/xml/bind/jaxb-api/2.2.7/jaxb-api-2.2.7.jar
urls[5] = file:/C:/Users/SRAHAINGOSON/.m2/repository/PBIL/com/sun/istack/istack-commons-runtime/2.16/istack-commons-runtime-2.16.jar
urls[6] = file:/C:/Users/SRAHAINGOSON/.m2/repository/PBIL/com/sun/xml/bind/jaxb-jxc/2.2.7/jaxb-jxc-2.2.7.jar
urls[7] = file:/C:/Users/SRAHAINGOSON/.m2/repository/PBIL/com/sun/xml/bind/jaxb-impl/2.2.7/jaxb-impl-2.2.7.jar
urls[8] = file:/C:/Users/SRAHAINGOSON/.m2/repository/PBIL/com/sun/xml/fastinfoset/FastInfoset/1.2.12/FastInfoset-1.2.12.jar
urls[9] = file:/C:/Users/SRAHAINGOSON/.m2/repository/PBIL/org/codehaus/plexus/plexus-compiler-api/1.9.1/plexus-compiler-api-1.9.1.jar
urls[10] = file:/C:/Users/SRAHAINGOSON/.m2/repository/PBIL/org/sonatype/plexus/plexus-build-api/0.0.7/plexus-build-api-0.0.7.jar
Number of imports: 10
import: org.codehaus.classworlds.Entry@a6c57a42
import: org.codehaus.classworlds.Entry@12f43f3b
import: org.codehaus.classworlds.Entry@20025374
import: org.codehaus.classworlds.Entry@f8e44ca4
import: org.codehaus.classworlds.Entry@92758522
import: org.codehaus.classworlds.Entry@ebf2705b
import: org.codehaus.classworlds.Entry@bb25e54
import: org.codehaus.classworlds.Entry@bece5185
import: org.codehaus.classworlds.Entry@3fee8e37
import: org.codehaus.classworlds.Entry@3fee19d8


this realm = plexus.core
urls[0] = file:/C:/Program Files (x86)/apache-maven-2.2.1/bin/../lib/maven-2.2.1-uber.jar
urls[1] = file:/C:/Users/SRAHAINGOSON/.m2/repository/PBIL/org/apache/maven/wagon/wagon-ssh-external/1.0-alpha-5/wagon-ssh-external-1.0-alpha-5.jar
Number of imports: 10
import: org.codehaus.classworlds.Entry@a6c57a42
import: org.codehaus.classworlds.Entry@12f43f3b
import: org.codehaus.classworlds.Entry@20025374
import: org.codehaus.classworlds.Entry@f8e44ca4
import: org.codehaus.classworlds.Entry@92758522
import: org.codehaus.classworlds.Entry@ebf2705b
import: org.codehaus.classworlds.Entry@bb25e54
import: org.codehaus.classworlds.Entry@bece5185
import: org.codehaus.classworlds.Entry@3fee8e37
import: org.codehaus.classworlds.Entry@3fee19d8

The pom.xml looks like this :

<build>
<plugins>
  <plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>jaxb2-maven-plugin</artifactId>
    <executions>
      <execution>
        <goals>
          <goal>xjc</goal>
        </goals>
      </execution>
    </executions>
    <configuration>
      <schemaDirectory>src/main/resources/xsd</schemaDirectory>
      <schemaIncludes>
        <include>*.xsd</include>
      </schemaIncludes>
      <packageName>fr.extelia.bilan.plugin.cnce.object</packageName>
    </configuration>
  </plugin>
</plugins>

Thanks

Sandy
  • 547
  • 3
  • 9
  • 20
  • Please update to Maven 3.X and don't use Maven 2.2.1 anymore. [See EoL information](http://maven.apache.org/maven-2.x-eol.html). – khmarbaise Mar 19 '14 at 14:37
  • 1
    Hi khmarbaise. Switching to Maven 3 would require me to go all over my pom files as most of them won't work with version 3 out of the box. I'd rather avoid that unless I'm sure that my problem is a version issue. – Sandy Mar 20 '14 at 16:13
  • Than you need to downgrade the jaxb2-maven-plugin and check if it works in earlier versions as you like. Why do you need to go over you pom files if you change to Maven 3 ? Just start a separate CI build with Maven 3.X configured and see if the build works. Check the results test them for a time and that's it. Why should the pom file do not work with Maven 3? – khmarbaise Mar 20 '14 at 19:25

0 Answers0