Skip to content

Commit

Permalink
Roll back to old release plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
ctmay4 committed Jan 24, 2020
1 parent 9991cd4 commit 346a347
Showing 1 changed file with 38 additions and 85 deletions.
123 changes: 38 additions & 85 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
plugins {
id 'java-library'
id 'java'
id 'checkstyle'
id "com.github.spotbugs" version "3.0.0"
id 'maven-publish'
id 'signing'
id 'com.bmuschko.nexus' version '2.3.1' // prepares and copies artifacts to Sonotype OSS
id "io.codearte.nexus-staging" version "0.21.2" // logs into Sonotype OSS and does a "Close" and "Release"
id 'com.adarshr.test-logger' version '2.0.0'
id "com.github.ben-manes.versions" version "0.27.0"
Expand All @@ -21,28 +20,22 @@ tasks.withType(JavaCompile) {
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

withJavadocJar()
withSourcesJar()
}

repositories {
mavenCentral()
}

dependencies {
api 'com.thoughtworks.xstream:xstream:1.4.11.1'
compile 'com.thoughtworks.xstream:xstream:1.4.11.1'

testImplementation 'junit:junit:4.13'
testCompile 'junit:junit:4.13'
}

jar {
// specify the archive name; otherwise the version is appended to the war file
archiveFileName = 'x12-parser.jar'

manifest {
attributes('Implementation-Title': project.name,
'Implementation-Version': archiveVersion,
'Implementation-Version': version,
'Implementation-Vendor': group,
'Created-By': System.properties['java.vm.version'] + ' (' + System.properties['java.vm.vendor'] + ')',
'Built-By': System.getProperty('user.name'),
Expand All @@ -66,92 +59,52 @@ spotbugs {
excludeFilter = file('config/spotbugs/spotbugs-exclude.xml')
}

wrapper {
gradleVersion = '6.1'
distributionType = Wrapper.DistributionType.ALL
}

// don't try to release a snapshot to a non-snapshot repository, that won't work anyway
if (version.endsWith('-SNAPSHOT')) {
gradle.startParameter.excludedTaskNames += 'signMavenJavaPublication'
if (version.endsWith('-SNAPSHOT'))
gradle.startParameter.excludedTaskNames += 'closeAndReleaseRepository'
}

publishing {
publications {
mavenJava(MavenPublication) {
artifactId = 'x12-parser'
from components.java
versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime') {
fromResolutionResult()
}
}
pom {
name = 'X12 Parser'
description = 'A Java library for parsing X12 files, including ANSI 837'
url = 'https://github.com/imsweb/x12-parser'
inceptionYear = '2015'

licenses {
license {
name = 'A modified BSD License (BSD)'
url = 'https://github.com/imsweb/x12-parser/blob/master/LICENSE'
distribution = 'repo'
}
}

developers {
developer {
id = 'AngelaszekD'
name = 'David Angelaszek'
email = 'AngelaszekD@imsweb.com'
}
developer {
id = 'ctmay4'
name = 'Chuck May'
email = 'mayc@imsweb.com'
}

}

scm {
url = 'https://github.com/imsweb/x12-parser'
connection = 'scm:https://github.com/imsweb/x12-parser.git'
developerConnection = 'scm:git@github.com:imsweb/x12-parser.git'
}
modifyPom {
project {
name 'X12 Parser'
description 'A Java library for parsing X12 files, including ANSI 837'
url 'https://github.com/imsweb/x12-parser'
inceptionYear '2015'

scm {
url 'https://github.com/imsweb/x12-parser'
connection 'scm:https://github.com/imsweb/x12-parser.git'
developerConnection 'scm:git@github.com:imsweb/x12-parser.git'
}

licenses {
license {
name 'A modified BSD License (BSD)'
url 'https://github.com/imsweb/x12-parser/blob/master/LICENSE'
distribution 'repo'
}
}
}
repositories {
maven {
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2"
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl

credentials {
username = project.hasProperty('nexusUsername') ? project.getProperty('nexusUsername') : ''
password = project.hasProperty('nexusPassword') ? project.getProperty('nexusPassword') : ''

developers {
developer {
id 'AngelaszekD'
name 'David Angelaszek'
email 'AngelaszekD@imsweb.com'
}
developer {
id 'ctmay4'
name 'Chuck May'
email 'mayc@imsweb.com'
}
}
}
}

signing {
sign publishing.publications.mavenJava
}

nexusStaging {
numberOfRetries = 50
delayBetweenRetriesInMillis = 5000
}

javadoc {
if (JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
wrapper {
gradleVersion = '6.1'
distributionType = Wrapper.DistributionType.ALL
}

0 comments on commit 346a347

Please sign in to comment.