Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Gradle Build to include license info in artifact POM #76

Merged
merged 3 commits into from
Apr 12, 2023

Conversation

hpmellema
Copy link
Contributor

@hpmellema hpmellema commented Apr 12, 2023

Issue #, if available: Closes #59

Description of changes:
This pull request adds licensing and Source control info to the published POM artifact.

It also handles an error where the mavenJava publication was overwritting the built-in pluginMaven publication. The updated version here extends the existing pluginMaven publication rather than creating a new publication.
For more details see this issue: gradle/gradle#10384

Testing
The following is the generated POM in my MavenLocal repo with the changes:

<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <!-- This module was also published with a richer model, Gradle metadata,  -->
  <!-- which should be used instead. Do not delete the following line which  -->
  <!-- is to indicate to Gradle or any Gradle module metadata file consumer  -->
  <!-- that they should prefer consuming it instead. -->
  <!-- do_not_remove: published-with-gradle-metadata -->
  <modelVersion>4.0.0</modelVersion>
  <groupId>software.amazon.smithy</groupId>
  <artifactId>smithy-gradle-plugin</artifactId>
  <version>0.6.0</version>
  <description>This project integrates Smithy with Gradle. This plugin can build artifacts from Smithy models, generate JARs that contain Smithy models found in Java projects, and generate JARs that contain filtered *projections* of Smithy models.</description>
  <url>https://github.com/awslabs/smithy-gradle-plugin</url>
  <licenses>
    <license>
      <name>Apache License 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <developers>
    <developer>
      <id>smithy</id>
      <name>Smithy</name>
      <organization>Amazon Web Services</organization>
      <organizationUrl>https://aws.amazon.com</organizationUrl>
      <roles>
        <role>developer</role>
      </roles>
    </developer>
  </developers>
  <scm>
    <url>https://github.com/awslabs/smithy-gradle-plugin.git</url>
  </scm>
  <dependencies>
    <dependency>
      <groupId>software.amazon.smithy</groupId>
      <artifactId>smithy-model</artifactId>
      <version>[1.0, 2.0)</version>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>software.amazon.smithy</groupId>
      <artifactId>smithy-build</artifactId>
      <version>[1.0, 2.0)</version>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>software.amazon.smithy</groupId>
      <artifactId>smithy-cli</artifactId>
      <version>[1.0, 2.0)</version>
      <scope>runtime</scope>
    </dependency>
  </dependencies>
</project>

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@hpmellema hpmellema requested a review from a team as a code owner April 12, 2023 15:35
build.gradle.kts Outdated Show resolved Hide resolved
@hpmellema hpmellema merged commit 9126fd9 into smithy-lang:main Apr 12, 2023
4 checks passed
@hpmellema hpmellema deleted the add-license-info branch April 12, 2023 16:29
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.

Can we have license info added to the POM's please
2 participants