Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
maven试图从libs快照repo下载_Maven_Jenkins_Dependency Management - Fatal编程技术网

maven试图从libs快照repo下载

maven试图从libs快照repo下载,maven,jenkins,dependency-management,Maven,Jenkins,Dependency Management,我有一个聚合器POM文件和两个Maven项目: 示例项目运行器父级-这是父工件 a) 示例项目运行器模型-第一个子模块 b) 示例项目运行程序-第二个子模块 我正在使用mvn clean package deploy,我看到三个工件被上传到工件库() 对于部署到服务器,我有另一个maven项目,它使用maven依赖插件从artifactory(在我的例子中是jFrog)拉/复制JAR,并使用下载的文件进行进一步部署 出于某种原因,maven尝试从下载JAR,而不是 控制台日志: Downloa

我有一个聚合器POM文件和两个Maven项目:

  • 示例项目运行器父级-这是父工件

    a) 示例项目运行器模型-第一个子模块

    b) 示例项目运行程序-第二个子模块

  • 我正在使用
    mvn clean package deploy
    ,我看到三个工件被上传到工件库()

    对于部署到服务器,我有另一个maven项目,它使用maven依赖插件从artifactory(在我的例子中是jFrog)拉/复制JAR,并使用下载的文件进行进一步部署

    出于某种原因,maven尝试从下载JAR,而不是

    控制台日志:

    Downloaded: http://vdi-setup-repo.com/artifactory/codemanagement-maven/com/sample/codes/sample-project/sample-project-runner/1.0.6-SNAPSHOT/sample-project-runner-1.0.6-20201020.172731-2.pom (5 KB at 69.5 KB/sec)
    Downloading: https://vdi-setup-repo.com/artifactory/libs-snapshot/com/sample/codes/sample-project/sample-project-runner-parent/1.0.6-SNAPSHOT/sample-project-runner-parent-1.0.6-20201020.172713-2.pom
             
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 4.659 s
    [INFO] Finished at: 2020-10-20T17:27:38+00:00
    [INFO] Final Memory: 28M/892M
    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:3.1.2:copy (copy) on project deploy-sample-project-runner: Unable to find/resolve artifact. Failed to read artifact descriptor for com.sample.codes.sample-project:sample-project-runner:jar:1.0.6-SNAPSHOT: Could not find artifact com.sample.codes.sample-project:sample-project-runner-parent:pom:1.0.6-20201020.172713-2 in snapshots (https://vdi-setup-repo.com/artifactory/libs-snapshot) -> [Help 1]
    [ERROR] 
    [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
    [ERROR] Re-run Maven using the -X switch to enable full debug logging.
    [ERROR] 
    [ERROR] For more information about the errors and possible solutions, please read the following articles:
    [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
    
    我确实在所有POM文件中指定了存储库,如下所示:

    <repositories>
            <repository>
                <id>codemanagement-maven</id>
                <url>http://vdi-setup-repo.com/artifactory/codemanagement-maven</url>
                <releases>
                    <enabled>true</enabled>
                </releases>
                <snapshots>
                    <enabled>true</enabled>
                </snapshots>
            </repository>
        </repositories>
        <pluginRepositories>
            <pluginRepository>
                <id>codemanagement-maven</id>
                <name>codemanagement-maven</name>
                <url>http://vdi-setup-repo.com/artifactory/codemanagement-maven</url>
                <releases>
                    <enabled>true</enabled>
                </releases>
                <snapshots>
                    <enabled>true</enabled>
                </snapshots>
            </pluginRepository>
        </pluginRepositories>
    
    
    代码管理专家
    http://vdi-setup-repo.com/artifactory/codemanagement-maven
    真的
    真的
    代码管理专家
    代码管理专家
    http://vdi-setup-repo.com/artifactory/codemanagement-maven
    真的
    真的
    
    从Deployer POM文件复制插件:

    <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>3.1.2</version>
                    <executions>
                      <execution>
                        <id>copy</id>
                        <phase>package</phase>
                        <goals>
                          <goal>copy</goal>
                        </goals>
                        <configuration>
                          <artifactItems>
                            <artifactItem>
                              <groupId>com.sample.codes.sample-project</groupId>
                              <artifactId>sample-project-runner</artifactId>                          
                              <version>${currentProjectVersion}</version>
                              <type>jar</type>                        
                              <overWrite>true</overWrite>
                              <outputDirectory>.</outputDirectory>
                              <destFileName>${customFilename}</destFileName>
                            </artifactItem>
                          </artifactItems>
                          <!-- other configurations here -->
                        </configuration>
                      </execution>
                    </executions>
                  </plugin>
    
    
    org.apache.maven.plugins
    maven依赖插件
    3.1.2
    复制
    包裹
    复制
    com.sample.codes.sample-project
    项目执行人示例
    ${currentProjectVersion}
    罐子
    真的
    .
    ${customFilename}
    
    我无法理解为什么即使指定了存储库,maven也会尝试从libs快照下载工件。 早些时候,该问题间歇性地发生,但最近由于该错误,每次执行都会失败

    我是否缺少任何其他配置


    非常感谢您的帮助。

    您的
    设置.xml中定义了什么?顺便说一句:不要使用
    mvn clean package deploy
    只需使用
    mvn clean deploy