Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
124 changes: 61 additions & 63 deletions gradle/java-publish.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -95,77 +95,75 @@ final MAVEN_PLUGIN_ARTIFACT_NAME = 'spotless-maven-plugin'
boolean isExt = project.name.startsWith('eclipse-')
boolean isPluginMaven = project.ext.artifactId == 'spotless-maven-plugin'

model {
publishing {
publications {
pluginMaven(MavenPublication) {
if (project.ext.artifactId != 'spotless-plugin-gradle') {
from components.java
}
publishing {
publications {
pluginMaven(MavenPublication) {
if (project.ext.artifactId != 'spotless-plugin-gradle') {
from components.java
}

groupId = project.group
artifactId = project.ext.artifactId
version = project.version

def projectExtArtifactId = project.ext.artifactId
def projectDescription = project.description
def projectOrg = project.org
def rootProjectName = rootProject.name

pom.withXml {
// add MavenCentral requirements to the POM
asNode().children().last() + {
resolveStrategy = Closure.DELEGATE_FIRST
name projectExtArtifactId
description projectDescription
groupId = project.group
artifactId = project.ext.artifactId
version = project.version

def projectExtArtifactId = project.ext.artifactId
def projectDescription = project.description
def projectOrg = project.org
def rootProjectName = rootProject.name

pom.withXml {
// add MavenCentral requirements to the POM
asNode().children().last() + {
resolveStrategy = Closure.DELEGATE_FIRST
name projectExtArtifactId
description projectDescription
url "https://github.com/${projectOrg}/${rootProjectName}"
scm {
url "https://github.com/${projectOrg}/${rootProjectName}"
scm {
url "https://github.com/${projectOrg}/${rootProjectName}"
connection "scm:git:https://github.com/${projectOrg}/${rootProjectName}.git"
developerConnection "scm:git:ssh:git@github.com/${projectOrg}/${rootProjectName}.git"
}
licenses {
if (isExt) {
license {
name 'Eclipse Public License - v 1.0'
url 'https://www.eclipse.org/legal/epl-v10.html'
distribution 'repo'
}
} else {
license {
name 'The Apache Software License, Version 2.0'
url 'https://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
connection "scm:git:https://github.com/${projectOrg}/${rootProjectName}.git"
developerConnection "scm:git:ssh:git@github.com/${projectOrg}/${rootProjectName}.git"
}
licenses {
if (isExt) {
license {
name 'Eclipse Public License - v 1.0'
url 'https://www.eclipse.org/legal/epl-v10.html'
distribution 'repo'
}
} else {
license {
name 'The Apache Software License, Version 2.0'
url 'https://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}
if (isPluginMaven) {
// Maven plugin required Maven 3.1.0+ to run
prerequisites { maven '3.1.0' }
}
developers {
if (isExt) {
project.ext.developers.each { extId, extValues ->
developer {
id extId
name extValues['name']
email extValues['email']
}
}
} else {
if (isPluginMaven) {
developer {
id 'lutovich'
name 'Konstantin Lutovich'
email 'konstantin.lutovich@neotechnology.com'
}
}
if (isPluginMaven) {
// Maven plugin required Maven 3.1.0+ to run
prerequisites { maven '3.1.0' }
}
developers {
if (isExt) {
project.ext.developers.each { extId, extValues ->
developer {
id extId
name extValues['name']
email extValues['email']
}
}
} else {
if (isPluginMaven) {
developer {
id 'nedtwigg'
name 'Ned Twigg'
email 'ned.twigg@diffplug.com'
id 'lutovich'
name 'Konstantin Lutovich'
email 'konstantin.lutovich@neotechnology.com'
}
}
developer {
id 'nedtwigg'
name 'Ned Twigg'
email 'ned.twigg@diffplug.com'
}
}
}
}
Expand Down
1 change: 0 additions & 1 deletion testlib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ apply from: rootProject.file('gradle/java-setup.gradle')

dependencies {
api projects.lib
api files(project(projects.lib.path).sourceSets.sortPom.output.classesDirs)
api libs.durian.core
api libs.durian.testlib
api libs.junit.jupiter
Expand Down
Loading