如何弃用自定义 Maven 原型?
是否可以弃用 Nexus 上安装的自定义 Maven 原型?
我在想可能会使用这样的东西 -
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.myorg.myarch</groupId>
<artifactId>maven-archetype-custom</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>Archetype - maven-archetype-custom</name>
**<deprecated>TRUE</deprecated>**
</project>
重新安装原型,以便当用户尝试使用它创建项目时,他们会收到一条消息说它已被弃用。
Is it possible to deprecate custom maven archetypes installed on nexus ?
I was thinking may be use something like this -
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.myorg.myarch</groupId>
<artifactId>maven-archetype-custom</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>Archetype - maven-archetype-custom</name>
**<deprecated>TRUE</deprecated>**
</project>
Re-install the archetype so that when a user tries to create a project using this, they get a message saying its deprecated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以做的是重新定位您的工件,但真正已弃用配置等不存在。对于您的情况,我建议从 Nexus 中删除 SNAPSHOT 版本,并真正部署 1.0.0 等发行版本。 Maven 中工件的一般理念是它们就是它们本来的样子......这意味着重命名永远不会发生,因为你不知道是否有人已经使用过它。
What you can do is to relocate your artifact but a real kind of deprecated configuration etc. does not exist. In your case i would recommend to remove the SNAPSHOT versions from the Nexus and really deploy a release version like 1.0.0. The Idea of artifacts in general in Maven is they are as they are...which means a rename will never happen, cause you can't know if someone has already used it.