From 4e1868e6c3b5dc213fca30840cd1ade5d7021c8a Mon Sep 17 00:00:00 2001 From: pgodithi Date: Sun, 26 Jun 2022 11:29:45 -0400 Subject: [PATCH 1/7] Improve opensearch.pluginzip docs Signed-off-by: pgodithi --- BUILDING.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/BUILDING.md b/BUILDING.md index 16daeef..6770c4a 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -173,7 +173,7 @@ Use `./gradlew publishShadowPublicationToStagingRepository` to produce maven art ### opensearch.pluginzip -This plugin identifies the generated zip file distribution which is the ouput of `bundlePlugin` task and publishes to local maven repo with standardized maven coordinates. +`opensearch.pluginzip` is designed to facilitate the OpenSearch plugin zips to be available in maven repo and then can be fetched for dependency using maven coordinates. This plugin identifies the generated OpenSearch plugin zip file distribution, the ouput of `bundlePlugin` task and publishes to local maven repo with standard maven coordinates. [Plugin Code](https://github.com/opensearch-project/OpenSearch/tree/main/buildSrc/src/main/java/org/opensearch/gradle/pluginzip), [Plugin Tests](https://github.com/opensearch-project/OpenSearch/tree/main/buildSrc/src/test/java/org/opensearch/gradle/pluginzip), [Plugin META-INF](https://github.com/opensearch-project/OpenSearch/blob/main/buildSrc/src/main/resources/META-INF/gradle-plugins/opensearch.pluginzip.properties) @@ -181,10 +181,10 @@ This plugin identifies the generated zip file distribution which is the ouput of * `opensearch.pluginzip` is java based code published into build-tools. * The maven coordinates groupID is fixed as `org.openserach.plugin`, `version` and `artifcatID` will be inferred from gradle project properties. -* User can also pass custom POM extensions, that will add desired xml to the zip maven POM file generated during runtime. -* Once the plugin is added to the `build.gradle` as `apply plugin: 'opensearch.pluginzip'`, this will add a new custom publish task `publishPluginZipPublicationToZipStagingRepository`, this task will publish the zip distribution to the maven local (file system). -* The maven local artifacts can then be published to maven central/nexus. -* The plugin will not add jars generated by tasks `sourcesJar` and `javadocJar`, this is done in purpose to exclude `jars` for `zip` publications. +* User can also pass custom POM extensions, that will add desired properties to maven POM file generated during runtime. +* Once the plugin is added to the `build.gradle` as `apply plugin: 'opensearch.pluginzip'`, this will add a new custom publish task `publishPluginZipPublicationToZipStagingRepository`, the purpose of this task is to publish the zip distribution to the maven local (file system). +* The maven local artifacts will then be published to maven central/nexus using [CI workflows](https://github.com/opensearch-project/opensearch-build/tree/main/jenkins). +* The plugin will not add generated jars by tasks `sourcesJar` and `javadocJar`, this is done in purpose to exclude `jars` for `zip` publications. #### Plugin Usage @@ -210,10 +210,10 @@ buildscript { 3. Add `apply plugin: 'opensearch.pluginzip'` to the build.gradle file. Once added, this should list the new task `publishPluginZipPublicationToZipStagingRepository`. -4. Run the task `publishPluginZipPublicationToZipStagingRepository` (add it to managed build script build.sh) +4. Run the task `publishPluginZipPublicationToZipStagingRepository` (add it to managed build script `build.sh`) ```./gradlew publishPluginZipPublicationToZipStagingRepository -Dopensearch.version=$VERSION -Dbuild.snapshot=$SNAPSHOT -Dbuild.version_qualifier=$QUALIFIER``` - Note: The gradle assemble task `./gradlew assemble` should be called first before calling `publishPluginZipPublicationToZipStagingRepository`, as zip file need to be generated first before publishing. + Note: The gradle assemble task `./gradlew assemble` should be called first before calling `publishPluginZipPublicationToZipStagingRepository`, as zip file need to be generated before publishing. 5. To add custom POM extensions to zip publication: Example: @@ -251,16 +251,16 @@ licenses is empty in [/usr/share/opensearch/git/opensearch-plugin-template-java/ developers is empty in [/usr/share/opensearch/git/opensearch-plugin-template-java/build/distributions/rename-unspecified.pom] ``` - Note: If gradle project already has the setting as shown in step 5, then its not required to add ```startParameter.excludedTaskNames=["validatePluginZipPom"]```, only required when ran `./gradlew build` without proper POM reference. + Note: If gradle project already has the setting as shown in step 5, then its not required to add ```startParameter.excludedTaskNames=["validatePluginZipPom"]```. This setting is only required, when ran `./gradlew build` without proper POM reference. 7. Exclude the following tasks in `settings.gradle` file, if the build script exists for the plugin and has the tasks `publishToMavenLocal` and `publishAllPublicationsToStagingRepository`, these will also include the tasks `publishPluginZipPublicationToMavenLocal` and `publishPluginZipPublicationToStagingRepository` which is not required to be called with this plugin. To exclude add the following in `settings.gradle` file ```startParameter.excludedTaskNames=["publishPluginZipPublicationToMavenLocal", "publishPluginZipPublicationToStagingRepository"]``` - Note: If there is a managed `build.sh` file and do not have any publish tasks, then its not required to exlcude these tasks, only required if it is calling publish tasks that targets ALL repos and ALL publications. + Note: If there is a managed `build.sh` file and do not have any publish tasks, then its not required to exlcude these tasks, only required if it is calling publish tasks that targets `AL`L repos and `ALL` publications. 8. Quick Example: Job-scheduler: - [build.gradle](https://github.com/prudhvigodithi/job-scheduler/blob/gradleplugin/build.gradle#L33) - [settings.gradle](https://github.com/prudhvigodithi/job-scheduler/blob/gradleplugin/settings.gradle#L13) - [build.sh](https://github.com/prudhvigodithi/job-scheduler/blob/gradleplugin/scripts/build.sh#L80) + [build.gradle](https://github.com/opensearch-project/job-scheduler/blob/main/build.gradle) + [settings.gradle](https://github.com/opensearch-project/job-scheduler/blob/main/settings.gradle) + [build.sh](https://github.com/opensearch-project/job-scheduler/blob/main/scripts/build.sh) From 2b3bf32c9e2144a367cefaa990ebeb6f404dbcb7 Mon Sep 17 00:00:00 2001 From: pgodithi Date: Sun, 26 Jun 2022 11:32:29 -0400 Subject: [PATCH 2/7] Improve opensearch.pluginzip docs Signed-off-by: pgodithi --- BUILDING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BUILDING.md b/BUILDING.md index 6770c4a..d19251f 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -173,7 +173,7 @@ Use `./gradlew publishShadowPublicationToStagingRepository` to produce maven art ### opensearch.pluginzip -`opensearch.pluginzip` is designed to facilitate the OpenSearch plugin zips to be available in maven repo and then can be fetched for dependency using maven coordinates. This plugin identifies the generated OpenSearch plugin zip file distribution, the ouput of `bundlePlugin` task and publishes to local maven repo with standard maven coordinates. +`opensearch.pluginzip` is designed to facilitate OpenSearch plugin zips to be available in maven repo which can then be fetched for dependency using maven coordinates. This plugin identifies the generated OpenSearch plugin zip file distribution, the ouput of `bundlePlugin` task and publishes to local maven repo with standard maven coordinates. [Plugin Code](https://github.com/opensearch-project/OpenSearch/tree/main/buildSrc/src/main/java/org/opensearch/gradle/pluginzip), [Plugin Tests](https://github.com/opensearch-project/OpenSearch/tree/main/buildSrc/src/test/java/org/opensearch/gradle/pluginzip), [Plugin META-INF](https://github.com/opensearch-project/OpenSearch/blob/main/buildSrc/src/main/resources/META-INF/gradle-plugins/opensearch.pluginzip.properties) From 363662e2bd522447f50409a9074555d8620e8b94 Mon Sep 17 00:00:00 2001 From: pgodithi Date: Sun, 26 Jun 2022 11:33:10 -0400 Subject: [PATCH 3/7] Improve opensearch.pluginzip docs Signed-off-by: pgodithi --- BUILDING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BUILDING.md b/BUILDING.md index d19251f..6773a6d 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -256,7 +256,7 @@ developers is empty in [/usr/share/opensearch/git/opensearch-plugin-template-jav 7. Exclude the following tasks in `settings.gradle` file, if the build script exists for the plugin and has the tasks `publishToMavenLocal` and `publishAllPublicationsToStagingRepository`, these will also include the tasks `publishPluginZipPublicationToMavenLocal` and `publishPluginZipPublicationToStagingRepository` which is not required to be called with this plugin. To exclude add the following in `settings.gradle` file ```startParameter.excludedTaskNames=["publishPluginZipPublicationToMavenLocal", "publishPluginZipPublicationToStagingRepository"]``` - Note: If there is a managed `build.sh` file and do not have any publish tasks, then its not required to exlcude these tasks, only required if it is calling publish tasks that targets `AL`L repos and `ALL` publications. + Note: If there is a managed `build.sh` file and do not have any publish tasks, then its not required to exlcude these tasks, only required if it is calling publish tasks that targets `ALL` repos and `ALL` publications. 8. Quick Example: Job-scheduler: From 08c27aa1971d4dd77c250ee8d56a26c5b6418fa3 Mon Sep 17 00:00:00 2001 From: pgodithi Date: Sun, 26 Jun 2022 11:33:36 -0400 Subject: [PATCH 4/7] Improve opensearch.pluginzip docs Signed-off-by: pgodithi --- BUILDING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BUILDING.md b/BUILDING.md index 6773a6d..472d099 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -251,7 +251,7 @@ licenses is empty in [/usr/share/opensearch/git/opensearch-plugin-template-java/ developers is empty in [/usr/share/opensearch/git/opensearch-plugin-template-java/build/distributions/rename-unspecified.pom] ``` - Note: If gradle project already has the setting as shown in step 5, then its not required to add ```startParameter.excludedTaskNames=["validatePluginZipPom"]```. This setting is only required, when ran `./gradlew build` without proper POM reference. + Note: If gradle project already has the setting as shown in step 5, then its not required to add ```startParameter.excludedTaskNames=["validatePluginZipPom"]```. This setting is only required when ran `./gradlew build` without proper POM reference. 7. Exclude the following tasks in `settings.gradle` file, if the build script exists for the plugin and has the tasks `publishToMavenLocal` and `publishAllPublicationsToStagingRepository`, these will also include the tasks `publishPluginZipPublicationToMavenLocal` and `publishPluginZipPublicationToStagingRepository` which is not required to be called with this plugin. To exclude add the following in `settings.gradle` file ```startParameter.excludedTaskNames=["publishPluginZipPublicationToMavenLocal", "publishPluginZipPublicationToStagingRepository"]``` From 2ef4232f9d970da7fd0ba6a254afefea63e513bd Mon Sep 17 00:00:00 2001 From: pgodithi Date: Sun, 26 Jun 2022 11:37:24 -0400 Subject: [PATCH 5/7] Improve opensearch.pluginzip docs Signed-off-by: pgodithi --- BUILDING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BUILDING.md b/BUILDING.md index 472d099..22c1778 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -173,7 +173,7 @@ Use `./gradlew publishShadowPublicationToStagingRepository` to produce maven art ### opensearch.pluginzip -`opensearch.pluginzip` is designed to facilitate OpenSearch plugin zips to be available in maven repo which can then be fetched for dependency using maven coordinates. This plugin identifies the generated OpenSearch plugin zip file distribution, the ouput of `bundlePlugin` task and publishes to local maven repo with standard maven coordinates. +`opensearch.pluginzip` is designed to facilitate OpenSearch plugin zips to be available in maven repo which can then be fetched for dependency using maven coordinates. This plugin identifies the OpenSearch plugin zip file, the ouput of `bundlePlugin` task and publishes to local maven repo with standard maven coordinates. [Plugin Code](https://github.com/opensearch-project/OpenSearch/tree/main/buildSrc/src/main/java/org/opensearch/gradle/pluginzip), [Plugin Tests](https://github.com/opensearch-project/OpenSearch/tree/main/buildSrc/src/test/java/org/opensearch/gradle/pluginzip), [Plugin META-INF](https://github.com/opensearch-project/OpenSearch/blob/main/buildSrc/src/main/resources/META-INF/gradle-plugins/opensearch.pluginzip.properties) From 7cb1fd3daaf9ea104d7f341191a793cde1ed269d Mon Sep 17 00:00:00 2001 From: pgodithi Date: Mon, 27 Jun 2022 08:00:33 -0400 Subject: [PATCH 6/7] Improve opensearch.pluginzip docs Signed-off-by: pgodithi --- BUILDING.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/BUILDING.md b/BUILDING.md index 22c1778..8201500 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -173,7 +173,7 @@ Use `./gradlew publishShadowPublicationToStagingRepository` to produce maven art ### opensearch.pluginzip -`opensearch.pluginzip` is designed to facilitate OpenSearch plugin zips to be available in maven repo which can then be fetched for dependency using maven coordinates. This plugin identifies the OpenSearch plugin zip file, the ouput of `bundlePlugin` task and publishes to local maven repo with standard maven coordinates. +`opensearch.pluginzip` is designed to facilitate OpenSearch plugin distributions (ZIPs) to be available as Apache Maven artifacts which can then be fetched as dependency using Apache Maven dependency management. This plugin identifies the OpenSearch plugin ZIP file, the output of `bundlePlugin` task and publishes to local Apache Maven repository. [Plugin Code](https://github.com/opensearch-project/OpenSearch/tree/main/buildSrc/src/main/java/org/opensearch/gradle/pluginzip), [Plugin Tests](https://github.com/opensearch-project/OpenSearch/tree/main/buildSrc/src/test/java/org/opensearch/gradle/pluginzip), [Plugin META-INF](https://github.com/opensearch-project/OpenSearch/blob/main/buildSrc/src/main/resources/META-INF/gradle-plugins/opensearch.pluginzip.properties) @@ -181,10 +181,10 @@ Use `./gradlew publishShadowPublicationToStagingRepository` to produce maven art * `opensearch.pluginzip` is java based code published into build-tools. * The maven coordinates groupID is fixed as `org.openserach.plugin`, `version` and `artifcatID` will be inferred from gradle project properties. -* User can also pass custom POM extensions, that will add desired properties to maven POM file generated during runtime. -* Once the plugin is added to the `build.gradle` as `apply plugin: 'opensearch.pluginzip'`, this will add a new custom publish task `publishPluginZipPublicationToZipStagingRepository`, the purpose of this task is to publish the zip distribution to the maven local (file system). -* The maven local artifacts will then be published to maven central/nexus using [CI workflows](https://github.com/opensearch-project/opensearch-build/tree/main/jenkins). -* The plugin will not add generated jars by tasks `sourcesJar` and `javadocJar`, this is done in purpose to exclude `jars` for `zip` publications. +* User can also pass custom POM extensions, that will add desired properties to Apache Maven POM file generated during runtime. +* Once the plugin is added to the `build.gradle` as `apply plugin: 'opensearch.pluginzip'`, this will add a new custom publish task `publishPluginZipPublicationToZipStagingRepository`, the purpose of this task is to publish the ZIP distribution to the Apache Maven local repository (file system). +* The Apache Maven local artifacts could then be published to Apache Maven central/nexus using [CI workflows](https://github.com/opensearch-project/opensearch-build/tree/main/jenkins). +* The plugin will not publish generated JARs (`sourcesJar`, `javadocJar`), this is done on purpose to separate `jars` and `zip` publications. #### Plugin Usage From a9de3c73f3e77232ae2711ef83932861145c61e6 Mon Sep 17 00:00:00 2001 From: pgodithi Date: Mon, 27 Jun 2022 18:39:52 -0400 Subject: [PATCH 7/7] Improve opensearch.pluginzip docs Signed-off-by: pgodithi --- BUILDING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BUILDING.md b/BUILDING.md index 8201500..a2fd283 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -213,7 +213,7 @@ Once added, this should list the new task `publishPluginZipPublicationToZipStagi 4. Run the task `publishPluginZipPublicationToZipStagingRepository` (add it to managed build script `build.sh`) ```./gradlew publishPluginZipPublicationToZipStagingRepository -Dopensearch.version=$VERSION -Dbuild.snapshot=$SNAPSHOT -Dbuild.version_qualifier=$QUALIFIER``` - Note: The gradle assemble task `./gradlew assemble` should be called first before calling `publishPluginZipPublicationToZipStagingRepository`, as zip file need to be generated before publishing. + Note: The gradle task responsible to generate the distribution zip should be called first before executing `publishPluginZipPublicationToZipStagingRepository`, as the zip file needs to be generated before publishing. 5. To add custom POM extensions to zip publication: Example: