Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

New POM template & script for deployment to Sonatype

Necessitated by changes to the Sonatype Nexus server at
oss.sonatype.org.

Hopefully this will make it possible to have completely automated
releases of ClojureScript on the Hudson server at build.clojure.org.
  • Loading branch information...
commit 76545283010763edbc010a3aa957a44e26b60359 1 parent 6cd020f
@stuartsierra stuartsierra authored
Showing with 103 additions and 22 deletions.
  1. +2 −0  .gitignore
  2. +96 −0 pom.template.xml
  3. +5 −22 script/build
View
2  .gitignore
@@ -3,11 +3,13 @@
/.DS_Store
/classes
/lib
+/target
closure
/core.js
/coreadvanced.js
/coresimple.js
/out
+/pom.xml
.repl
*.swp
*.zip
View
96 pom.template.xml
@@ -90,4 +90,100 @@
<developerConnection>scm:git:git@github.com:clojure/clojurescript.git</developerConnection>
<url>https://github.com/clojure/clojurescript</url>
</scm>
+
+ <parent>
+ <groupId>org.sonatype.oss</groupId>
+ <artifactId>oss-parent</artifactId>
+ <version>7</version>
+ </parent>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <clojure.source.dir>src/clj</clojure.source.dir>
+ <cljs.source.dir>src/cljs</cljs.source.dir>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <!-- Add Clojure sources to the project's source directories -->
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>1.5</version>
+ <executions>
+ <execution>
+ <id>add-clojure-source-dirs</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-source</goal>
+ <goal>add-resource</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>${clojure.source.dir}</source>
+ <source>${cljs.source.dir}</source>
+ </sources>
+ <resources>
+ <resource>
+ <directory>${clojure.source.dir}</directory>
+ </resource>
+ <resource>
+ <directory>${cljs.source.dir}</directory>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-gpg-plugin</artifactId>
+ <version>1.4</version>
+ <configuration>
+ <keyname>Clojure/core</keyname>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>sonatype-oss-release</id>
+ <!-- This profile is enabled automatically by the Sonatype
+ oss-parent POM when invoking the Maven Release Plugin -->
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <version>2.7</version>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.sonatype.plugins</groupId>
+ <artifactId>nexus-staging-maven-plugin</artifactId>
+ <version>1.4.4</version>
+ <executions>
+ <execution>
+ <id>default-deploy</id>
+ <phase>deploy</phase>
+ <!-- By default, this is the phase deploy goal will bind to -->
+ <goals>
+ <goal>deploy</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <!-- The Base URL of Nexus instance where we want to stage -->
+ <nexusUrl>https://oss.sonatype.org/</nexusUrl>
+ <!-- The server "id" element from settings to use authentication from -->
+ <serverId>sonatype-nexus-staging</serverId>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
</project>
View
27 script/build
@@ -7,11 +7,8 @@ set -ex
cd `dirname $0`/..
-DATE=`date '+%Y%m%d%H%M%S'`
-WORKING="clojurescript_release_$DATE"
-mkdir "$WORKING"
-
POM_TEMPLATE="pom.template.xml"
+POM_FILE="pom.xml"
# The command `git describe --match v0.0` will return a string like
#
@@ -29,30 +26,16 @@ REVISION=${REVISION:0:${#REVISION}-9} # drop the last 9 characters
TAG=r$REVISION
-POM_FILE="$WORKING/clojurescript-0.0-$REVISION.pom"
-JAR_FILE="$WORKING/clojurescript-0.0-$REVISION.jar"
-
-
-# `jar cf` errors on duplicate entries,
-# so we have to assemble the directory manually
-mkdir "$WORKING/jar_contents"
-
-cp -R epl-v10.html src/clj/cljs src/cljs/cljs src/cljs/clojure \
- "$WORKING/jar_contents"
-
-jar cf "$JAR_FILE" -C "$WORKING/jar_contents" .
-
sed -e s/CLOJURESCRIPT_VERSION/0.0-$REVISION/ < "$POM_TEMPLATE" > "$POM_FILE"
-mvn install:install-file -Dfile="$JAR_FILE" -DpomFile="$POM_FILE"
-
# For Hudson server
if [ "$HUDSON" = "true" ]; then
+ mvn --fail-at-end clean deploy -Psonatype-oss-release
+
echo "Creating tag $TAG"
git tag -f "$TAG"
git push origin "$TAG"
-
- mvn gpg:sign-and-deploy-file -Dgpg.keyname=958AE602 -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -DpomFile="$POM_FILE" -Dfile="$JAR_FILE"
else
- echo "Skipping Maven deployment and Git push because we are not on Hudson."
+ echo "Skipping remote deployment and Git tag because we are not on Hudson."
+ mvn clean install
fi
Please sign in to comment.
Something went wrong with that request. Please try again.