[eclipse/xtext#1547] use maven-publish instead of maven plugin

Signed-off-by: Christian Dietrich <christian.dietrich@itemis.de>
This commit is contained in:
Christian Dietrich 2019-09-06 11:25:27 +02:00
parent ecd16a0a9e
commit aff7b2242e
4 changed files with 142 additions and 142 deletions

View file

@ -9,7 +9,7 @@ if [ -f "/.dockerenv" ]; then
fi fi
./gradlew \ ./gradlew \
clean cleanGenerateXtext build createLocalMavenRepo \ clean cleanGenerateXtext build publish \
-PuseJenkinsSnapshots=true \ -PuseJenkinsSnapshots=true \
-PJENKINS_URL=$JENKINS_URL \ -PJENKINS_URL=$JENKINS_URL \
-PcompileXtend=true \ -PcompileXtend=true \

View file

@ -27,6 +27,7 @@ subprojects {
group = 'org.eclipse.xtext' group = 'org.eclipse.xtext'
version = rootProject.version version = rootProject.version
apply plugin: 'maven-publish'
apply plugin: 'java' apply plugin: 'java'
apply plugin: 'io.spring.dependency-management' apply plugin: 'io.spring.dependency-management'
dependencyManagement { dependencyManagement {
@ -38,7 +39,6 @@ subprojects {
apply plugin: 'org.xtext.xtend' apply plugin: 'org.xtext.xtend'
} }
apply plugin: 'eclipse' apply plugin: 'eclipse'
apply plugin: 'maven'
apply from: "${rootDir}/gradle/upstream-repositories.gradle" apply from: "${rootDir}/gradle/upstream-repositories.gradle"
apply from: "${rootDir}/gradle/java-compiler-settings.gradle" apply from: "${rootDir}/gradle/java-compiler-settings.gradle"

View file

@ -2,8 +2,7 @@
* Information on Xtext developers used in generated pom files for Maven publishing. * Information on Xtext developers used in generated pom files for Maven publishing.
*/ */
project { developers {
developers {
developer { developer {
name = 'Sven Efftinge' name = 'Sven Efftinge'
email = 'sven.efftinge@typefox.io' email = 'sven.efftinge@typefox.io'
@ -105,5 +104,4 @@ project {
organization = 'Sigasi' organization = 'Sigasi'
organizationUrl = 'https://www.sigasi.com' organizationUrl = 'https://www.sigasi.com'
} }
}
} }

View file

@ -2,42 +2,44 @@
* Configuration of deployment to Maven repositories. * Configuration of deployment to Maven repositories.
*/ */
// Configuration function for generated POMs def noJavaDoc = name.endsWith('tests') || name.contains('testlanguage')
def configurePom = { pom -> publishing {
pom.project { publications {
LocalMavenRepo(MavenPublication) {
from components.java
artifact sourcesJar
if (!noJavaDoc) {
artifact javadocJar
}
pom {
url = 'https://www.eclipse.org/Xtext/'
licenses {
license {
name = 'Eclipse Public License, Version 1.0'
url = 'http://www.eclipse.org/legal/epl-v10.html'
}
}
scm {
connection = "scm:git:git@github.com:eclipse/${rootProject.name}.git"
developerConnection = "scm:git:git@github.com:eclipse/${rootProject.name}.git"
url = "git@github.com:eclipse/${rootProject.name}.git"
}
// We need to wait until the project's own build file has been executed
// so we can use the title and description settings for setting up Maven publishing.
afterEvaluate {
if (project.hasProperty('title')) { if (project.hasProperty('title')) {
name = project.title name = project.title
description = project.description description = project.description
} }
packaging 'jar'
url 'https://www.eclipse.org/Xtext/'
licenses {
license {
name 'Eclipse Public License, Version 1.0'
url 'http://www.eclipse.org/legal/epl-v10.html'
}
}
scm {
connection "scm:git:git@github.com:eclipse/${rootProject.name}.git"
developerConnection "scm:git:git@github.com:eclipse/${rootProject.name}.git"
url "git@github.com:eclipse/${rootProject.name}.git"
} }
} }
apply from: "${rootDir}/gradle/developers.gradle", to: pom apply from: "${rootDir}/gradle/developers.gradle", to: pom
}
// We need to wait until the project's own build file has been executed
// so we can use the title and description settings for setting up Maven publishing.
afterEvaluate {
task createLocalMavenRepo(type: Upload) {
group = 'Upload'
description = 'Create or update the local Maven repository'
configuration = configurations.archives
repositories.mavenDeployer {
repository(url: "file:" + file("${rootDir}/build/maven-repository"))
configurePom(pom)
}
} }
}
repositories {
maven {
url = "$rootProject.buildDir/maven-repository"
}
}
} }