You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by blipsman <b_...@yahoo.com> on 2014/03/13 23:10:12 UTC

An API incompatibility was encountered while executing org.codehaus.mojo:jaxb2-maven-plugin:1.6:xjc: java.lang.NoSuchMethodError:

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.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: An API incompatibility was encountered while executing org.codehaus.mojo:jaxb2-maven-plugin:1.6:xjc: java.lang.NoSuchMethodError:

Posted by Anders Hammar <an...@hammar.net>.
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


On Thu, Mar 13, 2014 at 11:29 PM, blipsman <b_...@yahoo.com> wrote:

> 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.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: An API incompatibility was encountered while executing org.codehaus.mojo:jaxb2-maven-plugin:1.6:xjc: java.lang.NoSuchMethodError:

Posted by blipsman <b_...@yahoo.com>.
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.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org