Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print warning about insufficient Maven version #708

Closed
eva-mueller-coremedia opened this issue Jan 19, 2025 · 2 comments
Closed

Print warning about insufficient Maven version #708

eva-mueller-coremedia opened this issue Jan 19, 2025 · 2 comments

Comments

@eva-mueller-coremedia
Copy link

eva-mueller-coremedia commented Jan 19, 2025

What feature do you want to see added?

I am not sure if this repository is the correct place. Feel free to point me to the correct one.

Problem

I am building an official Jenkins plugin with Maven 3.9.1 and Java 17 via command line which uses as parent pom

<parent>
  <groupId>org.jenkins-ci.plugins</groupId>
  <artifactId>plugin</artifactId>
  <version>5.3</version>
  <relativePath />
</parent>

I now encounter the following error, when calling mvn clean

Unknown packaging: hpi @ org.jenkins-ci.plugins:PLUGIN:${revision}.${changelist}, /pom.xml, line 13, column 14

[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] Unknown packaging: hpi @ org.jenkins-ci.plugins:PLUGIN:${revision}.${changelist}, <PATH_TO_POM>/pom.xml, line 13, column 14
 @ 
[ERROR] The build could not read 1 project -> [Help 1]
org.apache.maven.project.ProjectBuildingException: Some problems were encountered while processing the POMs:
[ERROR] Unknown packaging: hpi @ org.jenkins-ci.plugins:PLUGIN:${revision}.${changelist}, <PATH_TO_POM>/pom.xml, line 13, column 14

    at org.apache.maven.project.DefaultProjectBuilder.build (DefaultProjectBuilder.java:389)
    at org.apache.maven.graph.DefaultGraphBuilder.collectProjects (DefaultGraphBuilder.java:349)
    at org.apache.maven.graph.DefaultGraphBuilder.getProjectsForMavenReactor (DefaultGraphBuilder.java:340)
    at org.apache.maven.graph.DefaultGraphBuilder.build (DefaultGraphBuilder.java:76)
    at org.apache.maven.DefaultMaven.buildGraph (DefaultMaven.java:448)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:197)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:827)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:272)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:195)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
[ERROR]   
[ERROR]   The project org.jenkins-ci.plugins:PLUGIN:4.999999-SNAPSHOT (<PATH_TO_POM>/pom.xml) has 1 error
[ERROR]     Unknown packaging: hpi @ org.jenkins-ci.plugins:PLUGIN:${revision}.${changelist}, <PATH_TO_POM>/pom.xml, line 13, column 14
[ERROR] 
[ERROR] 

<PATH_TO_POM>/pom.xml, line 13, column 14 is <packaging>hpi</packaging>. I searched for this error in https://community.jenkins.io but did not found an answer solving my problem.

Source Code

I then had a look at the source code and saw

Feature Request

It would be great if the error message would be something like

"The used Maven version (3.9.1) is too old. To build this plugin at least Maven 3.9.6 is required."

Upstream changes

No response

Are you interested in contributing this feature?

No response

@froque
Copy link
Member

froque commented Jan 22, 2025

I was having the same error in IntelliJ IDEA because the bundled Maven version is 3.9.5.

This seems to be the problem:

Since #628, maven-hpi-plugin build produces JDK17 bytecode.

In Maven 3.9.6, apache/maven#1286 was merged. It means that effectively all older Maven versions are unable to grok components produced with byte code level 17.

#667 (comment)

The error is triggered while parsing the POM. I don't see a way to show a proper error message.

@eva-mueller-coremedia
Copy link
Author

I don't see a way to show a proper error message.

Yes, you are right. Thanks for you comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants