forked from sebastianbenz/Jnario
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.sh
64 lines (54 loc) · 3.33 KB
/
release.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
set -e
echo "release version:"
read version
#make the release build
mvn clean install -Dmaven.test.skip=true -P release
#publish update site
cd ../jnario-gh-pages
git add --all
git commit -a -m "new release $version"
git push origin gh-pages
cd ../jnario
## upload to maven central
URL="https://oss.sonatype.org/service/local/staging/deploy/maven2/"
REPO="sonatype-nexus-staging"
#todo: remove all snapshot dependencies
for project in "jnario-maven-plugin"
do
cd plugins/$project
mvn versions:set -DnewVersion=$version -DgenerateBackupPoms=false
mvn clean install
mvn gpg:sign-and-deploy-file -Dpackaging=jar -Durl=$URL -DrepositoryId=$REPO -DpomFile=pom.xml -Dfile=target/$project-$version.jar
mvn gpg:sign-and-deploy-file -Dpackaging=jar -Durl=$URL -DrepositoryId=$REPO -DpomFile=pom.xml -Dfile=target/$project-$version-sources.jar -Dclassifier=sources
mvn gpg:sign-and-deploy-file -Dpackaging=jar -Durl=$URL -DrepositoryId=$REPO -DpomFile=pom.xml -Dfile=target/$project-$version-javadoc.jar -Dclassifier=javadoc
cd ../..
done
cd plugins/org.jnario.lib.maven
mvn versions:set -DnewVersion=$version -DgenerateBackupPoms=false
mvn clean install
mvn gpg:sign-and-deploy-file -Dpackaging=jar -Durl=$URL -DrepositoryId=$REPO -DpomFile=pom.xml -Dfile=target/org.jnario.lib-$version.jar
mvn gpg:sign-and-deploy-file -Dpackaging=jar -Durl=$URL -DrepositoryId=$REPO -DpomFile=pom.xml -Dfile=target/org.jnario.lib-$version-sources.jar -Dclassifier=sources
mvn gpg:sign-and-deploy-file -Dpackaging=jar -Durl=$URL -DrepositoryId=$REPO -DpomFile=pom.xml -Dfile=target/org.jnario.lib-$version-javadoc.jar -Dclassifier=javadoc
cd ../..
cd plugins/org.jnario.standalone.maven
mvn versions:set -DnewVersion=$version -DgenerateBackupPoms=false
mvn clean install
mvn gpg:sign-and-deploy-file -Dpackaging=jar -Durl=$URL -DrepositoryId=$REPO -DpomFile=pom.xml -Dfile=target/org.jnario.standalone-$version.jar
mvn gpg:sign-and-deploy-file -Dpackaging=jar -Durl=$URL -DrepositoryId=$REPO -DpomFile=pom.xml -Dfile=target/org.jnario.standalone-$version-sources.jar -Dclassifier=sources
mvn gpg:sign-and-deploy-file -Dpackaging=jar -Durl=$URL -DrepositoryId=$REPO -DpomFile=pom.xml -Dfile=target/org.jnario.standalone-$version-javadoc.jar -Dclassifier=javadoc
cd ../..
cd plugins/jnario-maven-report-plugin
mvn versions:set -DnewVersion=$version -DgenerateBackupPoms=false
mvn clean install
mvn gpg:sign-and-deploy-file -Dpackaging=jar -Durl=$URL -DrepositoryId=$REPO -DpomFile=pom.xml -Dfile=target/report-$version.jar
mvn gpg:sign-and-deploy-file -Dpackaging=jar -Durl=$URL -DrepositoryId=$REPO -DpomFile=pom.xml -Dfile=target/report-$version-sources.jar -Dclassifier=sources
mvn gpg:sign-and-deploy-file -Dpackaging=jar -Durl=$URL -DrepositoryId=$REPO -DpomFile=pom.xml -Dfile=target/report-$version-javadoc.jar -Dclassifier=javadoc
cd ../..
cd plugins/jnario-maven-archetype
mvn versions:set -DnewVersion=$version -DgenerateBackupPoms=false
mvn clean install
mvn gpg:sign-and-deploy-file -Dpackaging=jar -Durl=$URL -DrepositoryId=$REPO -DpomFile=pom.xml -Dfile=target/jnario-archetype-$version.jar
mvn gpg:sign-and-deploy-file -Dpackaging=jar -Durl=$URL -DrepositoryId=$REPO -DpomFile=pom.xml -Dfile=target/jnario-archetype-$version-sources.jar -Dclassifier=sources
cd ../..
echo "Successfully staged maven artifacts. Manually close & release via https://oss.sonatype.org/index.html#stagingRepositories"
exit 1