Skip to content

Commit

Permalink
- Change build.gradle so it doesn't try to sign and publish archives …
Browse files Browse the repository at this point in the history
…if the relevant sonatype properties are not set

- Change the readme to reflect the libraries availability from maven central.
  • Loading branch information
tarttelin committed Oct 15, 2013
1 parent 490ce96 commit 140c5d4
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 55 deletions.
14 changes: 5 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,11 @@ Example test:<br>
```
With this approach, it feels more like a unit test, but it allows you to totally black box the system under test.

## NOTE:
## Build / dependency

- Given the plethora of cat skinning devices, I have not prescribed a mechanism to build StubServer, or a way of
downloading it's dependencies. It was built with the following:-
- The project is built with gradle. To build from source, install gradle and run gradle clean build

jetty-6.1.26.jar<br>
jetty-util-6.1.26.jar<br>
servlet-api-2.5-20081211.jar<br>
junit-4.7.jar<br>

Later or earlier versions may or may not work.
The library is available from maven central as:

groupId: com.pyruby
artifactId: java-stub-server
97 changes: 51 additions & 46 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
apply plugin: 'idea'
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'signing'

archivesBaseName = 'java-stub-server'
group = 'com.pyruby'
Expand All @@ -18,62 +17,68 @@ dependencies {
testCompile "commons-io:commons-io:2.4"
}

task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from 'build/docs/javadoc'
}

task sourcesJar(type: Jar) {
classifier = 'sources'
from 'src/main'
}
if (hasProperty('sonatypeUsername')) {

artifacts {
archives jar
archives javadocJar
archives sourcesJar
}
apply plugin: 'signing'

signing {
sign configurations.archives
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from 'build/docs/javadoc'
}

uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { deployment -> signing.signPom(deployment) }
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { // snapshot - "https://oss.sonatype.org/content/repositories/snapshots"
authentication(userName: sonatypeUsername, password: sonatypePassword)
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from 'src/main'
}

pom.project {
name 'JavaStubServer'
packaging 'jar'
description 'JavaStubServer is an HTTP server that tests can drive with a mockito-esque feel to return expected results and verify calls were made'
url 'http://tarttelin.github.io/JavaStubServer/'
artifacts {
archives jar
archives javadocJar
archives sourcesJar
}

signing {
sign configurations.archives
}

scm {
url 'scm:git@github.com:tarttelin/JavaStubServer.git'
connection 'scm:git@github.com:tarttelin/JavaStubServer.git'
developerConnection 'scm:git@github.com:tarttelin/JavaStubServer.git'
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { deployment -> signing.signPom(deployment) }
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { // snapshot - "https://oss.sonatype.org/content/repositories/snapshots"
authentication(userName: sonatypeUsername, password: sonatypePassword)
}

licenses {
license {
name 'FreeBSD'
url 'http://www.freebsd.org/copyright/freebsd-license.html'
distribution 'repo'
pom.project {
name 'JavaStubServer'
packaging 'jar'
description 'JavaStubServer is an HTTP server that tests can drive with a mockito-esque feel to return expected results and verify calls were made'
url 'http://tarttelin.github.io/JavaStubServer/'

scm {
url 'scm:git@github.com:tarttelin/JavaStubServer.git'
connection 'scm:git@github.com:tarttelin/JavaStubServer.git'
developerConnection 'scm:git@github.com:tarttelin/JavaStubServer.git'
}
}

developers {
developer {
id 'tarttelin'
name 'Chris Tarttelin'
licenses {
license {
name 'FreeBSD'
url 'http://www.freebsd.org/copyright/freebsd-license.html'
distribution 'repo'
}
}
developer {
id 'chris-h-barrett'
name 'Chris Barrett'

developers {
developer {
id 'tarttelin'
name 'Chris Tarttelin'
}
developer {
id 'chris-h-barrett'
name 'Chris Barrett'
}
}
}
}
Expand Down

0 comments on commit 140c5d4

Please sign in to comment.