简体   繁体   English

Android使用Maven安全吗?

[英]Android is it safe to use maven?

Currently I'm adding external projects to my project in order to use them. 目前,我正在将外部项目添加到我的项目中以使用它们。

A project member said I should use maven, because you don't want other projects in your project. 一个项目成员说我应该使用Maven,因为您不希望项目中包含其他项目。 Maven seems really easy to use, but what happens if the owner decides to remove it? Maven似乎真的很容易使用,但是如果所有者决定删除它,会发生什么呢?

Does that mean maven can't find the external project and I can't rebuild or clear my project? 这是否意味着maven无法找到外部项目,而我也无法重建或清除项目?

what happens if the owner decides to remove it? 如果所有者决定将其删除,该怎么办? Does that mean maven can't find the external project and my app won't run anymore? 这是否意味着maven无法找到外部项目,并且我的应用程序将不再运行?

No. Artifacts on mavenCentral are not allowed to be removed, not even by the owner. 不能。即使是所有者,也不允许删除mavenCentral上的工件。 So that will not happen. 这样就不会发生。

See Joel Orlina's (Sr. developer at Sonartype) post at https://issues.sonatype.org/browse/OSSRH-13636 参见Joel Orlina(Sonartype的高级开发人员)的帖子, 网址https://issues.sonatype.org/browse/OSSRH-13636

Sonatype policy prohibits the removal or other modification of artifacts once they've been published to Central. Sonatype策略禁止在工件发布到Central后删除或进行其他修改。 The reasoning behind this is that if the artifact changes after publication, any builds that already depend on it will break 这背后的原因是,如果工件在发布后发生更改,那么任何已经依赖于该工件的构建都将被破坏。

Central referring to mavenCentral 中央指的是mavenCentral

The reasons he states is very valid and seems to be exactly what made you wonder. 他陈述的理由非常有效,似乎正是您想知道的原因。

Also see Removing an artifact from Maven Central 另请参见从Maven Central删除工件

Maven seems really easy to use, but what happens if the owner decides to remove it? Maven似乎真的很容易使用,但是如果所有者决定删除它,会发生什么呢? Does that mean maven can't find the external project and my app won't run anymore? 这是否意味着maven无法找到外部项目,并且我的应用程序将不再运行?

To add on, some teams using Maven have their own Artifact Repository server (Artifactory, Sonatype etc) such that dependency resolution does not go through directly to the public repositories. 另外,一些使用Maven的团队拥有自己的Artifact Repository服务器(Artifactory,Sonatype等),因此依赖项解析不会直接传递到公共存储库。 Instead, dependency resolution goes through their Artifact Repository server and a copy of that dependency is cached. 相反,依赖项解析通过其Artifact Repository服务器进行,​​并且该依赖项的副本被缓存。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM