Added maven POM info.

This commit is contained in:
Erik C. Thauvin 2016-01-22 13:15:50 -08:00
parent 439d8e9669
commit 1539462d1d
4 changed files with 82 additions and 32 deletions

View file

@ -447,14 +447,16 @@ Cause: &lt;pre&gt;<span class="kw">&lt;hs:cause</span><span class="ot"> default<
</tbody>
</table>
<hr />
<h2 id="use-with-gradle">Use with <a href="https://gradle.org/">Gradle</a></h2>
<h2 id="use-with-gradle-or-maven">Use with <a href="https://gradle.org/">Gradle</a> or <a href="http://maven.apache.org/">Maven</a></h2>
<p>Include the following in your <code>build.gradle</code> file:</p>
<pre class="gradle"><code>repositories {
jcenter()
}
dependencies {
compile &#39;net.thauvin.erik.httpstatus:httpstatus:1.0.2&#39;
<pre class="gradle"><code>dependencies {
compile &#39;net.thauvin.erik.httpstatus:httpstatus:1.0.3&#39;
}</code></pre>
<p>or as a Maven artifact:</p>
<div class="sourceCode"><pre class="sourceCode xml"><code class="sourceCode xml"><span class="kw">&lt;dependency&gt;</span>
<span class="kw">&lt;groupId&gt;</span>net.thauvin.erik.httpstatus<span class="kw">&lt;/groupId&gt;</span>
<span class="kw">&lt;artifactId&gt;</span>httpstatus<span class="kw">&lt;/artifactId&gt;</span>
<span class="kw">&lt;version&gt;</span>1.0.3<span class="kw">&lt;/version&gt;</span>
<span class="kw">&lt;/dependency&gt;</span></code></pre></div>
</body>
</html>

View file

@ -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
<dependency>
<groupId>net.thauvin.erik.httpstatus</groupId>
<artifactId>httpstatus</artifactId>
<version>1.0.3</version>
</dependency>
```

View file

@ -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))
{

View file

@ -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=