apache / apache/netbeans

Maven super POM properties took from bundled version even if another is specified in settings

Open
#4,722 0 comments 0 reactions 0 assignees View on GitHub
kind:bug Maven needs:triage
Dominant language
Java
Stars
3.1k
Forks
935
Avg merge
2d 3h
Merged PRs (30d)
17

Description

### Apache NetBeans version

Apache NetBeans 15

### What happened

Opening a project POM, under "Effective" tab, complete POM is showed, so properties from superPOM too. Problem is those properties are always from the bundled version (C:/Program Files/NetBeans-15/netbeans/java/maven/lib/maven-model-builder-3.8.6.jar!/org/apache/maven/model/pom-4.0.0.xml), even if in Tools -> Options -> Java -> Maven I unchecked "Prefer maven wrapper that comes with the project" and used another maven installation, placed in a separate directory from Netbeans folders.

I tried version 3.8.6 (same as bundled one) and 3.6.3. (for the external 3.8.6 version I changed some version number in !/org/apache/maven/model/pom-4.0.0.xml to check if it got the updated properties)
Changed version, restarted Netbeans, same problem.
Closed Netbeans, cleared cache, same problem.

So i tried removing maven-model-builder-3.8.6.jar from C:/Program Files/NetBeans-15/netbeans/java/maven/lib (the bundled one) but netbeans closed all maven projects and threw exception (attached), and again every time I tried to open a maven project.

I tried creating a new maven project, same problem.

[NetBeans Exception.txt](https://github.com/apache/netbeans/files/9693433/NetBeans.Exception.txt)
![Screenshot_212](https://user-images.githubusercontent.com/82662790/193474888-f05a3ecd-69c0-4964-8d44-0189b2beb52d.png)

### How to reproduce

_No response_

### Did this work correctly in an earlier version?

No / Don't know

### Operating System

Windows 10 21H2 19044.2006

### JDK

openjdk version "17.0.4" 2022-07-19 OpenJDK Runtime Environment GraalVM CE 22.2.0 (build 17.0.4+8-jvmci-22.2-b06) OpenJDK 64-Bit Server VM GraalVM CE 22.2.0 (build 17.0.4+8-jvmci-22.2-b06, mixed mode, sharing)

### Apache NetBeans packaging

Apache NetBeans provided installer

### Anything else

_No response_

### Are you willing to submit a pull request?

No

### Code of Conduct

Yes

Contributor guide

Open the contributing guide

Research direction

Start in Tools > Options > Java > Maven and the Effective tab, then inspect how the bundled maven-model-builder-3.8.6.jar is selected when an external Maven installation is configured. Use the attached exception and compare the bundled and external super POM behavior; done means the Effective POM uses properties from the selected Maven installation rather than always from the bundled version.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.