apache / apache/netbeans-mavenutils-nbm-maven-plugin

At info.xml generation step, the location of the upater.jar is wrongly built, when the Maven local repository is located on another drive as the project

Open
#225 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
17
Forks
28
Avg merge
11h 23m
Merged PRs (30d)
6

Description

Hello,

I am running on Windows 10, Maven 3.9.5, Java Zulu 8, NB 25 and

```

org.apache.netbeans.utilities
nbm-maven-plugin
14.2
true

```

My Maven local repository is located on a drive D: with the following declaration in the .m2/settings.xml
` D:\projects\.m2\repository
`
And my project on
`C:\projects\crystal\release\....`

When running the nbm-maven-plugin in debug mode I notice:

```
...
Generating Auto Update information for ch.skyguide.crystal.gui.acc
FileSet: Setup scanner in dir C:\projects\crystal\release\4-Implementation\positions\modules\gui-acc\target\nbm\clusters\crystal with patternSet{ includes: [config\Modules\ch-skyguide-crystal-gui-acc.xml, **] excludes: [] }
Including files [config\Modules\ch-skyguide-crystal-gui-acc.xml, modules\ch-skyguide-crystal-crystal-position-module-gui-acc.jar, update_tracking\ch-skyguide-crystal-gui-acc.xml]
+Task: makenbm
Project base dir set to: C:\projects\crystal\release\4-Implementation\positions\modules\gui-acc
Processing module attributes for locale ''
Going to open jarfile modules/ch-skyguide-crystal-crystal-position-module-gui-acc.jar
Populating English module attributes
OpenIDE-Module is ch.skyguide.crystal.gui.acc
OpenIDE-Module-Name is gui-acc
Most recent input: 1741270268932 file: 1741268781087
Creating info.xml from module attributes for locale ''
dropping C:\D from path as it doesn't exist
dropping C:\projects\.m2\repository\org\netbeans\external\updater\RELEASE220\updater-RELEASE220.jar from path as it doesn't exist
Resource org/netbeans/updater/resources/autoupdate-info-2_4.dtd loaded from parent loader
+Task: jar
...
```
Near the end of the log above, it seems that the ant task wrongly interprets the fact that the local repository is on D: drive (

> dropping C:\D from path as it doesn't exist

) and tries to use the drive where the project is located (C:).

If I replace th C: in the line in log above by D:, then the location is correct and it can find the updater-RELEASE220.jar:

**C:**\projects\.m2\repository\org\netbeans\external\updater\RELEASE220\updater-RELEASE220.jar -> **D:**\projects\.m2\repository\org\netbeans\external\updater\RELEASE220\updater-RELEASE220.jar

Somehow, netbeans/nbbuild/antsrc/org/netbeans/nbbuild
/MakeNBM.java gets confused with its Path (ant/src/main/org/apache/tools/ant/types
/Path.java).

Maybe it is related to the fact that it misinterpret the colon in the full path as a path separator, even tough on Windows it is supposed to be semi-colon.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading netbeans/nbbuild/antsrc/org/netbeans/nbbuild/MakeNBM.java and the referenced Ant Path.java, then trace how the local repository path is handled during info.xml generation. Reproduce with a Windows project on C: and Maven repository on D:; done means the generated updater.jar location retains the correct drive and is found.

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.