Skip to content

Commit 37c4666

Browse files
Merge pull request #65 from cisco-system-traffic-generator/generate-pom-file
Generate pom file
2 parents 3f2eb10 + 384cc1e commit 37c4666

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-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: 22 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,11 +32,32 @@ 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+
3451
jar {
52+
dependsOn writePom
3553
from sourceSets.main.allSource
54+
into("META-INF/maven/$project.group/$project.name") {
55+
from("pom.xml")
56+
}
3657
}
3758

3859
task jarWithDependencies(type: Jar) {
60+
dependsOn writePom
3961
baseName = project.name + '-with-dependencies'
4062
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
4163
with jar

0 commit comments

Comments
 (0)