Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring toolsuite shows error on <execution> for maven-jaxb2-plugin

I am using Spring Tool Suite version 3.7.0.RELEASE and I'm trying out an import of a WSDL offered by Amazon. The import succeeds, but Eclipse gives an error message on the tag.

I am using the following 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>blafoo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>blafoo</name>

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.2.5.RELEASE</version>
</parent>

<properties>
    <java.version>1.8</java.version>
</properties>

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.ws</groupId>
        <artifactId>spring-ws-core</artifactId>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
        <!-- tag::wsdl[] -->
        <plugin>
            <groupId>org.jvnet.jaxb2.maven2</groupId>
            <artifactId>maven-jaxb2-plugin</artifactId>
            <version>0.12.3</version>
            <executions>
                <execution>
                    <goals>
                        <goal>generate</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <schemaLanguage>WSDL</schemaLanguage>
                <generatePackage>be.goedkoperzoeken.amazonapi.wsdl</generatePackage>
                <schemas>
                    <schema>
                        <url>http://webservices.amazon.com/AWSECommerceService/AWSECommerceService.wsdl</url>
                    </schema>
                </schemas>
            </configuration>
        </plugin>
        <!-- end::wsdl[] -->
    </plugins>
</build>
</project>

When hovering over this tag, I get the following error message:

Execution default of goal org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.12.3:generate failed: A required class was missing while executing org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.12.3:generate: com/sun/xml/bind/v2/model/core/TypeInfoSet
like image 719
Kristof Avatar asked Dec 01 '22 00:12

Kristof


1 Answers

I was able to fix this by putting my <plugins> inside of a <pluginManagement> tag. Somehow this makes it different for maven and it actually picks up the correct information.

like image 200
Kristof Avatar answered Dec 05 '22 12:12

Kristof