Skip to content

persist licenses and developer fields in pom file#732

Merged
heemin32 merged 1 commit intoopensearch-project:mainfrom
will-hwang:publish_fields_in_pom
Mar 24, 2025
Merged

persist licenses and developer fields in pom file#732
heemin32 merged 1 commit intoopensearch-project:mainfrom
will-hwang:publish_fields_in_pom

Conversation

@will-hwang
Copy link
Copy Markdown
Contributor

@will-hwang will-hwang commented Mar 21, 2025

Description

change plugIn clause to all clause to include information in pom files in both org.opensearch.opensearch-geospatialand org.opensearch.geospatial-client
append fields as xmlNode as in job-schedule to persist when publshing to maven

reference: https://github.com/opensearch-project/job-scheduler/blob/main/build.gradle

Verification

verified <licenses> and <developers> tag are properly appended to .pom files in following files:

~/.m2/repository/org/opensearch/opensearch-geospatial/3.0.0.0-alpha1-SNAPSHOT/opensearch-geospatial-3.0.0.0-alpha1-SNAPSHOT.pom

~/.m2/repository/org/opensearch/geospatial-client/3.0.0.0-alpha1-SNAPSHOT/geospatial-client-3.0.0.0-alpha1-SNAPSHOT.pom

~/.m2/repository/org/opensearch/plugin/geospatial/3.0.0.0-alpha1-SNAPSHOT/geospatial-3.0.0.0-alpha1-SNAPSHOT.pom

~/.m2/repository/org/opensearch/plugin/opensearch-geospatial/3.0.0.0-alpha1-SNAPSHOT/opensearch-geospatial-3.0.0.0-alpha1-SNAPSHOT.pom

Related Issues

Resolves #731

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • API changes companion pull request created.
  • Commits are signed per the DCO using --signoff.
  • Public documentation issue/PR created.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

}
}
publications {
pluginZip(MavenPublication) { publication ->
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are changing the behavior of publishing plugin zips.

We should publish both jars and the plugin zips.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Therefore this is incorrect as you can see it is publishing to org.opensearch.plugin which is reserved for plugin zip. For jars it should go to org.opensearch.

See job schedule example I sent for more reference. Thanks.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will revert and follow the example in job schedule plugin. thanks

build.gradle Outdated
dependencyLicenses.enabled = false
thirdPartyAudit.enabled = false
loggerUsageCheck.enabled = false
validateMavenPom.enabled = false
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is already on 48.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reverted

Comment on lines +43 to +49
- name: publish pom to maven
run: |
export SONATYPE_USERNAME=$(aws secretsmanager get-secret-value --secret-id maven-snapshots-username --query SecretString --output text)
export SONATYPE_PASSWORD=$(aws secretsmanager get-secret-value --secret-id maven-snapshots-password --query SecretString --output text)
echo "::add-mask::$SONATYPE_USERNAME"
echo "::add-mask::$SONATYPE_PASSWORD"
./gradlew :geospatial-client:publishMavenPublicationToSnapshotsRepository
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to run a second task for pom?
Should be able to combine with the original.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reverted

scripts/build.sh Outdated
Comment on lines +89 to +93

# Publish pom to maven
./gradlew publishToMavenLocal -Dopensearch.version=$VERSION -Dbuild.snapshot=$SNAPSHOT -Dbuild.version_qualifier=$QUALIFIER
./gradlew publishMavenPublicationToStagingRepository -Dopensearch.version=$VERSION -Dbuild.snapshot=$SNAPSHOT -Dbuild.version_qualifier=$QUALIFIER

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reverted

Signed-off-by: will-hwang <sang7239@gmail.com>
Copy link
Copy Markdown
Member

@peterzhuamazon peterzhuamazon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @will-hwang !

@heemin32 heemin32 merged commit a39f051 into opensearch-project:main Mar 24, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Missing necessary license, description, developer information in maven pom

3 participants