Skip to content

Commit 4b72e59

Browse files
committed
Fix build.xml to upload the nbm to the Maven Central
1 parent a4eac40 commit 4b72e59

File tree

2 files changed

+44
-1
lines changed

2 files changed

+44
-1
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
build
22
nbproject/private
3+
lib
4+
pom.xml.asc

build.xml

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,48 @@
22
<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
33
<!-- for some information on what you could do (e.g. targets to override). -->
44
<!-- If you delete this file and reopen the project it will be recreated. -->
5-
<project name="org.netbeans.modules.php.phpcsfixer" default="netbeans" basedir=".">
5+
<project name="org.netbeans.modules.php.phpcsfixer" default="netbeans" basedir="." xmlns:artifact="antlib:org.apache.maven.artifact.ant">
66
<description>Builds, tests, and runs the project org.netbeans.modules.php.phpcsfixer.</description>
77
<import file="nbproject/build-impl.xml"/>
8+
9+
<path id="maven-ant-tasks.classpath" path="lib/maven-ant-tasks-2.1.3.jar" />
10+
<typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="antlib:org.apache.maven.artifact.ant" classpathref="maven-ant-tasks.classpath" />
11+
12+
<!-- define Maven coordinates -->
13+
<property name="groupId" value="com.junichi11.netbeans.modules" />
14+
<property name="artifactId" value="netbeans-php-cs-fixer" />
15+
<!-- also change the version of pom.xml -->
16+
<property name="version" value="0.10.1" />
17+
<!-- defined maven snapshots and staging repository id and url -->
18+
<property name="ossrh-snapshots-repository-url"
19+
value="https://oss.sonatype.org/content/repositories/snapshots/" />
20+
<property name="ossrh-staging-repository-url"
21+
value="https://oss.sonatype.org/service/local/staging/deploy/maven2/" />
22+
<!-- there server id in the Maven settings.xml -->
23+
<property name="ossrh-server-id" value="ossrh" />
24+
<property name="build" value="build" />
25+
<property name="code-name-base" value="org-netbeans-modules-php-phpcsfixer" />
26+
27+
<target name="update-version-number">
28+
<replaceregexp file="pom.xml"
29+
match="(^ &lt;version&gt;).+(&lt;/version&gt;)"
30+
replace="\1${version}\2"
31+
byline="true" />
32+
<replaceregexp file="manifest.mf"
33+
match="(OpenIDE-Module-Specification-Version:[ ]*).+"
34+
replace="\1${version}"
35+
byline="true" />
36+
</target>
37+
38+
<target name="deploy" depends="update-version-number,nbm" description="deploy release version to Maven repository">
39+
<move file="${build}/${code-name-base}.nbm" toFile="${build}/${artifactId}-${version}.nbm"/>
40+
<artifact:mvn>
41+
<arg value="org.apache.maven.plugins:maven-gpg-plugin:1.3:sign-and-deploy-file" />
42+
<arg value="-Durl=${ossrh-staging-repository-url}" />
43+
<arg value="-DrepositoryId=${ossrh-server-id}" />
44+
<arg value="-DpomFile=pom.xml" />
45+
<arg value="-Dfile=${build}/${artifactId}-${version}.nbm" />
46+
<arg value="-Pgpg" />
47+
</artifact:mvn>
48+
</target>
849
</project>

0 commit comments

Comments
 (0)