neilcsmith-net commented on code in PR #9779:
URL: https://github.com/apache/netbeans/pull/9779#discussion_r4453006067


##########
nbbuild/build.xml:
##########
@@ -415,6 +413,57 @@ metabuild.hash=${metabuild.hash}</echo>
           <buildpath path="${modules.sorted}"/>
       </subant-junit>
   </target>
+
+  <target name="maven-install" depends="init" description="Finishes 
installation of artifacts into Maven repository">
+      <echo message="Run only after: ant build-source-zips build-nbms 
build-javadoc!"/>
+
+      <!--
+      Inspired by following two invocations:
+
+      # 
https://github.com/apache/netbeans-jenkins-lib/blob/120b7fe817075c802dbc7f8cb59d5d218249e310/vars/asfMainNetBeansBuild.groovy#L200
+      mvn org.apache.maven.plugins:maven-dependency-plugin:3.5.0:get
+        
-Dartifact=org.apache.netbeans.utilities:nb-repository-plugin:${repopluginversion}
+        
-DremoteRepositories=apache.snapshots.https::::https://repository.apache.org/snapshots
+
+      mvn 
org.apache.netbeans.utilities:nb-repository-plugin:${repopluginversion}:populate
+        -X ${commonparam}
+        -DnetbeansNbmDirectory=${netbeansbase}/nbms
+        -DnetbeansInstallDirectory=${netbeansbase}/netbeans
+        -DnetbeansSourcesDirectory=${netbeansbase}/build/source-zips
+        -DnetbeansJavadocDirectory=${netbeansbase}/build/javadoc
+        -DparentGAV=org.apache.netbeans:netbeans-parent:5
+        -DforcedVersion=${mavenVersion}
+        -DskipInstall=true
+        -DdeployId=apache.snapshots.https
+        
-DdeployUrl=https://repository.apache.org/content/repositories/snapshots
+
+      # 
https://github.com/apache/netbeans-jenkins-lib/blob/120b7fe817075c802dbc7f8cb59d5d218249e310/vars/asfMainNetBeansBuild.groovy#L437
+      mvn 
org.apache.netbeans.utilities:nb-repository-plugin:${repopluginversion}:populate
+        ${commonparam}
+        -DnetbeansNbmDirectory=${netbeansbase}/nbms
+        -DnetbeansInstallDirectory=${netbeansbase}/netbeans
+        -DnetbeansSourcesDirectory=${netbeansbase}/build/source-zips
+        -DnetbeansJavadocDirectory=${netbeansbase}/build/javadoc
+        -DparentGAV=org.apache.netbeans:netbeans-parent:5
+        -DforcedVersion=${mavenVersion}
+        -DskipInstall=true
+        -DdeployUrl=file://${env.WORKSPACE}/mavenrepository
+
+      zip zipFile:'mavenrepo.zip',dir:'mavenrepository',archive:'true'
+      -->
+      <property name="mavenArgs" value=""/>
+      <exec executable="mvn" failonerror="true">
+          <arg 
value="org.apache.netbeans.utilities:nb-repository-plugin:${repopluginversion}:populate"/>
+          <arg value="-DnetbeansInstallDirectory=${netbeans.dest.dir}"/>
+          <arg value="-DnetbeansNbmDirectory=${base.nbm.target.dir}"/>
+          <arg 
value="-DnetbeansSourcesDirectory=${netbeans.zipped.sources.dir}"/>
+          <arg value="-DnetbeansJavadocDirectory=${netbeans.javadoc.dir}"/>
+          <arg value="-DparentGAV=org.apache.netbeans:netbeans-parent:5"/>

Review Comment:
   Parent version should probably be a property too.



##########
nbbuild/default-properties.xml:
##########
@@ -46,10 +46,19 @@
   </condition>
   <property name="netbeans.dest.dir" location="${nb_all}/nbbuild/netbeans"/> 
<!-- historical location, too much work to change default -->
   <property name="netbeans.javadoc.dir" location="${nb.build.dir}/javadoc"/>
+  <property name="base.nbm.target.dir" location="nbms" />
   <property name="moduleCluster.file" 
location="${netbeans.dest.dir}/moduleCluster.properties"/>
 
   <property name="autoupdate.catalog.url" 
value="http://bits.netbeans.org/dev/nbms-and-javadoc/lastSuccessfulBuild/artifact/nbbuild/nbms/updates.xml.gz"/>
 
+  <!--
+  Version of [NetBeans Repository 
Plugin](https://bits.netbeans.org/mavenutilities/nbm-maven-plugin/nb-repository-plugin/index.html)
+  to use when handling `ant maven-install` invocation.
+  -->
+  <property name="repopluginversion" value="14.5"/>
+  <!-- default version to use when installing into Maven repository -->
+  <property name="mavenVersion" value="dev-SNAPSHOT"/>

Review Comment:
   Please call this property anything but `mavenVersion`.  That's really 
confusing.
   
   Aside - we might consider whether we want to add `mvnw` into the build as 
the target executable.  If anyone has Maven 4 installed, calling `mvn` might be 
a problem.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to