Discussion:
An API incompatibility was encountered while executing org.codehaus.mojo:jaxb2-maven-plugin:1.6:xjc: java.lang.NoSuchMethodError:
blipsman
2014-03-13 22:29:14 UTC
Permalink
I found solution:
To eliminate problem, which was to enforce using JAXB 2.1 ( which is
included in JAVA 6) , but not JAXB 2.2 I have added
to the parent POM:

*<pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<version>1.5</version>

</plugin>

</plugins>
</pluginManagement>*

fixed the error in POM.xml

Still had to use *<target>2.1</target>* to make sure the 2.1 JAXB is used
instead of JAXB 2.2

Boris



--
View this message in context: http://maven.40175.n5.nabble.com/An-API-incompatibility-was-encountered-while-executing-org-codehaus-mojo-jaxb2-maven-plugin-1-6-xjc--tp5788280p5788281.html
Sent from the Maven - Users mailing list archive at Nabble.com.
blipsman
2014-03-13 22:10:12 UTC
Permalink
Hi,
As I am running mvn clean install in Eclipse
and the following configuration is being executed ...

<build>
....
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<executions>
<execution>
<id>profileXYZ</id>
<goals><goal>xjc</goal></goals>
<phase>generate-sources</phase>
<configuration>
<packageName>com.somename.profile</packageName>
<schemaDirectory>src/main/resources/xsd</schemaDirectory>
<schemaFiles>profileXYZ.xsd</schemaFiles>

<bindingDirectory>src/main/resources/bind</bindingDirectory>
<bindingFiles>binding.xml</bindingFiles>

<staleFile>${project.build.directory}/jaxb2/.xjcStaleFlagProfile</staleFile>
<clearOutputDir>false</clearOutputDir>
<strict>false</strict>
<extension>true</extension>

</configuration>
</execution>
</executions>
</plugin>
</build>

I get error:
[ERROR] *Failed to execute goal org.codehaus.mojo:jaxb2-maven-plugin:1.6:xjc
(profileNBA_WAE_Merged) on project xyz: null: MojoExecutionException:
UndeclaredThrow
ion: javax.xml.bind.annotation.XmlElementRef.required() -> [Help 1]*

Eclipse displays error as well:*Execution profileXYZ of goal
org.codehaus.mojo:jaxb2-maven-plugin:1.6:xjc failed:
An API incompatibility was encountered while executing
org.codehaus.mojo:jaxb2-maven-plugin:1.6:xjc: java.lang.NoSuchMethodError:*
in Eclipse , in POM.xml

Adding <target>2.1</target> after extension allows me to run successfully
*/mvn clean install /*in command line, but Eclipse still shows the same
error in POM.xml

Any ideas ....thx for help in advance

Thanks, Boris



--
View this message in context: http://maven.40175.n5.nabble.com/An-API-incompatibility-was-encountered-while-executing-org-codehaus-mojo-jaxb2-maven-plugin-1-6-xjc--tp5788280.html
Sent from the Maven - Users mailing list archive at Nabble.com.
Anders Hammar
2014-03-15 12:42:09 UTC
Permalink
Could you try the recently release 1.6 version?
If it also fails, please file an issue ticket [1] and provide a small
project that can be used to reproduce the issue.

/Anders

[1] https://jira.codehaus.org/browse/MJAXB
Post by blipsman
To eliminate problem, which was to enforce using JAXB 2.1 ( which is
included in JAVA 6) , but not JAXB 2.2 I have added
*<pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<version>1.5</version>
</plugin>
</plugins>
</pluginManagement>*
fixed the error in POM.xml
Still had to use *<target>2.1</target>* to make sure the 2.1 JAXB is used
instead of JAXB 2.2
Boris
--
http://maven.40175.n5.nabble.com/An-API-incompatibility-was-encountered-while-executing-org-codehaus-mojo-jaxb2-maven-plugin-1-6-xjc--tp5788280p5788281.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
Loading...