apache / apache/netbeans

Maven plugin download on startup ignores local repository splitting

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

Description

### Apache NetBeans version

Apache NetBeans 18

### What happened

I added [`-Daether.enhancedLocalRepository.split=true`](https://maven.apache.org/resolver/local-repository.html#Split_Local_Repository) to NetBeans Options → Java → Maven → Global Execution Options and `MAVEN_OPTS` in `%userprofile%\.mavenrc`. When I build a project, dependencies are downloaded to the `cached` subdirectory in the local repository and the newly built artifact is put in the `installed` subdirectory. This is the desired behaviour.

However, when I remove everything from my local repository and simply start NetBeans, Maven plugins are downloaded into the root of the local repository:
```
$ find .
.
./org
./org/apache
./org/apache/maven
./org/apache/maven/plugins
./org/apache/maven/plugins/maven-clean-plugin
./org/apache/maven/plugins/maven-clean-plugin/3.2.0
./org/apache/maven/plugins/maven-clean-plugin/3.2.0/maven-clean-plugin-3.2.0.jar
./org/apache/maven/plugins/maven-clean-plugin/3.2.0/maven-clean-plugin-3.2.0.jar.sha1
./org/apache/maven/plugins/maven-compiler-plugin
./org/apache/maven/plugins/maven-compiler-plugin/3.10.1
./org/apache/maven/plugins/maven-compiler-plugin/3.10.1/maven-compiler-plugin-3.10.1.jar
./org/apache/maven/plugins/maven-compiler-plugin/3.10.1/maven-compiler-plugin-3.10.1.jar.sha1
./org/apache/maven/plugins/maven-dependency-plugin
./org/apache/maven/plugins/maven-dependency-plugin/3.6.0
./org/apache/maven/plugins/maven-dependency-plugin/3.6.0/maven-dependency-plugin-3.6.0.jar
./org/apache/maven/plugins/maven-dependency-plugin/3.6.0/maven-dependency-plugin-3.6.0.jar.sha1
./org/apache/maven/plugins/maven-deploy-plugin
./org/apache/maven/plugins/maven-deploy-plugin/3.1.0
./org/apache/maven/plugins/maven-deploy-plugin/3.1.0/maven-deploy-plugin-3.1.0.jar
./org/apache/maven/plugins/maven-deploy-plugin/3.1.0/maven-deploy-plugin-3.1.0.jar.sha1
./org/apache/maven/plugins/maven-enforcer-plugin
./org/apache/maven/plugins/maven-enforcer-plugin/3.3.0
./org/apache/maven/plugins/maven-enforcer-plugin/3.3.0/maven-enforcer-plugin-3.3.0.jar
./org/apache/maven/plugins/maven-enforcer-plugin/3.3.0/maven-enforcer-plugin-3.3.0.jar.sha1
./org/apache/maven/plugins/maven-install-plugin
./org/apache/maven/plugins/maven-install-plugin/3.1.0
./org/apache/maven/plugins/maven-install-plugin/3.1.0/maven-install-plugin-3.1.0.jar
./org/apache/maven/plugins/maven-install-plugin/3.1.0/maven-install-plugin-3.1.0.jar.sha1
./org/apache/maven/plugins/maven-jar-plugin
./org/apache/maven/plugins/maven-jar-plugin/3.3.0
./org/apache/maven/plugins/maven-jar-plugin/3.3.0/maven-jar-plugin-3.3.0.jar
./org/apache/maven/plugins/maven-jar-plugin/3.3.0/maven-jar-plugin-3.3.0.jar.sha1
./org/apache/maven/plugins/maven-javadoc-plugin
./org/apache/maven/plugins/maven-javadoc-plugin/3.5.0
./org/apache/maven/plugins/maven-javadoc-plugin/3.5.0/maven-javadoc-plugin-3.5.0.jar
./org/apache/maven/plugins/maven-javadoc-plugin/3.5.0/maven-javadoc-plugin-3.5.0.jar.sha1
./org/apache/maven/plugins/maven-site-plugin
./org/apache/maven/plugins/maven-site-plugin/3.12.1
./org/apache/maven/plugins/maven-site-plugin/3.12.1/maven-site-plugin-3.12.1.jar
./org/apache/maven/plugins/maven-site-plugin/3.12.1/maven-site-plugin-3.12.1.jar.sha1
./org/apache/maven/plugins/maven-source-plugin
./org/apache/maven/plugins/maven-source-plugin/3.3.0
./org/apache/maven/plugins/maven-source-plugin/3.3.0/maven-source-plugin-3.3.0.jar
./org/apache/maven/plugins/maven-source-plugin/3.3.0/maven-source-plugin-3.3.0.jar.sha1
./org/apache/maven/plugins/maven-surefire-plugin
./org/apache/maven/plugins/maven-surefire-plugin/3.1.0
./org/apache/maven/plugins/maven-surefire-plugin/3.1.0/maven-surefire-plugin-3.1.0.jar
./org/apache/maven/plugins/maven-surefire-plugin/3.1.0/maven-surefire-plugin-3.1.0.jar.sha1
./org/codehaus
./org/codehaus/mojo
./org/codehaus/mojo/build-helper-maven-plugin
./org/codehaus/mojo/build-helper-maven-plugin/3.4.0
./org/codehaus/mojo/build-helper-maven-plugin/3.4.0/build-helper-maven-plugin-3.4.0.jar
./org/codehaus/mojo/build-helper-maven-plugin/3.4.0/build-helper-maven-plugin-3.4.0.jar.sha1
./org/codehaus/mojo/versions-maven-plugin
./org/codehaus/mojo/versions-maven-plugin/2.15.0
./org/codehaus/mojo/versions-maven-plugin/2.15.0/versions-maven-plugin-2.15.0.jar
./org/codehaus/mojo/versions-maven-plugin/2.15.0/versions-maven-plugin-2.15.0.jar.sha1
```
They should be put into the `cached` directory instead.

### How to reproduce

Put `MAVEN_OPTS="-Daether.enhancedLocalRepository.split=true"` into your `~/.mavenrc` and add `-Daether.enhancedLocalRepository.split=true` to the Maven execution options in NetBeans. Remove everything from your local repository and start NetBeans.

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

No / Don't know

### Operating System

Windows 10 64 Bit

### JDK

OpenJDK 20.0.1

### Apache NetBeans packaging

Apache NetBeans binary zip

### Anything else

Maven 3.9.3

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

No

Contributor guide

Open the contributing guide

Research direction

Reproduce the startup behavior using the Maven execution options and ~/.mavenrc settings described in the issue, with an empty local repository. Trace the NetBeans Maven startup path that downloads plugins and compare it with a project build using local-repository splitting. Done means startup downloads place plugins under the cached subdirectory rather than the repository root.

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
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.