Skip to content

Commit 159ec4c

Browse files
committed
Fix build process
The developers element required by sonatype to make releases. The after_script element does not trigger when deploying The staging module is required to make sure the nexus plugin runs at the end of hte build
1 parent 6d37baf commit 159ec4c

File tree

5 files changed

+82
-9
lines changed

5 files changed

+82
-9
lines changed

.travis.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,10 @@ jobs:
4343
--also-make-dependents -Dandroid.device=test
4444
- stage: deploy
4545
jdk: oraclejdk8
46-
before_script: "./continuous-deployment/before-deploy.sh"
47-
script: "./continuous-deployment/deploy.sh"
48-
after_script: "./continuous-deployment/after-deploy-upload-api-docs.sh"
46+
script:
47+
- "./continuous-deployment/before-deploy.sh"
48+
- "./continuous-deployment/deploy.sh"
49+
- "./continuous-deployment/upload-api-docs.sh"
4950
on:
5051
repo: cucumber/cucumber-jvm
5152

continuous-deployment/deploy.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#!/usr/bin/env bash
22
if [ "$TRAVIS_BRANCH" = 'master' ] && [ "$TRAVIS_PULL_REQUEST" == 'false' ]; then
3-
mvn deploy -Psign-source-javadoc --settings continuous-deployment/travis-settings.xml -DskipTests=true
3+
mvn deploy -Psign-source-javadoc --settings continuous-deployment/travis-settings.xml -DskipTests=true
4+
else
5+
echo "Artifacts are only deployed on a build of the master branch"
46
fi

continuous-deployment/after-deploy-upload-api-docs.sh renamed to continuous-deployment/upload-api-docs.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#!/usr/bin/env bash
22

33
#
4-
# Post-release script that generates API docs and puts them in the Web Site's source tree.
4+
# Script that generates API docs and puts them in the Web Site's source tree.
55
#
66

77
if [[ -z ${TRAVIS_TAG} ]] || [ "$TRAVIS_PULL_REQUEST" == 'true' ]; then
8-
echo "Skipping uploading of api docs to api.cucumber.io"
8+
echo "API Docs are only uploaded on a tag build"
99
exit 0
1010
fi
1111

pom.xml

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,34 @@
66
<version>2.2.1-SNAPSHOT</version>
77
<packaging>pom</packaging>
88
<name>Cucumber-JVM</name>
9+
<description>Cucumber for the JVM</description>
910
<url>http://cucumber.io/</url>
1011

12+
<developers>
13+
<developer>
14+
<id>ahellesoy</id>
15+
<name>Aslak Hellesøy</name>
16+
<email>aslak.hellesoy@gmail.com</email>
17+
<organization>Cucumber</organization>
18+
<organizationUrl>https://github.com/cucumber</organizationUrl>
19+
</developer>
20+
<developer>
21+
<id>brasmusson</id>
22+
<name>Björn Rasmusson</name>
23+
<email>brasmusson@computer.org</email>
24+
<organization>Cucumber</organization>
25+
<organizationUrl>https://github.com/cucumber</organizationUrl>
26+
</developer>
27+
<developer>
28+
<id>mpkorstanje</id>
29+
<name>M.P. Korstanje</name>
30+
<email>rien.korstanje@gmail.com</email>
31+
<organization>Cucumber</organization>
32+
<organizationUrl>https://github.com/cucumber</organizationUrl>
33+
</developer>
34+
</developers>
35+
36+
1137
<properties>
1238
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1339
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
@@ -540,6 +566,8 @@
540566
<module>needle</module>
541567
<module>android</module>
542568
<module>examples</module>
569+
<!--This should always be the last module -->
570+
<module>staging</module>
543571
</modules>
544572

545573
<profiles>
@@ -895,9 +923,6 @@
895923
<configuration>
896924
<serverId>ossrh</serverId>
897925
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
898-
<!--When using local staging the deployment is deferred to the last module. Because half the
899-
project is not deployed this causes the whole whole project to skip deployment -->
900-
<skipLocalStaging>true</skipLocalStaging>
901926
<!--Manually review the non-snapshot artifacts for a while before automating the release -->
902927
<autoReleaseAfterClose>false</autoReleaseAfterClose>
903928
</configuration>

staging/pom.xml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<parent>
6+
<artifactId>cucumber-jvm</artifactId>
7+
<groupId>io.cucumber</groupId>
8+
<version>2.2.1-SNAPSHOT</version>
9+
</parent>
10+
<modelVersion>4.0.0</modelVersion>
11+
<artifactId>staging</artifactId>
12+
<name>Nexus Staging</name>
13+
<description>
14+
When using local staging the deployment is deferred to the last module.
15+
Because half the project consists of examples that should not be deployed and thus skip the execution of the
16+
nexus staging plugin this causes the whole whole project to skip deployment.
17+
18+
By being the last module in the build we can ensure that the nexus plugin is triggered uploads all artifacts
19+
at the end of the build.
20+
</description>
21+
22+
<build>
23+
<plugins>
24+
<plugin>
25+
<artifactId>maven-jar-plugin</artifactId>
26+
<configuration>
27+
<skip>true</skip>
28+
</configuration>
29+
</plugin>
30+
<plugin>
31+
<artifactId>maven-install-plugin</artifactId>
32+
<configuration>
33+
<skip>true</skip>
34+
</configuration>
35+
</plugin>
36+
<plugin>
37+
<artifactId>maven-deploy-plugin</artifactId>
38+
<configuration>
39+
<skip>true</skip>
40+
</configuration>
41+
</plugin>
42+
</plugins>
43+
</build>
44+
45+
</project>

0 commit comments

Comments
 (0)