Open aduilio opened 1 year ago
I am also facing same issue do u find solution?
@Ikrao I noticed this is a warning and not an error. I just add this option to remove the logs:
<configuration>
<quiet>yes<quiet>
</configuration>
<plugin>
<groupId>com.evolvedbinary.maven.jvnet</groupId>
<artifactId>jaxb30-maven-plugin</artifactId>
<version>0.15.0</version>
<dependencies>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>2.3.1</version>
</dependency>
</dependencies>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<configuration>
<schemaDirectory>${resourcePath}/wsdl/</schemaDirectory>
<schemaIncludes>
<include>*.wsdl</include>
</schemaIncludes>
<quiet>yes</quiet>
</configuration>
</plugin>
still same issue:
[INFO] --- jaxb30-maven-plugin:0.15.0:generate (default) @ ---
[INFO] Sources are not up-to-date, XJC will be executed.
[ERROR] Error while parsing schema(s).Location [ file:/C:/xxxxx//xxxxxxx.wsdl{11,51}].
org.xml.sax.SAXParseException: s4s-elt-schema-ns: The namespace of element 'definitions' must be from the schema namespace, 'http://www.w3.org/2001/XMLSchema'.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException (ErrorHandlerWrapper.java:204)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error (ErrorHandlerWrapper.java:135)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError (XMLErrorReporter.java:396)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSchemaErr (XSDHandler.java:4254)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSchemaError (XSDHandler.java:4237)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSAttributeChecker.reportSchemaError (XSAttributeChecker.java:1573)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSAttributeChecker.checkAttributes (XSAttributeChecker.java:993)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSAttributeChecker.checkAttributes (XSAttributeChecker.java:960)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDocumentInfo.
It worked for me with the following configuration:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<version>3.1.0</version>
<!-- https://github.com/mojohaus/jaxb2-maven-plugin/issues/245 -->
<dependencies>
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>3.0.1</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-xjc</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-jxc</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.1</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>xjc</id>
<goals>
<goal>xjc</goal>
</goals>
</execution>
</executions>
<configuration>
<sources>
<source>yourPathToWsdl</source>
</sources>
<sourceType>wsdl</sourceType>
<outputDirectory>yourDirectory</outputDirectory>
<packageName>yourPackageName</packageName>
<laxSchemaValidation>true</laxSchemaValidation>
<failOnNoSchemas>false</failOnNoSchemas>
<xjbSources>
<xjbSource>pathToBindingXjc</xjbSource>
</xjbSources>
</configuration>
</plugin>
Hi is there a solution/workaround for this error? I am seeing same error with plugin v3.1.0 using Java 17 as I am in process of upgrading my app from java 1.8 to 17.
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>autogen-public-classes</id>
<phase>validate</phase>
<goals>
<goal>xjc</goal>
</goals>
<configuration>
<sources>
<source>src/main/resources/wsdl/open</source>
</sources>
<packageName>xxx</packageName>
<sourceType>wsdl</sourceType>
<outputDirectory>target/generated-sources/xxx</outputDirectory>
<clearOutputDir>true</clearOutputDir>
</configuration>
</execution>
</executions>
</plugin>
I'm using the version 2.5.0 and it is working properly. I'm trying to update to the version 3.1.0, because I need to generate the Java classes with Jakarta packages instead of javax ones. I've tried the solution described here #171, changing the dependencies and I have the same behaviour when using the plugin 3.1.0:
Actually what I need is: generate Java classes with Jakarta packages from WSDL files, not matter the plugin version.