From 1539462d1dd763634cc54051fd9a1f8e6255264b Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Fri, 22 Jan 2016 13:15:50 -0800 Subject: [PATCH] Added maven POM info. --- README.html | 16 +++++----- README.md | 18 +++++++---- build.gradle | 76 +++++++++++++++++++++++++++++++++++----------- version.properties | 4 +-- 4 files changed, 82 insertions(+), 32 deletions(-) diff --git a/README.html b/README.html index 201e82d..ca483a1 100644 --- a/README.html +++ b/README.html @@ -447,14 +447,16 @@ Cause: <pre><hs:cause default<
-

Use with Gradle

+

Use with Gradle or Maven

Include the following in your build.gradle file:

-
repositories {
-    jcenter()
-}
-
-dependencies {
-    compile 'net.thauvin.erik.httpstatus:httpstatus:1.0.2'
+
dependencies {
+    compile 'net.thauvin.erik.httpstatus:httpstatus:1.0.3'
 }
+

or as a Maven artifact:

+
<dependency>
+    <groupId>net.thauvin.erik.httpstatus</groupId>
+    <artifactId>httpstatus</artifactId>
+    <version>1.0.3</version>
+</dependency>
diff --git a/README.md b/README.md index 6bc7a7d..785b548 100644 --- a/README.md +++ b/README.md @@ -147,15 +147,21 @@ Status Code | Reason ---- -## Use with [Gradle](https://gradle.org/) +## Use with [Gradle](https://gradle.org/) or [Maven](http://maven.apache.org/) Include the following in your `build.gradle` file: ```gradle -repositories { - jcenter() -} - dependencies { - compile 'net.thauvin.erik.httpstatus:httpstatus:1.0.2' + compile 'net.thauvin.erik.httpstatus:httpstatus:1.0.3' } +``` + +or as a Maven artifact: + +```xml + + net.thauvin.erik.httpstatus + httpstatus + 1.0.3 + ``` \ No newline at end of file diff --git a/build.gradle b/build.gradle index a70ef26..24e19bb 100644 --- a/build.gradle +++ b/build.gradle @@ -14,7 +14,19 @@ defaultTasks 'deploy' def deployDir = 'deploy' def localProps = 'local.properties' def isRelease = 'release' in gradle.startParameter.taskNames + def mavenGroupId = 'net.thauvin.erik.httpstatus' +def mavenName = 'HttpStatus' +def mavenDescription = 'HttpStatus JSP Tag Library' +def mavenUrl = 'https://github.com/ethauvin/HttpStatus' +def mavenLicense = 'The BSD 3-Clause License' +def mavenLicenseUrl = 'http://opensource.org/licenses/BSD-3-Clause' +def mavenScmCon = 'https://github.com/ethauvin/HttpStatus.git' +def mavenScmDevCon = 'git@github.com:ethauvin/HttpStatus.git' + +def pkgLicenses = ['BSD 3-Clause'] +def pkgIssueTrackerUrl = mavenUrl + '/issues' +def pkgLabels = ['jsp', 'tag library', 'http', 'status code', 'java'] def getVersion(isIncrement = false) { @@ -51,10 +63,10 @@ repositories { } dependencies { - compile 'servletapi:servlet-api:+' - compile 'javax.servlet.jsp:jsp-api:+' + compile 'javax.servlet:javax.servlet-api:3.1.0' + compile 'javax.servlet.jsp:jsp-api:2.2' - testCompile 'org.testng:testng:+' + testCompile 'org.testng:testng:6.9.10' } bintray { @@ -65,13 +77,13 @@ bintray { publications = ['MyPublication'] pkg { repo = 'maven' - name = 'HttpStatus' - licenses = ['BSD 3-Clause'] - desc = 'HttpStatus JSP Tag Library' - websiteUrl = 'https://github.com/ethauvin/HttpStatus' - issueTrackerUrl = 'https://github.com/ethauvin/HttpStatus/issues' - vcsUrl = 'https://github.com/ethauvin/HttpStatus.git' - labels = ['jsp', 'tag library', 'http', 'status code', 'java'] + name = mavenName + licenses = pkgLicenses + desc = mavenDescription + websiteUrl = mavenUrl + issueTrackerUrl = pkgIssueTrackerUrl + vcsUrl = mavenScmCon + labels = pkgLabels publicDownloadNumbers = true version { name = project.version @@ -84,6 +96,28 @@ bintray { } } +def pomConfig = { + licenses { + license { + name mavenLicense + url mavenLicenseUrl + distribution 'repo' + } + } + developers { + developer { + id 'ethauvin' + name 'Erik C. Thauvin' + email 'erik@thauvin.net' + } + } + scm { + connection 'scm:git:' + mavenScmCon + developerConnection 'scm:git:' + mavenScmDevCon + url mavenScmCon + } +} + publishing { publications { MyPublication(MavenPublication) { @@ -93,6 +127,14 @@ publishing { groupId mavenGroupId artifactId rootProject.name version project.version + + pom.withXml { + def root = asNode() + root.appendNode('name', mavenName) + root.appendNode('description', mavenDescription) + root.appendNode('url', mavenUrl) + root.children().last() + pomConfig + } } } } @@ -125,7 +167,7 @@ compileJava { doFirst { project.version = getVersion(isRelease) } - //options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation" + //options.compilerArgs << '-Xlint:unchecked' << '-Xlint:deprecation' } @@ -147,7 +189,7 @@ task wrapper(type: Wrapper) { task copyToDeploy(type: Copy) { from(configurations.runtime) { - exclude 'servlet-api-*.jar' + exclude 'javax.servlet-api-*.jar' exclude 'jsp-api-*.jar' } from jar @@ -155,21 +197,21 @@ task copyToDeploy(type: Copy) { } task deploy(dependsOn: ['build', 'copyToDeploy']) { - description = "Copies all needed files to the ${deployDir} directory." - group = "Publishing" + description = 'Copies all needed files to the ${deployDir} directory.' + group = 'Publishing' outputs.dir deployDir inputs.files copyToDeploy mustRunAfter clean } task release(dependsOn: ['deploy', 'wrapper']) << { - group = "Publishing" - description = "Releases new version." + group = 'Publishing' + description = 'Releases new version.' isRelease = true } task pandoc(type: Exec) { - group = "Documentation" + group = 'Documentation' def pandoc_args = ['--from', 'markdown_github', '--to', 'html5', '-s', '-o', 'README.html', 'README.md'] if (Os.isFamily(Os.FAMILY_WINDOWS)) { diff --git a/version.properties b/version.properties index 3c5609d..ca908a3 100644 --- a/version.properties +++ b/version.properties @@ -1,6 +1,6 @@ -#Thu, 21 Jan 2016 15:05:31 -0800 +#Fri, 22 Jan 2016 13:17:16 -0800 version.major=1 version.minor=0 -version.patch=2 +version.patch=3 version.buildmeta= version.prerelease=