Skip to content

Commit

Permalink
Fix build process
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mpkorstanje committed Dec 10, 2017
1 parent 6d37baf commit 74325ea
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 10 deletions.
7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@ jobs:
--also-make-dependents -Dandroid.device=test
- stage: deploy
jdk: oraclejdk8
before_script: "./continuous-deployment/before-deploy.sh"
script: "./continuous-deployment/deploy.sh"
after_script: "./continuous-deployment/after-deploy-upload-api-docs.sh"
script:
- "./continuous-deployment/before-deploy.sh"
- "./continuous-deployment/deploy.sh"
- "./continuous-deployment/upload-api-docs.sh"
on:
repo: cucumber/cucumber-jvm

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

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

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

Expand All @@ -14,7 +14,7 @@ git clone --depth=1 https://github.com/cucumber/api.cucumber.io.git
mkdir -p api.cucumber.io/cucumber-jvm/${TRAVIS_TAG}

# Create the javadoc
mvn --quite javadoc:aggregate
mvn --quiet javadoc:aggregate
cp -R target/site/apidocs/ api.cucumber.io/cucumber-jvm/${TRAVIS_TAG}/javadoc

# Setup up credentials
Expand Down
31 changes: 28 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,34 @@
<version>2.2.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Cucumber-JVM</name>
<description>Cucumber for the JVM</description>
<url>http://cucumber.io/</url>

<developers>
<developer>
<id>ahellesoy</id>
<name>Aslak Hellesøy</name>
<email>aslak.hellesoy@gmail.com</email>
<organization>Cucumber</organization>
<organizationUrl>https://github.com/cucumber</organizationUrl>
</developer>
<developer>
<id>brasmusson</id>
<name>Björn Rasmusson</name>
<email>brasmusson@computer.org</email>
<organization>Cucumber</organization>
<organizationUrl>https://github.com/cucumber</organizationUrl>
</developer>
<developer>
<id>mpkorstanje</id>
<name>M.P. Korstanje</name>
<email>rien.korstanje@gmail.com</email>
<organization>Cucumber</organization>
<organizationUrl>https://github.com/cucumber</organizationUrl>
</developer>
</developers>


<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
Expand Down Expand Up @@ -540,6 +566,8 @@
<module>needle</module>
<module>android</module>
<module>examples</module>
<!--This should always be the last module -->
<module>staging</module>
</modules>

<profiles>
Expand Down Expand Up @@ -895,9 +923,6 @@
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<!--When using local staging the deployment is deferred to the last module. Because half the
project is not deployed this causes the whole whole project to skip deployment -->
<skipLocalStaging>true</skipLocalStaging>
<!--Manually review the non-snapshot artifacts for a while before automating the release -->
<autoReleaseAfterClose>false</autoReleaseAfterClose>
</configuration>
Expand Down
45 changes: 45 additions & 0 deletions staging/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>cucumber-jvm</artifactId>
<groupId>io.cucumber</groupId>
<version>2.2.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>staging</artifactId>
<name>Nexus Staging</name>
<description>
When using local staging the deployment is deferred to the last module.
Because half the project consists of examples that should not be deployed and thus skip the execution of the
nexus staging plugin this causes the whole whole project to skip deployment.

By being the last module in the build we can ensure that the nexus plugin is triggered uploads all artifacts
at the end of the build.
</description>

<build>
<plugins>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>

</project>

0 comments on commit 74325ea

Please sign in to comment.