Strange, Maven 2.2.1 should have the same problem. It was fixed in Maven 3.
/Anders (mobile) Den 28 okt 2013 12:55 skrev "Rajesh Singh Rathore" <[email protected] >: > Thanks Anders for you reply, I upgraded maven to version 2.2.1 and it > worked > like a charm :) > > > > -----Original Message----- > From: [email protected] [mailto:[email protected]] On > Behalf > Of Anders Hammar > Sent: 28 October 2013 12:36 > To: Maven Users List > Subject: Re: Generate Source problem due to org.jvnet.jaxb2.maven2 plugin > 0.4.M3 plugin overriding 0.7.1 > > Yes, Maven 2.0.10 can't handle different plugin classpaths for the modules. > Either align the versions or (preferably) upgrade to Maven 3.0.4+. > > /Anders > > > On Mon, Oct 28, 2013 at 7:55 AM, Rajesh Singh Rathore < > [email protected]> wrote: > > > Hello Everyone, > > > > > > > > I am facing strange problem while generating sources from XSD, I am > > having multiple modules in my project and some of old modules are > > using > > org.jvnet.jaxb2.maven2 plugin 0.4.M3. New module is using version > > 0.7.1 of > > org.jvnet.jaxb2.maven2 plugin. It works fine while building > > independently but fails with existing modules. I suspect that version > > 0.7.1 is not picked up at all while building my new module along with > > others, same has been confirmed via console output for generate sources. > > > > > > > > Configuration details : > > > > Maven version : 2.0.10 > > > > JDK : 1.5 > > > > > > > > POM.xml > > > > > > > > <build> > > > > > > <finalName>${project.artifactId}-${version}</finalName> > > > > <plugins> > > > > <plugin> > > > > > > <groupId>org.apache.maven.plugins</groupId> > > > > > > <artifactId>maven-compiler-plugin</artifactId> > > > > > > <configuration> > > > > > > <source>1.5</source> > > > > > > <target>1.5</target> > > > > > > </configuration> > > > > </plugin> > > > > <plugin> > > > > > > <groupId>org.jvnet.jaxb2.maven2</groupId> > > > > > > <artifactId>maven-jaxb2-plugin</artifactId> > > > > > > <version>0.7.1</version> > > > > > > <configuration> > > > > > > <args> > > > > > > <arg>-target</arg> > > > > > > <arg>2.0</arg> > > > > > > </args> > > > > > > <forceRegenerate>true</forceRegenerate> > > > > > > <removeOldOutput>true</removeOldOutput> > > > > > > <extension>true</extension> > > > > > > <verbose>true</verbose> > > > > > > </configuration> > > > > > > <executions> > > > > > > <execution> > > > > > > <id>Schema Generation</id> > > > > > > <phase>generate-sources</phase> > > > > > > <configuration> > > > > > > <generatePackage>com.rajesh.health.benefit.scheme.schema</generatePack > > age> > > > > > > > > <schemaDirectory>src\main\resources\com\rajesh\benefit\scheme\wsdl</sc > > hemaDi > > rectory> > > > > > > <schemaIncludes> > > > > > > <schemaInclude>*.xsd</schemaInclude> > > > > > > </schemaIncludes> > > > > > > <generateDirectory>target\generated-sources\xjc\</generateDirectory> > > > > > > </configuration> > > > > > > <goals> > > > > > > <goal>generate</goal> > > > > > > </goals> > > > > > > </execution> > > > > > > </executions> > > > > > > > > </plugin> > > > > </plugins> > > > > </build> > > > > > > > > Failed Console output > > > > INFO] > > ---------------------------------------------------------------------- > > -- > > > > [INFO] Building BenefitSchemeClientWS > > > > [INFO] task-segment: [clean, generate-sources] > > > > [INFO] > > ---------------------------------------------------------------------- > > -- > > > > [INFO] [clean:clean] > > > > [INFO] Deleting directory D:\Development Dev\CAS\Release\Business > > Services\BenefitSchemeClientWS\target > > > > [INFO] [jaxb2:generate {execution: Schema Generation}] > > > > [INFO] The <schemaLanguage> setting was not defined, assuming > 'AUTODETECT'. > > > > [INFO] The <bindingDirectory> setting was not defined, assuming the > > same as > > <schemaDirectory>: D:\Development Dev\CAS\Release\Business > > > > Services\BenefitSchemeClientWS\src\main\resources\com\rajesh\benefit\s > > cheme\ > > wsdl > > > > [INFO] Plugin's mojo parameters: > > > > schemaLanguage: AUTODETECT > > > > schemaDirectory: D:\Development > > Dev\CAS\Release\Business > > > > Services\BenefitSchemeClientWS\src\main\resources\com\rajesh\benefit\s > > cheme\ > > wsdl > > > > schemaIncludes: [*.xsd] > > > > schemaExcludes: null > > > > bindingDirectory: D:\Development > > Dev\CAS\Release\Business > > > > Services\BenefitSchemeClientWS\src\main\resources\com\rajesh\benefit\s > > cheme\ > > wsdl > > > > bindingIncludes: [*.xjb] > > > > bindingExcludes: null > > > > disableDefaultExcludes: false > > > > catalog: null > > > > defaultPackage: > > com.rajesh.health.benefit.scheme.schema > > > > destinationDirectory: D:\Development > > Dev\CAS\Release\Business > > Services\BenefitSchemeClientWS\target\generated-sources\xjc > > > > forceRegenerate: true > > > > otherDepends: null > > > > removeOldOutput: true > > > > writeCode: true > > > > readOnly: false > > > > extension: true > > > > strict: true > > > > verbose: true > > > > debug: false > > > > xjcArgs: [-target, 2.0, -episode, > > D:\Development Dev\CAS\Release\Business > > > > Services\BenefitSchemeClientWS\target\generated-sources\xjc\META-INF\s > > un-jax > > b.episode] > > > > Calculated options: > > > > Schema File(s): [D:\Development > > Dev\CAS\Release\Business > > > > Services\BenefitSchemeClientWS\src\main\resources\com\rajesh\benefit\s > > cheme\ wsdl\BenefitSchemeDomainTypes-1.0.xsd, D:\Development > > Dev\CAS\Release\Business > > > > Services\BenefitSchemeClientWS\src\main\resources\com\rajesh\benefit\s > > cheme\ wsdl\BenefitSchemeExceptionMessage-1.0.xsd, D:\Development > > Dev\CAS\Release\Business > > > > Services\BenefitSchemeClientWS\src\main\resources\com\rajesh\benefit\s > > cheme\ wsdl\BenefitSchemeMessageTypes-1.0.xsd, D:\Development > > Dev\CAS\Release\Business > > > > Services\BenefitSchemeClientWS\src\main\resources\com\rajesh\benefit\s > > cheme\ wsdl\BenefitSchemeSimpleTypes-1.0.xsd, D:\Development > > Dev\CAS\Release\Business > > > > Services\BenefitSchemeClientWS\src\main\resources\com\rajesh\benefit\s > > cheme\ wsdl\GetMostApplicableSchemeExclusionsRequestMessage-1.0.xsd, > > D:\Development > > Dev\CAS\Release\Business > > > > Services\BenefitSchemeClientWS\src\main\resources\com\rajesh\benefit\s > > cheme\ wsdl\GetMostApplicableSchemeExclusionsResponseMessage-1.0.xsd, > > D:\Development Dev\CAS\Release\Business > > > > Services\BenefitSchemeClientWS\src\main\resources\com\rajesh\benefit\s > > cheme\ wsdl\IsMemberExcludedRequestMessage-1.0.xsd, D:\Development > > Dev\CAS\Release\Business > > > > Services\BenefitSchemeClientWS\src\main\resources\com\rajesh\benefit\s > > cheme\ wsdl\IsMemberExcludedResponseMessage-1.0.xsd, D:\Development > > Dev\CAS\Release\Business > > > > Services\BenefitSchemeClientWS\src\main\resources\com\rajesh\benefit\s > > cheme\ > > wsdl\SchemeExclusionIsApplicableByDiagnosisIdRequestMessage-1.0.xsd, > > D:\Development Dev\CAS\Release\Business > > > > Services\BenefitSchemeClientWS\src\main\resources\com\rajesh\benefit\s > > cheme\ > > wsdl\SchemeExclusionIsApplicableByDiagnosisIdResponseMessage-1.0.xsd, > > D:\Development Dev\CAS\Release\Business > > > > Services\BenefitSchemeClientWS\src\main\resources\com\rajesh\benefit\s > > cheme\ wsdl\SchemeExclusionIsApplicableRequestMessage-1.0.xsd, > > D:\Development Dev\CAS\Release\Business > > > > Services\BenefitSchemeClientWS\src\main\resources\com\rajesh\benefit\s > > cheme\ wsdl\SchemeExclusionIsApplicableResponseMessage-1.0.xsd] > > > > Binding File(s): [] > > > > ClassPath: [D:\Development > > Dev\CAS\Release\Business > > Services\BenefitSchemeClientWS\target\classes] > > > > [INFO] Skipped removal of old generateDirectory 'D:\Development > > Dev\CAS\Release\Business > > Services\BenefitSchemeClientWS\target\generated-sources\xjc' since it > > didn't exist. > > > > [INFO] Parsing input schema(s)... > > > > [ERROR] XJC while parsing schema(s) > > > > file:/D:/Development%20Dev/CAS/Release/Business%20Services/BenefitSche > > meClie > > > > ntWS/src/main/resources/za/co/discovery/benefit/scheme/wsdl/BenefitSch > > emeDom > > ainTypes-1.0.xsd[17,39]: org.xml.sax.SAXParseException: > > 'clinicalCodeVO' is already defined > > > > [ERROR] XJC while parsing schema(s) > > > > file:/D:/Development%20Dev/CAS/Release/Business%20Services/BenefitSche > > meClie > > > > ntWS/src/main/resources/za/co/discovery/benefit/scheme/wsdl/BenefitSch > > emeDom > > ainTypes-1.0.xsd[9,41]: org.xml.sax.SAXParseException: (related to > > above > > error) the first definition appears here > > > > > > > > > > > > Successful build while running independently > > > > > > > > [INFO] > > ---------------------------------------------------------------------- > > -- > > > > [INFO] Building BenefitSchemeClientWS > > > > [INFO] task-segment: [clean, generate-sources] > > > > [INFO] > > ---------------------------------------------------------------------- > > -- > > > > [INFO] [clean:clean] > > > > [INFO] Deleting directory D:\Development Dev\CAS\Release\Business > > Services\BenefitSchemeClientWS\target > > > > [INFO] [jaxb2:generate {execution: Schema Generation}] > > > > [INFO] Started execution. > > > > [INFO] JAXB API is loaded from the > > > > > > [jar:file:/D:/.m2/repository/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1.jar!]. > > > > [INFO] Detected JAXB API version [2.1]. > > > > [INFO] > > > > pluginArtifacts:[org.jvnet.jaxb2.maven2:maven-jaxb2-plugin-raw:jar:0.7 > > .1:run time, org.codehaus.plexus:plexus-utils:jar:1.1:runtime, > > org.jfrog.maven.annomojo:maven-plugin-anno:jar:1.3.1:runtime, > > com.sun.xml.bind:jaxb-impl:jar:2.1.10:runtime, > > javax.xml.bind:jaxb-api:jar:2.1:runtime, > > javax.xml.stream:stax-api:jar:1.0-2:runtime, > > javax.activation:activation:jar:1.1:runtime, > > org.jvnet.jaxb2_commons:jaxb-xjc:jar:2.1.10:runtime, > > com.sun.codemodel:codemodel:jar:2.1:runtime, > > com.sun.xml.dtd-parser:dtd-parser:jar:1.0:runtime, > > com.sun.istack:istack-commons-tools:jar:1.1:runtime, > > relaxngDatatype:relaxngDatatype:jar:20020414:runtime, > > com.sun.org.apache.xml.internal:resolver:jar:20050927:runtime, > > org.kohsuke.rngom:rngom:jar:20061207:runtime, > > com.sun.xsom:xsom:jar:20081112:runtime] > > > > [INFO] schemaLanguage:null > > > > [INFO] schemaDirectory:D:\Development Dev\CAS\Release\Business > > > > Services\BenefitSchemeClientWS\src\main\resources\com\rajesh\benefit\s > > cheme\ > > wsdl > > > > [INFO] schemaIncludes:[Ljava.lang.String;@16dadf9 > > > > [INFO] schemaExcludes:null > > > > [INFO] bindingDirectory:D:\Development Dev\CAS\Release\Business > > > > Services\BenefitSchemeClientWS\src\main\resources\com\rajesh\benefit\s > > cheme\ > > wsdl > > > > [INFO] bindingIncludes:[Ljava.lang.String;@1b8d6f7 > > > > [INFO] bindingExcludes:null > > > > [INFO] disableDefaultExcludes:false > > > > [INFO] catalog:null > > > > [INFO] > > > > catalogResolver:com.sun.org.apache.xml.internal.resolver.tools.Catalog > > Resolv > > er > > > > [INFO] generatePackage:com.rajesh.health.benefit.scheme.schema > > > > [INFO] generateDirectory:D:\Development Dev\CAS\Release\Business > > Services\BenefitSchemeClientWS\target\generated-sources\xjc > > > > [INFO] readOnly:false > > > > [INFO] extension:true > > > > [INFO] strict:true > > > > [INFO] writeCode:true > > > > [INFO] verbose:true > > > > [INFO] debug:false > > > > [INFO] args:[-target, 2.0] > > > > [INFO] forceRegenerate:true > > > > [INFO] removeOldOutput:true > > > > [INFO] otherDepends:null > > > > [INFO] episodeFile:D:\Development Dev\CAS\Release\Business > > > > Services\BenefitSchemeClientWS\target\generated-sources\xjc\META-INF\s > > un-jax > > b.episode > > > > [INFO] episode:true > > > > [INFO] classpathElements:[D:\Development Dev\CAS\Release\Business > > Services\BenefitSchemeClientWS\target\classes] > > > > [INFO] plugins:null > > > > [INFO] episodes:null > > > > [INFO] xjcPlugins:null > > > > [INFO] episodes:null > > > > [INFO] specVersion:2.1 > > > > [INFO] schemaFiles (calculated):[D:\Development > > Dev\CAS\Release\Business > > > > Services\BenefitSchemeClientWS\src\main\resources\com\rajesh\benefit\s > > cheme\ wsdl\BenefitSchemeDomainTypes-1.0.xsd, D:\Development > > Dev\CAS\Release\Business > > > > Services\BenefitSchemeClientWS\src\main\resources\com\rajesh\benefit\s > > cheme\ wsdl\BenefitSchemeExceptionMessage-1.0.xsd, D:\Development > > Dev\CAS\Release\Business > > > > Services\BenefitSchemeClientWS\src\main\resources\com\rajesh\benefit\s > > cheme\ wsdl\BenefitSchemeMessageTypes-1.0.xsd, D:\Development > > Dev\CAS\Release\Business > > > > Services\BenefitSchemeClientWS\src\main\resources\com\rajesh\benefit\s > > cheme\ wsdl\BenefitSchemeSimpleTypes-1.0.xsd, D:\Development > > Dev\CAS\Release\Business > > > > Services\BenefitSchemeClientWS\src\main\resources\com\rajesh\benefit\s > > cheme\ wsdl\GetMostApplicableSchemeExclusionsRequestMessage-1.0.xsd, > > D:\Development > > Dev\CAS\Release\Business > > > > Services\BenefitSchemeClientWS\src\main\resources\com\rajesh\benefit\s > > cheme\ wsdl\GetMostApplicableSchemeExclusionsResponseMessage-1.0.xsd, > > D:\Development Dev\CAS\Release\Business > > > > Services\BenefitSchemeClientWS\src\main\resources\com\rajesh\benefit\s > > cheme\ wsdl\IsMemberExcludedRequestMessage-1.0.xsd, D:\Development > > Dev\CAS\Release\Business > > > > Services\BenefitSchemeClientWS\src\main\resources\com\rajesh\benefit\s > > cheme\ wsdl\IsMemberExcludedResponseMessage-1.0.xsd, D:\Development > > Dev\CAS\Release\Business > > > > Services\BenefitSchemeClientWS\src\main\resources\com\rajesh\benefit\s > > cheme\ > > wsdl\SchemeExclusionIsApplicableByDiagnosisIdRequestMessage-1.0.xsd, > > D:\Development Dev\CAS\Release\Business > > > > Services\BenefitSchemeClientWS\src\main\resources\com\rajesh\benefit\s > > cheme\ > > wsdl\SchemeExclusionIsApplicableByDiagnosisIdResponseMessage-1.0.xsd, > > D:\Development Dev\CAS\Release\Business > > > > Services\BenefitSchemeClientWS\src\main\resources\com\rajesh\benefit\s > > cheme\ wsdl\SchemeExclusionIsApplicableRequestMessage-1.0.xsd, > > D:\Development Dev\CAS\Release\Business > > > > Services\BenefitSchemeClientWS\src\main\resources\com\rajesh\benefit\s > > cheme\ wsdl\SchemeExclusionIsApplicableResponseMessage-1.0.xsd] > > > > [INFO] bindingFiles (calculated):[] > > > > [INFO] xjcPluginArtifacts (resolved):[] > > > > [INFO] xjcPluginFiles (resolved):[] > > > > [INFO] xjcPluginURLs (resolved):[] > > > > [INFO] episodeArtifacts (resolved):[] > > > > [INFO] episodeFiles (resolved):[] > > > > [INFO] The schemaLanguage setting was not defined, assuming 'AUTODETECT'. > > > > Looking for META-INF/services/com.sun.tools.xjc.Plugin for add-ons > > > > Checking > > > > jar:file:/D:/.m2/repository/org/jvnet/jaxb2_commons/jaxb-xjc/2.1.10/ja > > xb-xjc -2.1.10.jar!/META-INF/services/com.sun.tools.xjc.Plugin for an > > add-on > > > > Attempting to instanciate > > com.sun.tools.xjc.addon.locator.SourceLocationAddOn > > > > Attempting to instanciate > > com.sun.tools.xjc.addon.sync.SynchronizedMethodAddOn > > > > Attempting to instanciate > > com.sun.tools.xjc.addon.at_generated.PluginImpl > > > > Attempting to instanciate com.sun.tools.xjc.addon.episode.PluginImpl > > > > [INFO] Parsing input schema(s)... > > > > [INFO] Compiling input schema(s)... > > > > [INFO] Writing output to [D:\Development Dev\CAS\Release\Business > > Services\BenefitSchemeClientWS\target\generated-sources\xjc]. > > > > Regards, > > > > Rajesh Rathore > > > > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
