相关疑难解决方法(0)

Maven Snapshot Repository与Release Repository

快照存储库和发布存储库之间有什么区别?

这是关于设置存储库(如Artifactory,Nexus等)

release snapshot repository nexus maven

92
推荐指数
3
解决办法
7万
查看次数

你如何有效地处理maven-3时间戳快照?

现在maven-3确实放弃了对<uniqueVersion> false </ uniqueVersion>的快照伪像的支持,似乎你真的需要使用带时间戳的SNAPSHOTS.特别是在内部使用maven 3的m2eclipse似乎受其影响,当SNAPSHOTS不是唯一时,更新快照不起作用.

以前将最佳快照设置为uniqueVersion = false 似乎是最佳做法

现在,切换到带时间戳的版本似乎没什么大问题,毕竟它们是由中央nexus存储库管理的,它可以在常规的intervalls中删除旧的快照.

问题是本地开发人员工作站.他们的本地存储库通过独特的快照很快变得非常大.

如何处理这个问题?

现在我看到了以下可能的解决方案:

  • 要求开发人员定期清除存储库(这导致很多因为需要很长时间才能删除,甚至更长时间才能下载所需的所有内容)
  • 设置一些脚本,它会从本地存储库中删除所有SNAPSHOT目录,并要求开发人员不时运行该脚本(比第一个更好,但仍需要相当长的时间来运行和下载当前快照)
  • 使用依赖:purge-local-repository插件(从eclipse运行时有问题,由于打开文件,需要从每个项目运行)
  • 在每个工作站上设置nexus并设置一个工作来清理旧快照(最好的结果,但我不想维护50多个nexus服务器,而且开发人员工作站上的内存总是很紧张)
  • 完全停止使用SNAPSHOTS

保持本地存储库填满硬盘空间的最佳方法是什么?

更新:

为了验证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)

java maven-3

82
推荐指数
3
解决办法
6万
查看次数

错误:无法解析“:app@debugAndroidTest/compileClasspath”的依赖关系:无法解析 junit:junit:4.12

我创建了一个新的 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)

android gradle

6
推荐指数
1
解决办法
6354
查看次数

标签 统计

android ×1

gradle ×1

java ×1

maven ×1

maven-3 ×1

nexus ×1

release ×1

repository ×1

snapshot ×1