Skip to content

Commit 18e9a9c

Browse files
Merge branch 'master' into jar-generation-update
2 parents 706aed4 + 37c4666 commit 18e9a9c

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ before_deploy:
66
- ./gradlew clean
77
- ./gradlew -Pversion=${TRAVIS_TAG:1} jar
88
- ./gradlew -Pversion=${TRAVIS_TAG:1} jarWithDependencies
9+
- cp pom.xml build/libs/trex-java-sdk-${TRAVIS_TAG:1}.pom
910

1011
deploy:
1112
- provider: releases

build.gradle

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
group 'com.cisco.trex'
22

33
apply plugin: 'java'
4+
apply plugin: 'maven'
45

56
sourceCompatibility = 1.8
67
targetCompatibility = 1.8
@@ -31,6 +32,30 @@ dependencies {
3132
}
3233
}
3334

35+
task writePom {
36+
doLast {
37+
pom {
38+
project {
39+
artifactId 'trex-java-sdk'
40+
licenses {
41+
license {
42+
name 'The Apache Software License, Version 2.0'
43+
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
44+
}
45+
}
46+
}
47+
}.writeTo("pom.xml")
48+
}
49+
}
50+
51+
jar {
52+
dependsOn writePom
53+
from sourceSets.main.allSource
54+
into("META-INF/maven/$project.group/$project.name") {
55+
from("pom.xml")
56+
}
57+
}
58+
3459
task javadocJar(type: Jar) {
3560
classifier = 'javadoc'
3661
from javadoc
@@ -42,6 +67,7 @@ task sourcesJar(type: Jar) {
4267
}
4368

4469
task jarWithDependencies(type: Jar) {
70+
dependsOn writePom
4571
baseName = project.name + '-with-dependencies'
4672
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
4773
with jar

0 commit comments

Comments
 (0)