What should be the correct way for openjdk 13 maven pom ?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

What should be the correct way for openjdk 13 maven pom ?

Karen Goh
Hi,

I am having problems with maven compiling java openjdk 13 in Eclipse - jee-2019-09, despite following several examples from stackoverflow.

Could someone let me know if there is anything amiss from below pom.xml :

<properties>
                <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
                <maven.compiler.release>13</maven.compiler.release>
                <maven.compiler.source>13</maven.compiler.source>
                <maven.compiler.target>13</maven.compiler.target>
        </properties>

<pluginManagement><!-- lock down plugins versions to avoid using Maven
                                defaults (may be moved to parent pom) -->
                        <plugins>
                                <plugin>
                                        <artifactId>maven-clean-plugin</artifactId>
                                        <version>3.0.0</version>
                                </plugin>
                                <!-- see http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_war_packaging -->
                                <plugin>
                                        <artifactId>maven-resources-plugin</artifactId>
                                        <version>3.0.2</version>
                                </plugin>
                                <plugin>
                                        <artifactId>maven-compiler-plugin</artifactId>
                                        <version>3.8.1</version>
                                        <configuration>
                                                <maven.compiler.release>13</maven.compiler.release>
                                                <compilerArgs>
                                                        --enable-preview
                                                </compilerArgs>
                                        </configuration>
                                </plugin>
                                <plugin>
                                        <artifactId>maven-surefire-plugin</artifactId>
                                        <version>2.20.1</version>
                                </plugin>
                                <plugin>
                                        <artifactId>maven-war-plugin</artifactId>
                                        <version>3.2.0</version>
                                        <configuration>
                                                <warName>xxx</warName>
                                        </configuration>
                                </plugin>
                                <plugin>
                                        <artifactId>maven-install-plugin</artifactId>
                                        <version>2.5.2</version>
                                </plugin>
                                <plugin>
                                        <artifactId>maven-deploy-plugin</artifactId>
                                        <version>2.8.2</version>
                                </plugin>
                        </plugins>
                </pluginManagement>
        </build>


Tks & regards,
Karen


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: What should be the correct way for openjdk 13 maven pom ?

Filipe Sousa
Hi

> On 24 Nov 2019, at 05:01, Karen Goh <[hidden email]> wrote:
>
> Hi,
>
> I am having problems with maven compiling java openjdk 13 in Eclipse - jee-2019-09, despite following several examples from stackoverflow.
>
> Could someone let me know if there is anything amiss from below pom.xml :
>
> <properties>
> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
> <maven.compiler.release>13</maven.compiler.release>
> <maven.compiler.source>13</maven.compiler.source>
> <maven.compiler.target>13</maven.compiler.target>
> </properties>
>
> <pluginManagement><!-- lock down plugins versions to avoid using Maven
> defaults (may be moved to parent pom) -->
> <plugins>
> <plugin>
> <artifactId>maven-clean-plugin</artifactId>
> <version>3.0.0</version>
> </plugin>
> <!-- see http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_war_packaging -->
> <plugin>
> <artifactId>maven-resources-plugin</artifactId>
> <version>3.0.2</version>
> </plugin>
> <plugin>
> <artifactId>maven-compiler-plugin</artifactId>
> <version>3.8.1</version>
> <configuration>
> <maven.compiler.release>13</maven.compiler.release>


The correct parameter is <release>13</release> but can be omitted because it was previously declared in properties
 https://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#release <https://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#release>


> <compilerArgs>
> --enable-preview
> </compilerArgs>
> </configuration>
> </plugin>
> <plugin>
> <artifactId>maven-surefire-plugin</artifactId>
> <version>2.20.1</version>
> </plugin>
> <plugin>
> <artifactId>maven-war-plugin</artifactId>
> <version>3.2.0</version>
> <configuration>
> <warName>xxx</warName>
> </configuration>
> </plugin>
> <plugin>
> <artifactId>maven-install-plugin</artifactId>
> <version>2.5.2</version>
> </plugin>
> <plugin>
> <artifactId>maven-deploy-plugin</artifactId>
> <version>2.8.2</version>
> </plugin>
> </plugins>
> </pluginManagement>
> </build>
>
>
> Tks & regards,
> Karen
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

Reply | Threaded
Open this post in threaded view
|

Re: What should be the correct way for openjdk 13 maven pom ?

Michael Osipov-2
In reply to this post by Karen Goh
Am 2019-11-24 um 06:01 schrieb Karen Goh:
> Hi,
>
> I am having problems with maven compiling java openjdk 13 in Eclipse - jee-2019-09, despite following several examples from stackoverflow.

You cannot compile OpenJDK with Maven. OpenJDK uses a GNU autoconf/gmake
setup.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]