0
<!-- tag::wsdl[] -->
<plugin>
    <groupId>org.jvnet.jaxb2.maven2</groupId>
    <artifactId>maven-jaxb2-plugin</artifactId>
    <version>0.12.3</version>
    <executions>
        <execution>
            <id>firstrun</id>
            <phase>generate-sources</phase>
            <goals>
                <goal>generate</goal>
            </goals>
            <configuration>
                <schemaLanguage>WSDL</schemaLanguage>
                <generatePackage>my.package.osb.services.wsdl1</generatePackage>
                <schemas>
                    <schema>
                        <url>http://x.x.x.x:8002/wsdl1?wsdl</url>
                    </schema>
                </schemas>
            </configuration>
        </execution>
        <execution>
            <id>secondrun</id>
            <phase>generate-sources</phase>
            <goals>
                <goal>generate</goal>
            </goals>
            <configuration>
            <schemaLanguage>WSDL</schemaLanguage>
            <generatePackage>my.package.osb.services.wsdl2</generatePackage>
            <schemas>
                <schema>
                    <url>http://x.x.x.x:8002/wsdl2?wsdl</url>
                </schema>
            </schemas>
            </configuration>
        </execution>
    </executions>
</plugin>
<!-- end::wsdl[] -->

My understanding is that the above should generate the POJOs described in the two URLS in two different packages.

I don't understand why it does not work. The error I am getting after mvn jaxb2:generate is No schemas to compile. Skipping XJC execution.

Can one please provide a complete solution on how to do this properly but with WSDL urls?

Josef Reichardt
  • 2,778
  • 3
  • 22
  • 37
idipous
  • 2,868
  • 3
  • 30
  • 45
  • 1
    it would help commenting on the downvote to avoid the same bad question in the future. – idipous Oct 05 '16 at 08:06
  • Post the full `mvn -X clean install`. Otherwise the config looks fine. Here's one of the test projects. Maybe try to upgrade to `0.13.1`. – lexicore Oct 06 '16 at 06:53

1 Answers1

0

If you run mvn jaxb2:generate maven doesn't use the configuration inside the execution.

You have already declared a phase on which your executions should be bound, so just run mvn generate-sources.

https://maven.apache.org/guides/mini/guide-configuring-plugins.html#Using_the_executions_Tag says:

Note: Configurations inside the <executions> tag differ from those that are outside <executions> in that they cannot be used from a direct command line invocation. Instead they are only applied when the lifecycle phase they are bound to are invoked. Alternatively, if you move a configuration section outside of the executions section, it will apply globally to all invocations of the plugin.

Josef Reichardt
  • 2,778
  • 3
  • 22
  • 37
  • When I give `mvn generate-sources` nothing happens. – idipous Oct 05 '16 at 22:47
  • This would be another problem... If the executions are bound to the lifecycle phase then they should be executed by maven. any logs? – Josef Reichardt Oct 06 '16 at 09:02
  • Nothing helpful. I resorted to another plugin and it worked. The error might have been that I had the whole plugin decleration in the plugin manager. Because that was what it took for the other plugin to work. I will test with the above configuration and update the question – idipous Oct 06 '16 at 09:29