快照存储库和发布存储库之间有什么区别?
这是关于设置存储库(如Artifactory,Nexus等)
现在maven-3确实放弃了对<uniqueVersion> false </ uniqueVersion>的快照伪像的支持,似乎你真的需要使用带时间戳的SNAPSHOTS.特别是在内部使用maven 3的m2eclipse似乎受其影响,当SNAPSHOTS不是唯一时,更新快照不起作用.
以前将最佳快照设置为uniqueVersion = false 似乎是最佳做法
现在,切换到带时间戳的版本似乎没什么大问题,毕竟它们是由中央nexus存储库管理的,它可以在常规的intervalls中删除旧的快照.
问题是本地开发人员工作站.他们的本地存储库通过独特的快照很快变得非常大.
如何处理这个问题?
现在我看到了以下可能的解决方案:
保持本地存储库填满硬盘空间的最佳方法是什么?
更新:
为了验证beaviour并提供更多信息,我设置了一个小的nexus服务器,构建两个项目(a和b)并尝试:
A:
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>de.glauche</groupId>
<artifactId>a</artifactId>
<version>0.0.1-SNAPSHOT</version>
<distributionManagement>
<snapshotRepository>
<id>nexus</id>
<name>nexus</name>
<url>http://server:8081/nexus/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
</project>
Run Code Online (Sandbox Code Playgroud)
b:
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>de.glauche</groupId>
<artifactId>b</artifactId>
<version>0.0.1-SNAPSHOT</version>
<distributionManagement>
<snapshotRepository>
<id>nexus</id>
<name>nexus</name>
<url>http://server:8081/nexus/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>
<repositories>
<repository>
<id>nexus</id>
<name>nexus</name>
<snapshots>
<enabled>true</enabled>
</snapshots>
<url>http://server:8081/nexus/content/repositories/snapshots/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>de.glauche</groupId>
<artifactId>a</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency> …Run Code Online (Sandbox Code Playgroud) 我创建了一个新的 android 项目它在构建时显示错误
我尝试了现有的答案
错误是
错误:无法解析“:app@debugAndroidTest/compileClasspath”的依赖关系:无法解析 junit:junit:4.12。
错误:无法解析“:app@releaseUnitTest/compileClasspath”的依赖关系:无法解析 junit:junit:4.12。
错误:无法解析“:app@debugUnitTest/compileClasspath”的依赖关系:无法解析 junit:junit:4.12。
错误:无法解析“:app@debugAndroidTest/compileClasspath”的依赖关系:无法解析 com.google.code.findbugs:jsr305:2.0.1。
我的 gradle 文件的依赖项部分
dependencies
{
implementation 'androidx.appcompat:appcompat:1.0.2'
testImplementation 'junit:junit:4.12'
}
Run Code Online (Sandbox Code Playgroud)
我不明白这是我的第一个项目。
我的项目等级是
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories { …Run Code Online (Sandbox Code Playgroud)