RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1877716 - Change default source and target to 1.6
Summary: Change default source and target to 1.6
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: maven-3.6-module
Version: 8.3
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: rc
: 8.0
Assignee: Mikolaj Izdebski
QA Contact: RHEL CS Apps Subsystem QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-09-10 09:45 UTC by Martin Kyral
Modified: 2020-12-16 08:37 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-11-18 08:51:22 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Martin Kyral 2020-09-10 09:45:45 UTC
Description of problem:
Maven before 3.8.0 uses default source and target version 1.5. But JDK 9+ can't compile with these settings. As a result, project generated with maven:3.6 / java 11 can't be built with maven:3.6 / java 11 - which seems odd.

Workaround is to change the defaults manually or setting the values in the project.

https://maven.apache.org/plugins/maven-compiler-plugin/examples/set-compiler-source-and-target.html


Version-Release number of selected component (if applicable):
maven-3.6.2-5.module+el8.3.0+6804+157bd82e

How reproducible:
Always

Steps to Reproduce:
1. mvn -e -V archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
2. cd my-app
3. mvn -e -V package

Actual results:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project my-app: Compilation failure: Compilation failure: 
[ERROR] Source option 5 is no longer supported. Use 6 or later.
[ERROR] Target option 1.5 is no longer supported. Use 1.6 or later.


Expected results:
Success


Additional info:

Comment 1 Mikolaj Izdebski 2020-09-10 10:38:46 UTC
I don't think it's a problem with maven module, but rather with the project generated by old, obsolete version of archetype being used.
Since explicit version of maven-archetype-quickstart is not specifed, an old version (1.0) is used. That version generates maven project that is not compliant with current best practices and therefore fails to build with Maven 3.6 and Java 11.
I would recommend to set explicit version of the archetype to the latest available version by passing -DarchetypeVersion=1.4 argument to the command in step 1.

Comment 2 Martin Kyral 2020-09-11 11:28:13 UTC
Thanks for the hint. It fixed the issue with the test. However, I still think that the defaults (archetype version in this case) should be sane - ie. generated project should be buildable without the need to pass additional parameters. Of course, priority of this bug is very low (unless a customer complains about it).

Comment 4 Mikolaj Izdebski 2020-11-18 08:51:22 UTC
I believe that our maven package should use the same defaults as upstream Maven, that is source/target 1.5 for Maven 3.6
Our package works as intended in this regard, so there is nothing to be fixed. Closing as NOTABUG.


Note You need to log in before you can comment on or make changes to this bug.