simpligility / android-maven-plugin

Maven Plugin for Android Application development and more
http://simpligility.github.io/android-maven-plugin/
Apache License 2.0
1.05k stars 394 forks source link

A required class was missing javax/xml/bind/annotation/XmlSchema #798

Open hohwille opened 3 years ago

hohwille commented 3 years ago
[ERROR] Failed to execute goal com.simpligility.maven.plugins:android-maven-plugin:4.6.0:generate-sources (default-generate-sources) on project mmm-ui-android-tab: Execution default-generate-sources of goal com.simpligility.maven.plugins:android-maven-plugin:4.6.0:generate-sources failed: A required class was missing while executing com.simpligility.maven.plugins:android-maven-plugin:4.6.0:generate-sources: javax/xml/bind/annotation/XmlSchema

To me it seems this plugin does not work with Java11 but only unsupported and outdated Java8 versions... https://github.com/simpligility/android-maven-plugin/blob/master/.travis.yml#L5

Could you consider adding support for JDK 11? Hint: https://github.com/devonfw/devon4j/blob/master/documentation/guide-jdk.asciidoc#upgrading

pawellabaj commented 3 years ago

Is there any workaround for the issue except downgrading JDK?

Robin479 commented 3 years ago

The XML API has been deprecated and removed from the JRE since Java 9, because it was too heavy and better suited to be an external library/module. That said: You need to define a dependency onto javax.xml.bind:jaxb-api:2.3.1 to have it back in your classpath, if you are using JDK 9 or above, e.g.

<profile>
    <id>JDK9+</id>
    <activation>
        <jdk>[9,)</jdk>
    </activation>
    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>com.simpligility.maven.plugins</groupId>
                    <artifactId>android-maven-plugin</artifactId>
                    <dependencies>
                        <dependency>
                            <groupId>javax.xml.bind</groupId>
                            <artifactId>jaxb-api</artifactId>
                            <version>2.3.1</version>
                        </dependency>
                    </dependencies>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
</profile>