

Define the default java compliance level for maven projects in eclipse
source link: https://www.codesd.com/item/define-the-default-java-compliance-level-for-maven-projects-in-eclipse.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Define the default java compliance level for maven projects in eclipse
The default compliance level for maven is 1.5 and every time that I update a maven project in eclipse it sets back the compliance level from 1.6 to 1.5 which is really annoying for me.
I know that I can set the target to 1.6 in pom file but the problem is that I cannot set this in the parent pom and expect the children to inherit it. So I have to do it for every single maven module. How can I set it in my maven project or in the whole eclipse once for a "lifetime" without modifying every single maven module!?
I know that I can set the target to 1.6 in pom file but the problem is that I cannot set this in the parent pom and expect the children to inherit it.
Setting the <source>
and <target>
version in the parent pom does work.
For example, in my parent pom, I have:
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
</plugins>
</pluginManagement>
If you are having problems, you might want to check that:
- the child specifies the correct version of the parent;
- the parent pom specifies both
source
andtarget
values; - you have run
mvn install
on the parent; and mvn help:effective-pom
on the child project shows the expected source/target values.
After modifying the poms, you may need to select both projects and use Maven->Update Project.
Recommend
-
165
The Eclipse Enterprise for Java Project Top Level Project Charter
-
9
java-version.com: What's new in Java 16? 15? Keep up to date! Minimalistic JSF Java EE 6 tutorial using Maven/Eclipse/TomEE...
-
15
前言 你好,我是A哥(YourBatman)。 做Java开发这么久了,是否曾经疑问过: 为何项目中的xxx.iml、.ide...
-
10
Technical Articles
-
4
How to Define Comparison Operators by Default in C++ Published August 23, 2021 - 0 Comments Implementing com...
-
11
Installing Maven tool support in vanilla Eclipse IDE If you download an Eclipse bundle like the Eclipse IDE for Java EE developers, you’ll get Maven support built in, but if you download a vanilla Eclipse install (like from...
-
8
Not FoundYou just hit a route that doesn't exist... the sadness.LoginRadius empowers businesses to deliver a delightful customer experience and win customer trust. Using the LoginRadius Identity...
-
8
eclipse中maven项目如何部署到tomcat 推荐 原创 是温度呀 2022-09-20 11:27:38
-
2
Wil Ch Jun 23 at 12:25 PM Error FMUP047 in FCH8 - "Define a default account assignment for payments on account in FM" 2...
-
5
This repository is currently not maintained! Eitco Mavenizer Helps you to find or define Maven UIDs for any JAR file and generate corresponding artifact install scripts. How to use There are two mai...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK