spring - mvn jax2b not generating java classes from wsdl -
in spring project, following this tutorial have following in pom.xml
<?xml version="1.0" encoding="utf-8"?> <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelversion>4.0.0</modelversion> <groupid>com.example</groupid> <artifactid>demo</artifactid> <version>0.0.1-snapshot</version> <packaging>jar</packaging> <name>soaptest</name> <description>demo project spring boot</description> <parent> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-parent</artifactid> <version>1.4.0.release</version> <relativepath/> <!-- lookup parent repository --> </parent> <properties> <project.build.sourceencoding>utf-8</project.build.sourceencoding> <project.reporting.outputencoding>utf-8</project.reporting.outputencoding> <java.version>1.8</java.version> </properties> <dependencies> <dependency> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-web</artifactid> </dependency> <dependency> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-test</artifactid> <scope>test</scope> </dependency> <dependency> <groupid>com.sun.xml.bind</groupid> <artifactid>jaxb-impl</artifactid> <version>2.2.11</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-maven-plugin</artifactid> </plugin> <plugin> <groupid>org.jvnet.jaxb2.maven2</groupid> <artifactid>maven-jaxb2-plugin</artifactid> <version>0.13.1</version> <executions> <execution> <goals> <goal>generate</goal> </goals> </execution> </executions> <configuration> <schemalanguage>wsdl</schemalanguage> <generatepackage>com.example</generatepackage> <schemas> <schema> <url>http://wsf.cdyne.com/weatherws/weather.asmx?wsdl</url> </schema> </schemas> </configuration> </plugin> </plugins> </build> </project>
according tutorial java class generation part of project build still can't see java classes generated project.
i've tried mvn package
, mvn clean compile
not luck there. idea missing here?
edit 1: here exception output when put plugin outside pluginmanagement
execution default of goal org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.13.1:generate failed: required class missing while executing org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.13.1:generate: com/sun/xml/bind/v2/model/core/typeinfoset ----------------------------------------------------- realm = plugin>org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.13.1-1903499108 strategy = org.codehaus.plexus.classworlds.strategy.selffirststrategy urls[0] = file:/c:/users/arash.jahromi/.m2/repository/org/jvnet/jaxb2/maven2/maven-jaxb2-plugin/0.13.1/maven-jaxb2-plugin-0.13.1.jar urls[1] = file:/c:/users/arash.jahromi/.m2/repository/org/jvnet/jaxb2/maven2/maven-jaxb2-plugin-core/0.13.1/maven-jaxb2-plugin-core-0.13.1.jar urls[2] = file:/c:/users/arash.jahromi/.m2/repository/org/apache/commons/commons-lang3/3.2.1/commons-lang3-3.2.1.jar urls[3] = file:/c:/users/arash.jahromi/.m2/repository/com/sun/org/apache/xml/internal/resolver/20050927/resolver-20050927.jar urls[4] = file:/c:/users/arash.jahromi/.m2/repository/junit/junit/4.8.1/junit-4.8.1.jar urls[5] = file:/c:/users/arash.jahromi/.m2/repository/org/codehaus/plexus/plexus-utils/1.5.15/plexus-utils-1.5.15.jar urls[6] = file:/c:/users/arash.jahromi/.m2/repository/org/jvnet/jaxb2/maven2/maven-jaxb22-plugin/0.13.1/maven-jaxb22-plugin-0.13.1.jar urls[7] = file:/c:/users/arash.jahromi/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.2.11/jaxb-runtime-2.2.11.jar urls[8] = file:/c:/users/arash.jahromi/.m2/repository/org/glassfish/jaxb/jaxb-xjc/2.2.11/jaxb-xjc-2.2.11.jar urls[9] = file:/c:/users/arash.jahromi/.m2/repository/org/apache/maven/plugin-tools/maven-plugin-annotations/3.4/maven-plugin-annotations-3.4.jar number of foreign imports: 5 import: entry[import org.sonatype.plexus.build.incremental realm classrealm[plexus.core, parent: null]] import: entry[import org.codehaus.plexus.util.scanner realm classrealm[plexus.core, parent: null]] import: entry[import org.codehaus.plexus.util.directoryscanner realm classrealm[plexus.core, parent: null]] import: entry[import org.codehaus.plexus.util.abstractscanner realm classrealm[plexus.core, parent: null]] import: entry[import realm classrealm[maven.api, parent: null]] ----------------------------------------------------- (org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.13.1:generate:default:generate-sources) org.apache.maven.plugin.pluginexecutionexception: execution default of goal org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.13.1:generate failed: required class missing while executing org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.13.1:generate: com/sun/xml/bind/v2/model/core/typeinfoset ----------------------------------------------------- realm = plugin>org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.13.1-1903499108 strategy = org.codehaus.plexus.classworlds.strategy.selffirststrategy urls[0] = file:/c:/users/arash.jahromi/.m2/repository/org/jvnet/jaxb2/maven2/maven-jaxb2-plugin/0.13.1/maven-jaxb2-plugin-0.13.1.jar urls[1] = file:/c:/users/arash.jahromi/.m2/repository/org/jvnet/jaxb2/maven2/maven-jaxb2-plugin-core/0.13.1/maven-jaxb2-plugin-core-0.13.1.jar urls[2] = file:/c:/users/arash.jahromi/.m2/repository/org/apache/commons/commons-lang3/3.2.1/commons-lang3-3.2.1.jar urls[3] = file:/c:/users/arash.jahromi/.m2/repository/com/sun/org/apache/xml/internal/resolver/20050927/resolver-20050927.jar urls[4] = file:/c:/users/arash.jahromi/.m2/repository/junit/junit/4.8.1/junit-4.8.1.jar urls[5] = file:/c:/users/arash.jahromi/.m2/repository/org/codehaus/plexus/plexus-utils/1.5.15/plexus-utils-1.5.15.jar urls[6] = file:/c:/users/arash.jahromi/.m2/repository/org/jvnet/jaxb2/maven2/maven-jaxb22-plugin/0.13.1/maven-jaxb22-plugin-0.13.1.jar urls[7] = file:/c:/users/arash.jahromi/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.2.11/jaxb-runtime-2.2.11.jar urls[8] = file:/c:/users/arash.jahromi/.m2/repository/org/glassfish/jaxb/jaxb-xjc/2.2.11/jaxb-xjc-2.2.11.jar urls[9] = file:/c:/users/arash.jahromi/.m2/repository/org/apache/maven/plugin-tools/maven-plugin-annotations/3.4/maven-plugin-annotations-3.4.jar number of foreign imports: 5 import: entry[import org.sonatype.plexus.build.incremental realm classrealm[plexus.core, parent: null]] import: entry[import org.codehaus.plexus.util.scanner realm classrealm[plexus.core, parent: null]] import: entry[import org.codehaus.plexus.util.directoryscanner realm classrealm[plexus.core, parent: null]] import: entry[import org.codehaus.plexus.util.abstractscanner realm classrealm[plexus.core, parent: null]] import: entry[import realm classrealm[maven.api, parent: null]] ----------------------------------------------------- @ org.apache.maven.plugin.defaultbuildpluginmanager.executemojo(defaultbuildpluginmanager.java:168) @ org.eclipse.m2e.core.internal.embedder.mavenimpl.execute(mavenimpl.java:331) @ org.eclipse.m2e.core.internal.embedder.mavenimpl$11.call(mavenimpl.java:1362) @ org.eclipse.m2e.core.internal.embedder.mavenimpl$11.call(mavenimpl.java:1) @ org.eclipse.m2e.core.internal.embedder.mavenexecutioncontext.executebare(mavenexecutioncontext.java:176) @ org.eclipse.m2e.core.internal.embedder.mavenexecutioncontext.execute(mavenexecutioncontext.java:112) @ org.eclipse.m2e.core.internal.embedder.mavenimpl.execute(mavenimpl.java:1360) @ org.eclipse.m2e.core.project.configurator.mojoexecutionbuildparticipant.build(mojoexecutionbuildparticipant.java:52) @ org.eclipse.m2e.core.internal.builder.mavenbuilderimpl.build(mavenbuilderimpl.java:137) @ org.eclipse.m2e.core.internal.builder.mavenbuilder$1.method(mavenbuilder.java:172) @ org.eclipse.m2e.core.internal.builder.mavenbuilder$1.method(mavenbuilder.java:1) @ org.eclipse.m2e.core.internal.builder.mavenbuilder$buildmethod$1$1.call(mavenbuilder.java:115) @ org.eclipse.m2e.core.internal.embedder.mavenexecutioncontext.executebare(mavenexecutioncontext.java:176) @ org.eclipse.m2e.core.internal.embedder.mavenexecutioncontext.execute(mavenexecutioncontext.java:112) @ org.eclipse.m2e.core.internal.builder.mavenbuilder$buildmethod$1.call(mavenbuilder.java:105) @ org.eclipse.m2e.core.internal.embedder.mavenexecutioncontext.executebare(mavenexecutioncontext.java:176) @ org.eclipse.m2e.core.internal.embedder.mavenexecutioncontext.execute(mavenexecutioncontext.java:151) @ org.eclipse.m2e.core.internal.embedder.mavenexecutioncontext.execute(mavenexecutioncontext.java:99) @ org.eclipse.m2e.core.internal.builder.mavenbuilder$buildmethod.execute(mavenbuilder.java:86) @ org.eclipse.m2e.core.internal.builder.mavenbuilder.build(mavenbuilder.java:200) @ org.eclipse.core.internal.events.buildmanager$2.run(buildmanager.java:735) @ org.eclipse.core.runtime.saferunner.run(saferunner.java:42) @ org.eclipse.core.internal.events.buildmanager.basicbuild(buildmanager.java:206) @ org.eclipse.core.internal.events.buildmanager.basicbuild(buildmanager.java:246) @ org.eclipse.core.internal.events.buildmanager$1.run(buildmanager.java:301) @ org.eclipse.core.runtime.saferunner.run(saferunner.java:42) @ org.eclipse.core.internal.events.buildmanager.basicbuild(buildmanager.java:304) @ org.eclipse.core.internal.events.buildmanager.basicbuildloop(buildmanager.java:360) @ org.eclipse.core.internal.events.buildmanager.build(buildmanager.java:383) @ org.eclipse.core.internal.events.autobuildjob.dobuild(autobuildjob.java:144) @ org.eclipse.core.internal.events.autobuildjob.run(autobuildjob.java:235) @ org.eclipse.core.internal.jobs.worker.run(worker.java:55) caused by: org.apache.maven.plugin.plugincontainerexception: required class missing while executing org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.13.1:generate: com/sun/xml/bind/v2/model/core/typeinfoset ----------------------------------------------------- realm = plugin>org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.13.1-1903499108 strategy = org.codehaus.plexus.classworlds.strategy.selffirststrategy urls[0] = file:/c:/users/arash.jahromi/.m2/repository/org/jvnet/jaxb2/maven2/maven-jaxb2-plugin/0.13.1/maven-jaxb2-plugin-0.13.1.jar urls[1] = file:/c:/users/arash.jahromi/.m2/repository/org/jvnet/jaxb2/maven2/maven-jaxb2-plugin-core/0.13.1/maven-jaxb2-plugin-core-0.13.1.jar urls[2] = file:/c:/users/arash.jahromi/.m2/repository/org/apache/commons/commons-lang3/3.2.1/commons-lang3-3.2.1.jar urls[3] = file:/c:/users/arash.jahromi/.m2/repository/com/sun/org/apache/xml/internal/resolver/20050927/resolver-20050927.jar urls[4] = file:/c:/users/arash.jahromi/.m2/repository/junit/junit/4.8.1/junit-4.8.1.jar urls[5] = file:/c:/users/arash.jahromi/.m2/repository/org/codehaus/plexus/plexus-utils/1.5.15/plexus-utils-1.5.15.jar urls[6] = file:/c:/users/arash.jahromi/.m2/repository/org/jvnet/jaxb2/maven2/maven-jaxb22-plugin/0.13.1/maven-jaxb22-plugin-0.13.1.jar urls[7] = file:/c:/users/arash.jahromi/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.2.11/jaxb-runtime-2.2.11.jar urls[8] = file:/c:/users/arash.jahromi/.m2/repository/org/glassfish/jaxb/jaxb-xjc/2.2.11/jaxb-xjc-2.2.11.jar urls[9] = file:/c:/users/arash.jahromi/.m2/repository/org/apache/maven/plugin-tools/maven-plugin-annotations/3.4/maven-plugin-annotations-3.4.jar number of foreign imports: 5 import: entry[import org.sonatype.plexus.build.incremental realm classrealm[plexus.core, parent: null]] import: entry[import org.codehaus.plexus.util.scanner realm classrealm[plexus.core, parent: null]] import: entry[import org.codehaus.plexus.util.directoryscanner realm classrealm[plexus.core, parent: null]] import: entry[import org.codehaus.plexus.util.abstractscanner realm classrealm[plexus.core, parent: null]] import: entry[import realm classrealm[maven.api, parent: null]] ----------------------------------------------------- @ org.apache.maven.plugin.defaultbuildpluginmanager.executemojo(defaultbuildpluginmanager.java:166) ... 31 more caused by: java.lang.noclassdeffounderror: com/sun/xml/bind/v2/model/core/typeinfoset @ java.lang.classloader.defineclass1(native method) @ java.lang.classloader.defineclass(unknown source) @ java.security.secureclassloader.defineclass(unknown source) @ java.net.urlclassloader.defineclass(unknown source) @ java.net.urlclassloader.access$100(unknown source) @ java.net.urlclassloader$1.run(unknown source) @ java.net.urlclassloader$1.run(unknown source) @ java.security.accesscontroller.doprivileged(native method) @ java.net.urlclassloader.findclass(unknown source) @ org.codehaus.plexus.classworlds.realm.classrealm.loadclassfromself(classrealm.java:401) @ org.codehaus.plexus.classworlds.strategy.selffirststrategy.loadclass(selffirststrategy.java:42) @ org.codehaus.plexus.classworlds.realm.classrealm.unsynchronizedloadclass(classrealm.java:271) @ org.codehaus.plexus.classworlds.realm.classrealm.loadclass(classrealm.java:247) @ org.codehaus.plexus.classworlds.realm.classrealm.loadclass(classrealm.java:239) @ java.lang.class.getdeclaredmethods0(native method) @ java.lang.class.privategetdeclaredmethods(unknown source) @ java.lang.class.getdeclaredmethods(unknown source) @ com.google.inject.spi.injectionpoint.getinjectionpoints(injectionpoint.java:688) @ com.google.inject.spi.injectionpoint.forinstancemethodsandfields(injectionpoint.java:380) @ com.google.inject.internal.constructorbindingimpl.getinternaldependencies(constructorbindingimpl.java:164) @ com.google.inject.internal.injectorimpl.getinternaldependencies(injectorimpl.java:613) @ com.google.inject.internal.injectorimpl.cleanup(injectorimpl.java:569) @ com.google.inject.internal.injectorimpl.initializejitbinding(injectorimpl.java:555) @ com.google.inject.internal.injectorimpl.createjustintimebinding(injectorimpl.java:884) @ com.google.inject.internal.injectorimpl.createjustintimebindingrecursive(injectorimpl.java:805) @ com.google.inject.internal.injectorimpl.getjustintimebinding(injectorimpl.java:282) @ com.google.inject.internal.injectorimpl.getbindingorthrow(injectorimpl.java:214) @ com.google.inject.internal.injectorimpl.getproviderorthrow(injectorimpl.java:1006) @ com.google.inject.internal.injectorimpl.getprovider(injectorimpl.java:1038) @ com.google.inject.internal.injectorimpl.getprovider(injectorimpl.java:1001) @ com.google.inject.internal.injectorimpl.getinstance(injectorimpl.java:1051) @ org.eclipse.sisu.space.abstractdeferredclass.get(abstractdeferredclass.java:48) @ com.google.inject.internal.providerinternalfactory.provision(providerinternalfactory.java:81) @ com.google.inject.internal.internalfactorytoinitializableadapter.provision(internalfactorytoinitializableadapter.java:53) @ com.google.inject.internal.providerinternalfactory$1.call(providerinternalfactory.java:65) @ com.google.inject.internal.provisionlistenerstackcallback$provision.provision(provisionlistenerstackcallback.java:115) @ org.eclipse.sisu.bean.beanscheduler$activator.onprovision(beanscheduler.java:176) @ com.google.inject.internal.provisionlistenerstackcallback$provision.provision(provisionlistenerstackcallback.java:126) @ com.google.inject.internal.provisionlistenerstackcallback.provision(provisionlistenerstackcallback.java:68) @ com.google.inject.internal.providerinternalfactory.circularget(providerinternalfactory.java:63) @ com.google.inject.internal.internalfactorytoinitializableadapter.get(internalfactorytoinitializableadapter.java:45) @ com.google.inject.internal.injectorimpl$2$1.call(injectorimpl.java:1016) @ com.google.inject.internal.injectorimpl.callincontext(injectorimpl.java:1092) @ com.google.inject.internal.injectorimpl$2.get(injectorimpl.java:1012) @ org.eclipse.sisu.inject.guice4$1.get(guice4.java:162) @ org.eclipse.sisu.inject.lazybeanentry.getvalue(lazybeanentry.java:81) @ org.eclipse.sisu.plexus.lazyplexusbean.getvalue(lazyplexusbean.java:51) @ org.codehaus.plexus.defaultplexuscontainer.lookup(defaultplexuscontainer.java:263) @ org.codehaus.plexus.defaultplexuscontainer.lookup(defaultplexuscontainer.java:255) @ org.apache.maven.plugin.internal.defaultmavenpluginmanager.getconfiguredmojo(defaultmavenpluginmanager.java:517) @ org.apache.maven.plugin.defaultbuildpluginmanager.executemojo(defaultbuildpluginmanager.java:121) ... 31 more caused by: java.lang.classnotfoundexception: com.sun.xml.bind.v2.model.core.typeinfoset @ org.codehaus.plexus.classworlds.strategy.selffirststrategy.loadclass(selffirststrategy.java:50) @ org.codehaus.plexus.classworlds.realm.classrealm.unsynchronizedloadclass(classrealm.java:271) @ org.codehaus.plexus.classworlds.realm.classrealm.loadclass(classrealm.java:247) @ org.codehaus.plexus.classworlds.realm.classrealm.loadclass(classrealm.java:239) ... 82 more
the maven pluginmanagement
tells maven, plugin should use, when called in pom inside of plugins section. pluginmanagement
never executed directly. have put code outside of pluginmanagement` , fix exception.
from maven-pom-reference:
pluginmanagement: element seen along side plugins. plugin management contains plugin elements in same way, except rather configuring plugin information particular project build, intended configure project builds inherit one. however, configures plugins referenced within plugins element in children. children have every right override pluginmanagement definitions.
if post here, can try you.
update: exception, because dependency missing class missing while executing org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.13.1:generate: com/sun/xml/bind/v2/model/core/typeinfoset
. add
<!-- https://mvnrepository.com/artifact/com.sun.xml.bind/jaxb-osgi --> <dependency> <groupid>com.sun.xml.bind</groupid> <artifactid>jaxb-osgi</artifactid> <version>2.2.11</version> </dependency>
to pom.xml , should work.
Comments
Post a Comment