diff --git a/.github/workflows/gradle-publish.yml b/.github/workflows/gradle-publish.yml index c861776..f290d41 100644 --- a/.github/workflows/gradle-publish.yml +++ b/.github/workflows/gradle-publish.yml @@ -41,5 +41,5 @@ jobs: with: arguments: publish env: - USERNAME: ${{ github.actor }} - TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_USERNAME: ${{ github.actor }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index b1c491a..a8905e3 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ The following entries in a web application's web.xml would enable the Request Du **Steps:** -1. Download jar from release and add Jar to tomcat path **CATALINA_BASE/lib/TomcatCustomFilters-< VERSION >.jar** +1. Download jar from release/packages and add Jar to tomcat path **CATALINA_BASE/lib/tomcatCustomFilters-< VERSION >.jar** 2. If the entries were added to CATALINA_BASE/conf/**web.xml**, the Request Dumper Filter would be enabled for all web applications. diff --git a/build.gradle b/build.gradle index 0f88123..053444c 100644 --- a/build.gradle +++ b/build.gradle @@ -2,8 +2,11 @@ plugins { id 'java' } -group 'com.rxlogix' -version '1.0-SNAPSHOT' +apply plugin: 'maven' +apply plugin: 'maven-publish' + +group 'org.apache.catalina.custom' +version '0.1' sourceCompatibility = 1.8 @@ -15,3 +18,49 @@ dependencies { testCompile group: 'junit', name: 'junit', version: '4.12' implementation 'org.apache.tomcat.embed:tomcat-embed-core:8.5.35' } + +javadoc { + source = sourceSets.main.allJava + classpath = configurations.compileClasspath + + options + { + setMemberLevel JavadocMemberLevel.PUBLIC + setAuthor true + + links "https://docs.oracle.com/javase/8/docs/api/" + } +} + +task sourceJar(type: Jar) { + classifier = 'sources' + from sourceSets.main.allJava +} + +task packageJavadoc(type: Jar) { + from javadoc + classifier = 'javadoc' +} + + +publishing { + + repositories { + maven { + name = "GitHubPackages" + url = "https://maven.pkg.github.com/vsachinv/TomcatCustomFilters" + credentials { + username = project.findProperty("gpr.user") ?: System.getenv("GITHUB_USERNAME") + password = project.findProperty("gpr.key") ?: System.getenv("GITHUB_TOKEN") + } + } + } + + publications { + gpr(MavenPublication) { + from components.java + artifact sourceJar + artifact packageJavadoc + } + } +} diff --git a/settings.gradle b/settings.gradle index d000571..987077f 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,2 +1,2 @@ -rootProject.name = 'TomcatCustomFilters' +rootProject.name = 'tomcatCustomFilters'