Skip to content

Commit 63c2fdf

Browse files
committed
Update build.xml to upload nbm to the Maven Central
1 parent 4e9ea22 commit 63c2fdf

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

.gitignore

+2
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

+29-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,35 @@
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.cake3" default="netbeans" basedir=".">
5+
<project name="org.netbeans.modules.php.cake3" default="netbeans" basedir="." xmlns:artifact="antlib:org.apache.maven.artifact.ant">
66
<description>Builds, tests, and runs the project org.netbeans.modules.php.cake3.</description>
77
<import file="nbproject/build-impl.xml"/>
8+
<path id="maven-ant-tasks.classpath" path="lib/maven-ant-tasks-2.1.3.jar" />
9+
<typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="antlib:org.apache.maven.artifact.ant" classpathref="maven-ant-tasks.classpath" />
10+
11+
<!-- define Maven coordinates -->
12+
<property name="build" value="build" />
13+
<property name="groupId" value="com.junichi11.netbeans.modules" />
14+
<property name="artifactId" value="netbeans-cakephp3" />
15+
<!-- also change the version of pom.xml -->
16+
<property name="version" value="0.8.0" />
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+
25+
<target name="deploy" depends="nbm" description="deploy release version to Maven repository">
26+
<move file="${build}/org-netbeans-modules-php-cake3.nbm" toFile="${build}/${artifactId}-${version}.nbm"/>
27+
<artifact:mvn>
28+
<arg value="org.apache.maven.plugins:maven-gpg-plugin:1.3:sign-and-deploy-file" />
29+
<arg value="-Durl=${ossrh-staging-repository-url}" />
30+
<arg value="-DrepositoryId=${ossrh-server-id}" />
31+
<arg value="-DpomFile=pom.xml" />
32+
<arg value="-Dfile=${build}/${artifactId}-${version}.nbm" />
33+
<arg value="-Pgpg" />
34+
</artifact:mvn>
35+
</target>
836
</project>

0 commit comments

Comments
 (0)