In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the relevant knowledge of "how to publish the Maven project to the private server". In the operation of the actual case, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
1. Modify the deployment policy of the warehouse in the private server
The Release version of the project should be released to the Releases repository, and the corresponding Snapshot version should be released to the Snapshots repository. Maven determines whether the project is a snapshot version based on whether the attribute of the version number node in the pom.xml file contains-SNAPSHOT. In the case of the snapshot version, maven automatically publishes the project to the Snapshots repository when the mvn deploy deployment command is executed. To publish the project, you first need to set the "Deployment Policy" of the Releases warehouse and the Snapshots warehouse to "Allow Redeploy":
2. Configure the deployment repository for the project
Configure the deployment repository for Release version and Snapshot version in pom.xml, where id is unique and url corresponds to the Repository Path of Releases and Snapshots repository in private server, respectively:
Indicates whether to assign a build number with a timestamp to the Snapshot version. The effect is as follows:
User-snapshot User Porject Snapshot http://localhost:8081/nexus/content/repositories/snapshots/ true user-release User Porject Release http://localhost:8081/nexus/content/repositories/releases/
3. Enable Deployment user
Nexus has three users by default, of which the Deployment user is used to deploy the project:
The default password for Deployment users is deployment123, and the right-click menu can change or reset the password:
Configure server in settings.xml for the deployment repository configured above, where id needs to correspond to the above deployment repository id:
User-release deployment deployment123 user-snapshot deployment deployment123...
4. Publish a project
Right-click pom.xml-Run As-2 Maven build...
After the release is successful, you can see it in the warehouse of the private server:
5. Manually upload project artifacts in Nexus
In the Artifact Upload tab of the Nexus repository, enter the relevant information to upload the project components manually:
This is the end of the content of "how to publish the Maven project to the private server". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.