Repository navigation
Conversation
neilcsmith-net
left a comment
There was a problem hiding this comment.
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.
| <action> | ||
| <label>Maven Install</label> | ||
| <target>maven-install</target> | ||
| </action> |
|
eppleton
left a comment
There was a problem hiding this comment.
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:
${repopluginversion}is undefined. The hardcoded14.5was replaced with a property that isn't defined anywhere. The new one isnbm.plugin.version. Runningant maven-installinplatform/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 FAILUREbase.nbm.target.diris now always set. It moved intodefault-properties.xml, which every module imports viadefault.xml. As a result, the<not><isset property="base.nbm.target.dir"/></not>condition inprojectized.xmlnever applies anymore. A plainant nbminplatform/openide.awtnow writesplatform/openide.awt/nbms/platform/org-openide-awt.nbm, a new untracked directory inside the module, instead ofbuild/. It also breaks per-modulemaven-install: theantcall nbmwithbuild.dir=${maven.tmp.nbms}no longer puts the NBM there, sobuild/mvn/nbmshas no.nbmandbuild/mvn/installstays empty. Maybe keep the default innbbuild/build.xml, or define it only whenbasedirisnbbuild.- The
mavenVersiondefault (dev-SNAPSHOT) was removed, but-DforcedVersion=${mavenVersion}is still used. Without-DmavenVersion=…, Maven gets the literal${mavenVersion}. Should this benbm.install.versionas inbuild.xml? mavenArgsis defined and echoed, but never passed to<exec>. The echo claims arguments that weren't actually used.
Minor points:
- The new target in
build.xmlcalls plainmvn, which won't run on Windows without.cmd.projectized.xmluses the bundled${maven.embedder.dir}/maven/bin/mvn${.cmd}. Using the same here would also cover the Maven 4 /mvnwconcern without adding a wrapper. - Removing the
apisupportaction fromnbbuild/nbproject/project.xmlseems unrelated. - The closing
</target>indentation inprojectized.xmlis off.
|
Thanks for a detailed review, @eppleton!
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: produces all NBMs in properly populates the repository with 99-SNAPSHOT versions. Then: 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. |
The changes were implemented
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 |
|
|
||
| - name: Maven Install | ||
| run: | | ||
| # install all NBMs |
There was a problem hiding this comment.
- the huge list of issues reported by @eppleton deserves an action
- not only we shall fix them (done already)
- but we should prevent them to appear again
- here is a CI change that attempts to do it
- there already is "Build NBMs" check in the CI file...
- ...hence adding few seconds
ant maven-installshall be acceptable - it will give us basic confidence the tasks work
There was a problem hiding this comment.
This makes me think we need support for deployUrl, and to use somewhere isolated from the cache if you want to test this in CI.
cc/ @mbien thoughts?
There was a problem hiding this comment.
there already is "Build NBMs" check in the CI file...
...hence adding few seconds
ant maven-installshall be acceptableit will give us basic confidence the tasks work
- both
ant maven-installandant -f platform/openide.awt maven-installsucceeds - and the
pom.xmlfile is generated by the CI run
There was a problem hiding this comment.
So, checking CI caching we don't currently cache .m2, which would have made this test a no-go. However, given we might want to enable that in future, it's probably still a good idea to test this against an isolated pristine folder IMO.
There was a problem hiding this comment.
... given we might want to enable that in future ...
- I don't understand why worry now? When someone needs, one can fix the test
- the test is fine right now and moreover it uses "obscure"
99-SNAPSHOT - it would take next 15 years before (an unlikely) clash would really appear...
There was a problem hiding this comment.
I don't understand why worry now? When someone needs, one can fix the test .. it would take next 15 years before (an unlikely) clash would really appear...
That's not the issue. My concern is cache sizes, which we hit limits on, and potentially caching unnecessary things. As @mbien says, we discussed and verified Maven repo isn't currently cached. I'd mis-remembered and thought the setup-java default was true.
only took a quick look at the CI file changes. Location is good - right job IMO.
Right job, wrong location, I think. This should probably go after the NBM build but before the Javadoc tests? They change the test environment dependent on the setting of the Javadoc label.
There was a problem hiding this comment.
Right job, wrong location, I think. This should probably go after the NBM build but before the Javadoc tests
- the
ant maven-installsuggests to run three other jobs before being invoked- two of them (
ant build-javadocincluded) are optional
- two of them (
- e.g. the
ant maven-installshould be executed after the "Javadoc tests"
They change the test environment dependent on the setting of the Javadoc label.
- setting the Javadoc label then changes the behavior, but ...
- ... it shall not change the result as having Javadoc is optional for
ant maven-install
There was a problem hiding this comment.
Which changes both the test and the JDK it's running on, thus behaving differently between pull requests and merges.
There was a problem hiding this comment.
Which changes both the test and the JDK it's running on, thus behaving differently between pull requests and merges.
good catch. overlooked that. +1 It should be moved above conditional tests which change the env.
There was a problem hiding this comment.
- Is the testing of
ant maven-installin CI the only remaining concern? - Then let it not stay in the way!
- Moved the check in 82f6287
- Right now it runs just after
ant build-nbms(which is the only necessary per-requisite)
- shall this continue to be a blocker, then let's remove the CI test from this PR altogether!
@mbien wrote:
this should be a unit test instead and install exactly one representative module.
- I'd like to test this more through-fully and in a more standard way than in a GitHub Actions yaml file
- I agree, writing it in
.javawould be better- either as a JUnit test somewhere (maybe some
apisupport*module)? - or directly from GitHub Actions:
run: java .github/scripts/CheckMavenInstall.java
- either as a JUnit test somewhere (maybe some
- but let's leave this for some other PR and move on with core changes
| </target> | ||
|
|
||
| <target name="maven-install" depends="init,-init-sources-zip" description="Finishes installation of artifacts into Maven repository"> | ||
| <echo message="=== Run only after ===${line.separator} ant build-source-zips${line.separator} ant build-nbms${line.separator} ant build-javadoc${line.separator}=== Only then maven-install ===${line.separator}"/> |
There was a problem hiding this comment.
Suggests to run:
ant build-source-zips
ant build-nbms
ant build-javadoc
but it doesn't run them to make the ant maven-install fast by itself.
With the most recent state of this PR the ant build-source-zips and ant build-javadoc are optional.
| <condition property="nbm.distribution" value="${dist.base}/${nbm}"> <!-- compatibility --> | ||
| <isset property="dist.base"/> | ||
| </condition> | ||
| <property name="dist.base.structured" value="http://deadlock.netbeans.org/job/nbms-and-javadoc/lastStableBuild/artifact/nbbuild/nbms"/> |
There was a problem hiding this comment.
- referencing http://deadlock.netbeans.org is clearly wrong
- the server no longer works the way it used to
- it doesn't host the
nbms-and-javadocjob anymore
- based on this idea from Attach auto update catalog to each cluster artifact netbeans-mavenutils-nbm-maven-plugin#375
If so, can we use the m2 URL protocol in all places that might want to consume this?
- I decided to use
m2:/protocol- it might not be perfect
- but it is certainly better than the deadlock.netbeans.org URL
- btw. with this
m2:/protocol and latest version of Attach auto update catalog to each cluster artifact netbeans-mavenutils-nbm-maven-plugin#375 I managed to install "JavaFX Support" into an IDE withoutjavafxcluster - e.g. the whole idea seems to be valid
| </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"/> |
There was a problem hiding this comment.
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.

Goals
ant maven-installto perform all the necessary workRelated Work
ant maven-installant maven-installto deploy the Maven artifacts netbeans-jenkins-lib#161