generated from newrelic-experimental/java-instrumentation-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: added additional scripts for both jar and shadowJar
- Loading branch information
1 parent
479b0e5
commit fd13248
Showing
5 changed files
with
191 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
plugins { | ||
id 'java' | ||
id 'maven-publish' | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
implementation 'com.squareup.okhttp3:okhttp:4.9.3' | ||
implementation 'com.fasterxml.jackson.core:jackson-databind:2.13.1' | ||
implementation 'org.apache.logging.log4j:log4j-core:2.14.1' | ||
implementation 'org.apache.logging.log4j:log4j-api:2.14.1' | ||
} | ||
|
||
jar { | ||
manifest { | ||
attributes( | ||
'Implementation-Title': 'Custom Log4j Appender', | ||
'Implementation-Vendor': 'New Relic Labs', | ||
'Implementation-Vendor-Id': 'com.newrelic.labs', | ||
'Implementation-Version': '1.0.2' | ||
) | ||
} | ||
} | ||
|
||
|
||
|
||
tasks.withType(JavaCompile) { | ||
options.encoding = 'UTF-8' | ||
} | ||
|
||
task javadocJar(type: Jar) { | ||
archiveClassifier.set('javadoc') | ||
from javadoc | ||
} | ||
|
||
task sourcesJar(type: Jar) { | ||
archiveClassifier.set('sources') | ||
from sourceSets.main.allSource | ||
} | ||
|
||
|
||
|
||
publishing { | ||
publications { | ||
mavenJava(MavenPublication) { | ||
from components.java // Include standard JAR | ||
|
||
artifact javadocJar | ||
artifact sourcesJar | ||
|
||
groupId = 'io.github.newrelic-experimental' | ||
artifactId = 'custom-log4j-appender' | ||
version = '1.0.2' | ||
|
||
pom { | ||
name = 'Custom Log4j Appender' | ||
description = 'A custom Log4j appender for New Relic.' | ||
url = 'https://github.com/newrelic-experimental/newrelic-java-log4j-appender' | ||
licenses { | ||
license { | ||
name = 'The Apache License, Version 2.0' | ||
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt' | ||
} | ||
} | ||
developers { | ||
developer { | ||
id = 'newrelic' | ||
name = 'New Relic' | ||
email = '[email protected]' | ||
} | ||
} | ||
scm { | ||
connection = 'scm:git:git://github.com/newrelic-experimental/newrelic-java-log4j-appender.git' | ||
developerConnection = 'scm:git:ssh://github.com/newrelic-experimental/newrelic-java-log4j-appender.git' | ||
url = 'https://github.com/newrelic-experimental/newrelic-java-log4j-appender' | ||
} | ||
} | ||
} | ||
} | ||
|
||
repositories { | ||
maven { | ||
name = 'sonatype' | ||
url = uri('https://oss.sonatype.org/service/local/staging/deploy/maven2/') | ||
credentials { | ||
username = project.findProperty("ossrhUsername") ?: "" | ||
password = project.findProperty("ossrhPassword") ?: "" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
plugins { | ||
id 'java' | ||
id 'com.github.johnrengelman.shadow' version '6.1.0' | ||
id 'maven-publish' | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
implementation 'com.squareup.okhttp3:okhttp:4.9.3' | ||
implementation 'com.fasterxml.jackson.core:jackson-databind:2.13.1' | ||
implementation 'org.apache.logging.log4j:log4j-core:2.14.1' | ||
implementation 'org.apache.logging.log4j:log4j-api:2.14.1' | ||
} | ||
|
||
jar { | ||
enabled = false // Disable the standard JAR task | ||
} | ||
|
||
shadowJar { | ||
archiveClassifier.set('') // Remove the 'all' classifier | ||
mergeServiceFiles() | ||
manifest { | ||
attributes 'Main-Class': 'com.newrelic.labs.logforwarder.MAIN' | ||
} | ||
} | ||
|
||
tasks.withType(JavaCompile) { | ||
options.encoding = 'UTF-8' | ||
} | ||
|
||
task javadocJar(type: Jar) { | ||
archiveClassifier.set('javadoc') | ||
from javadoc | ||
} | ||
|
||
task sourcesJar(type: Jar) { | ||
archiveClassifier.set('sources') | ||
from sourceSets.main.allSource | ||
} | ||
|
||
publishing { | ||
publications { | ||
mavenJava(MavenPublication) { | ||
artifact shadowJar // Only include Shadow JAR | ||
artifact javadocJar | ||
artifact sourcesJar | ||
|
||
groupId = 'io.github.newrelic-experimental' | ||
artifactId = 'custom-log4j-appender' | ||
version = '1.0.0' | ||
|
||
pom { | ||
name = 'Custom Log4j Appender' | ||
description = 'A custom Log4j appender for New Relic Labs.' | ||
url = 'https://github.com/newrelic-experimental/newrelic-java-log4j-appender' | ||
licenses { | ||
license { | ||
name = 'The Apache License, Version 2.0' | ||
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt' | ||
} | ||
} | ||
developers { | ||
developer { | ||
id = 'newrelic' | ||
name = 'New Relic' | ||
email = '[email protected]' | ||
} | ||
} | ||
scm { | ||
connection = 'scm:git:git://github.com/newrelic-experimental/newrelic-java-log4j-appender.git' | ||
developerConnection = 'scm:git:ssh://github.com/newrelic-experimental/newrelic-java-log4j-appender.git' | ||
url = 'https://github.com/newrelic-experimental/newrelic-java-log4j-appender' | ||
} | ||
} | ||
} | ||
} | ||
|
||
repositories { | ||
maven { | ||
name = 'sonatype' | ||
url = uri('https://oss.sonatype.org/service/local/staging/deploy/maven2/') | ||
credentials { | ||
username = project.findProperty("ossrhUsername") ?: "" | ||
password = project.findProperty("ossrhPassword") ?: "" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,8 @@ jar { | |
} | ||
} | ||
|
||
|
||
|
||
tasks.withType(JavaCompile) { | ||
options.encoding = 'UTF-8' | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.