开源软件名称(OpenSource Name):conveyal/maven-semantic-release开源软件地址(OpenSource Url):https://github.com/conveyal/maven-semantic-release开源编程语言(OpenSource Language):JavaScript 100.0%开源软件介绍(OpenSource Introduction):maven-semantic-releaseAutomated release management for maven projects Aboutmaven-semantic-release is a plugin for semantic-release v16+. This project will deploy a maven project to maven central instead of deploying a node.js project to npm. This tool is intended to be used on github projects that use a Travis-CI server. The workflow this assumes is that your project will use Angular-style commit messages (theoretically you could override this and use a different style) and only merge to master when you want to create a new release. When a new release is generated, it will automatically be deployed to maven central. Optionally, you can also use this enable this tool to create and push some commits and then merge those back into the development branch of your git repository. SetupThis tool is intended to automate the releases of maven projects to maven central. However, a lot of manual steps unfortunately must be taken to get your maven project setup so it can work properly. Big thanks to Nathan Fischer for detailing how to do a lot of these steps in a blog post here. If your project merely wants to take advantage of committing version numbers and creating nice release notes on your github project, you can skip steps 1-4. In step 5, the creation of the maven artifact signing key can be skipped and the Step 1: Setup an account with OSSRHFollow this guide. Step 2: Make sure your pom.xml file is ready to be releasedSee this example project for a sample pom.xml. Your maven project needs to have at least the following items in your pom.xml:
PluginsYour pom.xml file needs to have the following maven plugins included:
Your pom.xml file also needs the following sonatype plugin to automatically close and release your project from nexus.
See this example project for a sample pom.xml. Step 3: Create a maven-settings.xml fileYou can copy paste this file into your repository. The file must be called Step 4: Create gpg keys to sign your artifactFollow the all steps from We wish you good luck as this step is really easy to mess up and get exactly right. Adding your password to travis can be infuriating as you may need to escape parts of it if it has a space, @ symbol or something else. Step 5: Create a .travis.yml file that'll run maven-semantic-release after successSee this example file. In your after_successAfter the success of your CI Run, you'll want to run semantic-release with the maven-semantic-release plugins. At a minimum, you must include the following recommended configuration. This includes overriding the plugins so that the default npm plugin is not used.
If you want to enable the Conveyal workflow of making commits of the release version, snapshot version and then merging master into dev, use this configuration:
It is also possible to skip deploying to maven central, but still incrementing the version in pom.xml by setting the flag
By default the commit message contains the appendix '[ci skip]' that skips the pipeline to run when the pom.xml is pushed. This can be disabled for snapshot and final versions if needed by providing the flag
If you use the conveyal workflow just the updated
before_installBe sure to include the import of your signing keys. If you followed everything correctly in step 4 you should have something like the following added to your .travis.yml file:
cache:This should help speed up the installation of maven-semantic-release. You'll want to include the m2 directory as well.
Also, you'll want to install maven-semantic-release and semantic-release in a step before the build because travis caches immediately after the build.
Step 6: Add a github token to TravisCreate a Github token that will be used to make commits and create releases. Add the token to your travis environment variables as either
Which |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论