Skip to content

Commit

Permalink
Fix build.xml to upload the nbm to the Maven Central
Browse files Browse the repository at this point in the history
  • Loading branch information
junichi11 committed Jun 20, 2020
1 parent 43dab96 commit f3f5c8a
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
build
nbproject/private
lib
pom.xml.asc
43 changes: 42 additions & 1 deletion build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,48 @@
<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
<!-- for some information on what you could do (e.g. targets to override). -->
<!-- If you delete this file and reopen the project it will be recreated. -->
<project name="com.junichi11.netbeans.changelf" default="netbeans" basedir=".">
<project name="com.junichi11.netbeans.changelf" default="netbeans" basedir="." xmlns:artifact="antlib:org.apache.maven.artifact.ant">
<description>Builds, tests, and runs the project com.junichi11.netbeans.changelf.</description>
<import file="nbproject/build-impl.xml"/>

<path id="maven-ant-tasks.classpath" path="lib/maven-ant-tasks-2.1.3.jar" />
<typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="antlib:org.apache.maven.artifact.ant" classpathref="maven-ant-tasks.classpath" />

<!-- define Maven coordinates -->
<property name="groupId" value="com.junichi11.netbeans.modules" />
<property name="artifactId" value="netbeans-change-line-endings-on-save" />
<!-- also change the version of pom.xml -->
<property name="version" value="0.8.0" />
<!-- defined maven snapshots and staging repository id and url -->
<property name="ossrh-snapshots-repository-url"
value="https://oss.sonatype.org/content/repositories/snapshots/" />
<property name="ossrh-staging-repository-url"
value="https://oss.sonatype.org/service/local/staging/deploy/maven2/" />
<!-- there server id in the Maven settings.xml -->
<property name="ossrh-server-id" value="ossrh" />
<property name="build" value="build" />
<property name="code-name-base" value="com-junichi11-netbeans-changelf" />

<target name="update-version-number">
<replaceregexp file="pom.xml"
match="(^ &lt;version&gt;).+(&lt;/version&gt;)"
replace="\1${version}\2"
byline="true" />
<replaceregexp file="manifest.mf"
match="(OpenIDE-Module-Specification-Version:[ ]*).+"
replace="\1${version}"
byline="true" />
</target>

<target name="deploy" depends="update-version-number,nbm" description="deploy release version to Maven repository">
<move file="${build}/${code-name-base}.nbm" toFile="${build}/${artifactId}-${version}.nbm"/>
<artifact:mvn>
<arg value="org.apache.maven.plugins:maven-gpg-plugin:1.3:sign-and-deploy-file" />
<arg value="-Durl=${ossrh-staging-repository-url}" />
<arg value="-DrepositoryId=${ossrh-server-id}" />
<arg value="-DpomFile=pom.xml" />
<arg value="-Dfile=${build}/${artifactId}-${version}.nbm" />
<arg value="-Pgpg" />
</artifact:mvn>
</target>
</project>

0 comments on commit f3f5c8a

Please sign in to comment.