Skip to content

Comments

Add verification for build artifacts required by maven to publish#28967

Merged
JimSuplizio merged 6 commits intoAzure:mainfrom
JimSuplizio:VerifyReqMavenArtifacts
May 19, 2022
Merged

Add verification for build artifacts required by maven to publish#28967
JimSuplizio merged 6 commits intoAzure:mainfrom
JimSuplizio:VerifyReqMavenArtifacts

Conversation

@JimSuplizio
Copy link
Contributor

@JimSuplizio JimSuplizio commented May 19, 2022

Maven requires the following 4 artifacts to publish. Note: POM only publish, in the case of BOMs, only requires a POM file. That's a separate pipeline and has not been changed. This only affects pipelines that are building and publishing libraries.

  1. The library's pom file
  2. The library's jar file
  3. The sources jar file
  4. The javadoc jar file
    The changelog.md and readme.md are also published, if they exist, but they aren't required. Further, the
    changelog.md and readme.md are verified elsewhere and are also affected by YML variables as to whether
    or not they even need to be verified. Because they aren't mandatory, they will not be verified here.

This verification runs immediately after the build step and will fail the run if the required files are not there. The reason this check is necessary is because we've had libraries whose javadoc exclusions have resulted in not producing a javadocs (we have to produce an 'empty' javadoc with the README.md as the file contents in this case) and, previously, this wasn't failing until someone tried to release the library.

@kushagraThapar and @moarychan, I made a minor change to your empty javadoc creation which was producing a completely empty Javadoc jar. Maven requirements state that if there are no sources or javadocs that we're to make a fake -sources.jar or -javadoc.jar with simple README inside to pass the checking. Now, I realize both libraries have released with fully empty javadoc jars and passed Maven but, I'm not sure how. Maven used to fail if the jar was completely empty. Other than adding the readme to the javadoc, there's no other changes.

@JimSuplizio
Copy link
Contributor Author

/azp run java - template

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@JimSuplizio
Copy link
Contributor Author

/azp run java - spring-experimental

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@JimSuplizio
Copy link
Contributor Author

/azp run java - cosmos

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@JimSuplizio
Copy link
Contributor Author

/azp run java - template

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@JimSuplizio
Copy link
Contributor Author

/azp run java - template

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Member

@srnagar srnagar left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for adding this verification step @JimSuplizio!

@azure-sdk
Copy link
Collaborator

API change check

API changes are not detected in this pull request.

@JimSuplizio
Copy link
Contributor Author

/azp run java - cosmos

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@JimSuplizio JimSuplizio merged commit c2158c4 into Azure:main May 19, 2022
@JimSuplizio JimSuplizio deleted the VerifyReqMavenArtifacts branch May 19, 2022 20:07
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.

3 participants