Build cleanup in preperation for release This patch is a few small fixes in preparation for release:
- Updates the releasing docs to use Gradle - Updates the hive and backup modules to skip the javadoc task. They donât have public javadoc to publish. - Updates the backup module to ensure itâs not published. - Fixes Gradle pom generation to included unshaded deps. - Fixes the Gradle signing logic. This work was validated by walking through the release steps for both Maven and Gradle. I staged the artifacts from both builds and compared them. Change-Id: I50c3b9358896b264fd525de558b6be7ef77145e2 Reviewed-on: http://gerrit.cloudera.org:8080/11576 Reviewed-by: Adar Dembo <[email protected]> Tested-by: Kudu Jenkins Reviewed-by: Attila Bukor <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/kudu/repo Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/da28d0ae Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/da28d0ae Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/da28d0ae Branch: refs/heads/master Commit: da28d0aee42445791183d0ff5bc021c347cf5f9d Parents: ce2b527 Author: Grant Henke <[email protected]> Authored: Wed Oct 3 12:17:14 2018 -0500 Committer: Grant Henke <[email protected]> Committed: Wed Oct 3 21:24:15 2018 +0000 ---------------------------------------------------------------------- RELEASING.adoc | 32 +++----------------------------- java/gradle/publishing.gradle | 4 ++-- java/gradle/shadow.gradle | 14 +++++++++++++- java/kudu-backup/build.gradle | 8 ++++++++ java/kudu-backup/pom.xml | 22 +++++++++++++++++++--- java/kudu-hive/pom.xml | 8 ++++++++ 6 files changed, 53 insertions(+), 35 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kudu/blob/da28d0ae/RELEASING.adoc ---------------------------------------------------------------------- diff --git a/RELEASING.adoc b/RELEASING.adoc index 7eaa641..4f68b75 100644 --- a/RELEASING.adoc +++ b/RELEASING.adoc @@ -117,40 +117,14 @@ Apache committer guide for setting up your GPG keys . Fix any issues it finds, such as RAT. -. Add the following information to your `~/.m2/settings.xml` file in order to - be able to deploy artifacts to the ASF Maven repository: -+ ----- -<settings> - <servers> - <server> - <id>apache.snapshots.https</id> - <username> <!-- YOUR APACHE LDAP USERNAME --> </username> - <password> <!-- YOUR APACHE LDAP PASSWORD (encrypted) --> </password> - </server> - <!-- To stage a release of some part of Maven --> - <server> - <id>apache.releases.https</id> - <username> <!-- YOUR APACHE LDAP USERNAME --> </username> - <password> <!-- YOUR APACHE LDAP PASSWORD (encrypted) --> </password> - </server> - </servers> -</settings> ----- -+ -If you don't want to keep your ASF password in plaintext on your local machine, -you can link:http://maven.apache.org/guides/mini/guide-encryption.html[encrypt it]. - . Test the full Java build. This will sign and build everything without deploying any artifacts: + ---- - # Run a gpg-agent if you don't normally. You may have to tweak it to get it - # to work with Maven, and this StackOverflow article might help: - # https://stackoverflow.com/questions/36506275/why-do-i-have-to-kill-gpg-agent-to-sign-my-commits + # Run a gpg-agent if you don't normally. gpg-agent --daemon cd java - mvn -DskipTests -Papache-release clean install + gradle clean install -PforceSigning ---- + @@ -184,7 +158,7 @@ you can link:http://maven.apache.org/guides/mini/guide-encryption.html[encrypt i # Run a gpg-agent if you don't normally gpg-agent --daemon cd java - mvn -DskipTests -Papache-release clean deploy + gradle clean uploadArchives -PmavenUsername="<APACHE-LDAP-USERNAME>" -PmavenPassword="<APACHE-LDAP-PASSWORD>" ---- + Go to the link:https://repository.apache.org/\#stagingRepositories[staging repository] http://git-wip-us.apache.org/repos/asf/kudu/blob/da28d0ae/java/gradle/publishing.gradle ---------------------------------------------------------------------- diff --git a/java/gradle/publishing.gradle b/java/gradle/publishing.gradle index f2ad3eb..9ed2d52 100644 --- a/java/gradle/publishing.gradle +++ b/java/gradle/publishing.gradle @@ -30,8 +30,8 @@ ext { // Skip signing artifacts by default if -PskipSigning is passed. (!skipSigning // Sign artifacts if the version is not a snapshot, and we are uploading them to maven. - && !version.endsWith("SNAPSHOT") && gradle.taskGraph.hasTask("uploadArchives")) - + && !version.endsWith("SNAPSHOT") + && project.gradle.startParameter.taskNames.any { it.contains("upload") }) // These properties can be set in ~/.gradle/gradle.properties file, // though it would be open text. They can also be set on the cli via // -PmavenUsername and -PmavenPassword. http://git-wip-us.apache.org/repos/asf/kudu/blob/da28d0ae/java/gradle/shadow.gradle ---------------------------------------------------------------------- diff --git a/java/gradle/shadow.gradle b/java/gradle/shadow.gradle index 95a9b04..4a5d8ca 100644 --- a/java/gradle/shadow.gradle +++ b/java/gradle/shadow.gradle @@ -75,10 +75,22 @@ configurations.create("compileUnshaded") configurations.shadow.extendsFrom(configurations.compileUnshaded) configurations.compile.extendsFrom(configurations.compileUnshaded) -// Ensure compileUnshaded dependencies are not compiled into shadowJar. // We use afterEvaluate to add additional configuration once all the definitions // in the projects build script have been applied afterEvaluate { + // Ensure compileUnshaded dependencies are included in the pom. + [install, uploadArchives].each { task -> + task.repositories.each { + configure(it.pom.scopeMappings) { + // The priority value is arbitrary. + addMapping( + MavenPlugin.COMPILE_PRIORITY, + configurations.compileUnshaded, + Conf2ScopeMappingContainer.COMPILE) + } + } + } + // Ensure compileUnshaded dependencies are not compiled into shadowJar. project.configurations.compileUnshaded.dependencies.each { dep -> def depStr = "${dep.group}:${dep.name}:${dep.version}" logger.info "Excluding ${depStr} from being bundled into the shaded jar." http://git-wip-us.apache.org/repos/asf/kudu/blob/da28d0ae/java/kudu-backup/build.gradle ---------------------------------------------------------------------- diff --git a/java/kudu-backup/build.gradle b/java/kudu-backup/build.gradle index 5c009fe..6a63f75 100644 --- a/java/kudu-backup/build.gradle +++ b/java/kudu-backup/build.gradle @@ -59,3 +59,11 @@ sourceSets { // Adjust the artifact name to match the maven build. archivesBaseName = "kudu-backup${versions.sparkBase}_${versions.scalaBase}" + +// kudu-backup has no public Javadoc. +javadoc { + enabled = false +} + +// Skip publishing kudu-backup until it's ready to be supported long-term. +uploadArchives.enabled = false \ No newline at end of file http://git-wip-us.apache.org/repos/asf/kudu/blob/da28d0ae/java/kudu-backup/pom.xml ---------------------------------------------------------------------- diff --git a/java/kudu-backup/pom.xml b/java/kudu-backup/pom.xml index 0cac985..891960c 100644 --- a/java/kudu-backup/pom.xml +++ b/java/kudu-backup/pom.xml @@ -269,13 +269,29 @@ </plugin> </plugins> - <!-- This big ol' block of nonsense tells the m2e Eclipse plugin what - to do with maven plugins that don't have m2e "extensions" available. - It doesn't affect the Maven build at all. --> <pluginManagement> <plugins> <plugin> + <!-- kudu-backup has no public Javadoc. --> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-javadoc-plugin</artifactId> + <configuration> + <skip>true</skip> + </configuration> + </plugin> + <plugin> + <!-- Skip publishing kudu-backup until it's ready to be supported long-term. --> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-deploy-plugin</artifactId> + <configuration> + <skip>true</skip> + </configuration> + </plugin> + <!-- This big ol' block of nonsense tells the m2e Eclipse plugin what + to do with maven plugins that don't have m2e "extensions" available. + It doesn't affect the Maven build at all. --> + <plugin> <groupId>org.eclipse.m2e</groupId> <artifactId>lifecycle-mapping</artifactId> <version>1.0.0</version> http://git-wip-us.apache.org/repos/asf/kudu/blob/da28d0ae/java/kudu-hive/pom.xml ---------------------------------------------------------------------- diff --git a/java/kudu-hive/pom.xml b/java/kudu-hive/pom.xml index a82f294..33d4de0 100644 --- a/java/kudu-hive/pom.xml +++ b/java/kudu-hive/pom.xml @@ -96,6 +96,14 @@ <build> <plugins> <plugin> + <!-- kudu-hive has no public Javadoc. --> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-javadoc-plugin</artifactId> + <configuration> + <skip>true</skip> + </configuration> + </plugin> + <plugin> <!-- Skip publishing kudu-hive until it's ready to be supported long-term. --> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-deploy-plugin</artifactId>
