Is Maven ready for JDK9?

后端 未结 6 1005
梦谈多话
梦谈多话 2020-11-27 16:58

Today I tried the latest jdk9 Build 113 and tried to compile my project with the latest Maven 3.3.9

These are the commands (found partially via twitter)



        
相关标签:
6条回答
  • 2020-11-27 17:18

    The Java doc plugin still have issues in the last version. (3.0.0.M1)

    0 讨论(0)
  • 2020-11-27 17:20

    Update: should work without this workaround now.

    The problem is already fixed from the plexus archiver team, but not yet released - thanks to Michael-O for pointing me to the right place :) !

    Now there is a workaround posted from ctomc in PR 12 to use an old plexus archiver version 2.4.4.:

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <version>2.4.1</version>                    
        <dependencies>
            <dependency>
                <groupId>org.codehaus.plexus</groupId>
                <artifactId>plexus-archiver</artifactId>
                <version>2.4.4</version>
            </dependency>
        </dependencies>
    </plugin>
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>2.6</version>
        <dependencies>
            <dependency>
                <groupId>org.codehaus.plexus</groupId>
                <artifactId>plexus-archiver</artifactId>
                <version>2.4.4</version>
            </dependency>
        </dependencies>
    </plugin>
    
    0 讨论(0)
  • 2020-11-27 17:27

    Here is the answer from one Maven PMC member (me):

    No, it is not. Robert Scholte is working on it. Jigsaw and other stuff introduced a lot of changes. There is no official timeframe where full compat (Maven + official plugins) will be given.

    The issue you see is actually not Maven but Plexus Archiver. Refer to their GitHub page. If you think you can add value, contact maven-dev mailing list.

    Progress documentation: https://cwiki.apache.org/confluence/display/MAVEN/Java+9+-+Jigsaw

    0 讨论(0)
  • 2020-11-27 17:27

    I think maven is ready now, for me the following snippet is able to tell maven to use java 9 :

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.7.0</version>
                <configuration>
                    <source>9</source>
                    <target>9</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
    
    0 讨论(0)
  • 2020-11-27 17:29

    Yes, it is ready now. Still some things in progress, but generally usable. Check out a project of mine as example.

    0 讨论(0)
  • 2020-11-27 17:37

    I had the same issue and the latest maven-javadoc-plugin that was published recently fixed it. Updated the dependency in the pom file to <version>3.0.0-M1</version>

    0 讨论(0)
提交回复
热议问题