Skip to content

Deploy whole installation via ant maven-install - #9779

Merged
jtulach merged 1 commit into
apache:masterfrom
jtulach:jtulach/MavenInstallForAll
Nov 20, 2026
Merged

jtulach merged 1 commit into
apache:masterfrom
jtulach:jtulach/MavenInstallForAll

Conversation

@jtulach

@jtulach jtulach commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Goals

  • make the Maven repository integration approachable to regular NetBeans developers
  • provide simple Ant command - e.g. ant maven-install to perform all the necessary work
    • expose the action in the UI
  • verify the behavior during CI runs
    • done by java .github/scripts/MavenInstallChecker.java which can also be executed locally
  • giving the nbm.distribution new, more valid value via the m2:/ protocol
Maven Install action

Related Work

@jtulach
jtulach requested a review from ebarboni November 3, 2026 06:04
@jtulach jtulach self-assigned this Nov 3, 2026
@jtulach jtulach added Platform [ci] enable platform tests (platform/*) Ant [ci] enable "build tools" tests Release process PRs (eg. versions, sync) that are part of the release process and can be ignored in release notes. labels Nov 3, 2026
@neilcsmith-net neilcsmith-net removed the Release process PRs (eg. versions, sync) that are part of the release process and can be ignored in release notes. label Nov 3, 2026

@neilcsmith-net neilcsmith-net left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally good step. Couple of minor suggestions.

Should also consider whether we need mvnw as the target executable.

Removed reserved label. Release process is special-cased label for specific PRs.

Comment thread nbbuild/build.xml Resolved
Comment thread nbbuild/default-properties.xml Resolved
Comment thread nbbuild/nbproject/project.xml Resolved
@jtulach

jtulach commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor Author

Generally good step. Couple of minor suggestions.

Should also consider whether we need mvnw as the target executable.

@eppleton eppleton left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried this locally on 278e2b8 with a built tree. The new top-level target looks good, but the changes to nbbuild/templates/projectized.xml break the existing per-module ant maven-install:

  1. ${repopluginversion} is undefined. The hardcoded 14.5 was replaced with a property that isn't defined anywhere. The new one is nbm.plugin.version. Running ant maven-install in platform/openide.awt:
    [exec] [ERROR] Plugin org.apache.netbeans.utilities:nb-repository-plugin:${repopluginversion} or one of its dependencies could not be resolved
    [exec] [INFO] BUILD FAILURE
    
  2. base.nbm.target.dir is now always set. It moved into default-properties.xml, which every module imports via default.xml. As a result, the <not><isset property="base.nbm.target.dir"/></not> condition in projectized.xml never applies anymore. A plain ant nbm in platform/openide.awt now writes platform/openide.awt/nbms/platform/org-openide-awt.nbm, a new untracked directory inside the module, instead of build/. It also breaks per-module maven-install: the antcall nbm with build.dir=${maven.tmp.nbms} no longer puts the NBM there, so build/mvn/nbms has no .nbm and build/mvn/install stays empty. Maybe keep the default in nbbuild/build.xml, or define it only when basedir is nbbuild.
  3. The mavenVersion default (dev-SNAPSHOT) was removed, but -DforcedVersion=${mavenVersion} is still used. Without -DmavenVersion=…, Maven gets the literal ${mavenVersion}. Should this be nbm.install.version as in build.xml?
  4. mavenArgs is defined and echoed, but never passed to <exec>. The echo claims arguments that weren't actually used.

Minor points:

  • The new target in build.xml calls plain mvn, which won't run on Windows without .cmd. projectized.xml uses the bundled ${maven.embedder.dir}/maven/bin/mvn${.cmd}. Using the same here would also cover the Maven 4 / mvnw concern without adding a wrapper.
  • Removing the apisupport action from nbbuild/nbproject/project.xml seems unrelated.
  • The closing </target> indentation in projectized.xml is off.

@jtulach

jtulach commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks for a detailed review, @eppleton!

${repopluginversion} is undefined.

  • Oh, my god! Thanks for catching this.
  • Let's use the new nbm.plugin.version in 1904bd0
  • running netbeans$ grep -r repopluginversion * now yields empty result

mavenArgs is defined and echoed, but never passed to

mavenVersion

  • per @neilcsmith-net request the mavenVersion has been replaced
  • since 4a08e7a we are now using nbm.install.version consistently in both maven-install targets

base.nbm.target.dir is now always set.

Reverted in 4a08e7a - now we should be much closer to the original behavior before this PR was created. Toni, please check again. As far as I can say:

netbeans$ ant build-nbms

produces all NBMs in nbbuild/nbms directory (as it used to) and leaves no traces around. Installing to the local Maven repository then works:

netbeans$ ant maven-install -Dnbm.install.version=99-SNAPSHOT

properly populates the repository with 99-SNAPSHOT versions. Then:

netbeans$ rm -rf ~/.m2/repository/org/netbeans/api/org-openide-awt
netbeans$ ant -f platform/openide.awt/ maven-install -Dnbm.install.version=99-SNAPSHOT

succeeds and install new bits properly. I hope the @eppleton review will now find less mistakes. However it is true, given the set of regressions, we should have some tests. I'll think of creating some.

@jtulach
jtulach requested a review from eppleton November 12, 2026 09:26
@jtulach
jtulach dismissed neilcsmith-net’s stale review November 12, 2026 09:28

The changes were implemented

@neilcsmith-net

Copy link
Copy Markdown
Member

The new target in build.xml calls plain mvn, which won't run on Windows without .cmd. projectized.xml uses the bundled ${maven.embedder.dir}/maven/bin/mvn${.cmd}. Using the same here would also cover the Maven 4 / mvnw concern without adding a wrapper.

Actually I should have said Maven 3.10 or 4 concerns. At least one of our Maven plugins has issues with 3.10. If locked to the embedded version, this should probably wait, rebase and test on top of #9642 ? Can that property be overridden without breaking other things when invoking this? Or use a separate property that defaults to value of maven.embedder.dir?

Comment thread .github/workflows/main.yml Resolved
@jtulach
jtulach requested a review from mbien November 12, 2026 09:45
Comment thread nbbuild/build.xml Resolved
Comment thread nbbuild/templates/projectized.xml Resolved
Comment thread nbbuild/templates/projectized.xml Outdated
</condition>
<property name="dist.base.structured" value="http://deadlock.netbeans.org/job/nbms-and-javadoc/lastStableBuild/artifact/nbbuild/nbms"/>
<property name="nbm.distribution" value="${dist.base.structured}/${cluster.dir}/${nbm}"/>
<property name="nbm.distribution" value="m2:/org.netbeans.modules:${code.name.base.dashes}:${nbm.install.version}:nbm"/>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The groupId is hardcoded to org.netbeans.modules, but nb-repository-plugin:populate puts modules with public packages under org.netbeans.api. E.g. after ant -f platform/openide.awt maven-install my local repo has only org/netbeans/api/org-openide-awt/dev-SNAPSHOT/, and there is no org/netbeans/modules/org-openide-awt. So m2:/org.netbeans.modules:org-openide-awt:dev-SNAPSHOT:nbm won't resolve for API modules. The JavaFX modules probably worked because they have no public packages.

Not a regression, since the deadlock URL didn't work either, but maybe the groupId should follow the same rule the plugin uses.

@jtulach jtulach Nov 17, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing catch! Thank you, Toni. The original m2:/ URL wasn't correct for modules with public packages. Fix is available in 5acb9b4

@jtulach

jtulach commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author
  • The last CI run finished successfully:
     [echo] Installed -Dnbm.install.version=99-SNAPSHOT into Maven repository with additional -DmavenArgs=

BUILD SUCCESSFUL
Total time: 10 seconds
asserting /home/runner/.m2/repository/org/netbeans/api/org-openide-awt/99-SNAPSHOT/org-openide-awt-99-SNAPSHOT.pom exists: true
asserting /home/runner/.m2/repository/org/netbeans/api/org-openide-awt/99-SNAPSHOT/org-openide-awt-99-SNAPSHOT.nbm exists: true
MavenInstallChecker successfully finished
  • e.g. I consider this "mergeable" after squashing

@eppleton eppleton left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing the groupId handling and the checker invocation. CI is green and MavenInstallChecker passes, so this looks good to me after the squash.

One small optional nit in .github/scripts/MavenInstallChecker.java: the comment in the first block (around line 45) says "an NBM with public packages", but that block checks org-openide-util-ui-svg under org.netbeans.modules, i.e. the module without public packages. It looks like it was copied from the second block.

@jtulach
jtulach force-pushed the jtulach/MavenInstallForAll branch from 0a7befc to 504c9ce Compare November 19, 2026 15:13
@neilcsmith-net

neilcsmith-net commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

Has this been well tested and reviewed locally now that #9642 is in? At least one of our plugins has issues with Maven 3.10.x. as mentioned earlier.

@JaroslavTulach

Copy link
Copy Markdown
  • all CI checks have passed
    • including ant maven-install - here
    • including ant -f platform/openide.awt maven-install - here - and similar...
  • sounds like it all works as expected

@neilcsmith-net

Copy link
Copy Markdown
Member

I read the CI logs before commenting. I wouldn't necessarily expect them to fail in isolation. And this particular plugin might be fine in actual usage. See the thread at https://lists.apache.org/thread.html/jbkqyp678crog03z5wwl601jps2x8n55 and Eric's work on apache/netbeans-mavenutils-nbm-maven-plugin#373

@ebarboni what are your thoughts on merging this now?

@JaroslavTulach

Copy link
Copy Markdown

Patrick talks about

... working on an platform application ...
at the thread at https://lists.apache.org/thread.html/jbkqyp678crog03z5wwl601jps2x8n55

That kind of workflow is not using the PopulateMojo (that this PR relies on) at all. Patrick is using the regular "build NBM, cluster, etc." mojo. I don't see any reason to worry.

@jtulach
jtulach merged commit cae5944 into apache:master Nov 20, 2026
32 checks passed
@neilcsmith-net

Copy link
Copy Markdown
Member

I'm aware of the difference in Patrik's email, but there is overlap with this mojo in Eric's work on updating the plugins to work with 3.10. I requested you wait for Eric's thoughts before merging!

@jtulach

jtulach commented Nov 21, 2026

Copy link
Copy Markdown
Contributor Author

there is overlap with this mojo in Eric's work on updating the plugins to work with 3.10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ant [ci] enable "build tools" tests Platform [ci] enable platform tests (platform/*)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants