首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >试图清除安装时出错,409冲突

试图清除安装时出错,409冲突
EN

Stack Overflow用户
提问于 2022-02-22 14:15:14
回答 1查看 206关注 0票数 0

我正在尝试将jFrog与Gitlab集成,使用maven和spring框架--我在执行提交时出现了这个错误

这是我用的pom.xml

代码语言:javascript
运行
复制
    <?xml version="1.0" encoding="UTF-8"?>
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.6.3</version>
        <relativePath/>
    </parent>
    <groupId>com.engine</groupId>
    <artifactId>enginebe</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>enginebe</name>
    <description>enginebe</description>
    <properties>
        <java.version>1.8</java.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <scope>runtime</scope>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>io.jsonwebtoken</groupId>
            <artifactId>jjwt-api</artifactId>
            <version>0.11.2</version>
        </dependency>
        <dependency>
            <groupId>io.jsonwebtoken</groupId>
            <artifactId>jjwt-impl</artifactId>
            <version>0.11.2</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>io.jsonwebtoken</groupId>
            <artifactId>jjwt-jackson</artifactId>
            <version>0.11.2</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>3.8.1</version>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.13.2</version>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <distributionManagement>
        <repository>
            <id>snapshots</id>
            <name>xxxx-libs-snapshot</name>
            <url>https://xxx.jfrog.io/artifactory/xxx-libs-snapshot</url>
        </repository>
    </distributionManagement>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <excludes>
                        <exclude>
                            <groupId>org.projectlombok</groupId>
                            <artifactId>lombok</artifactId>
                        </exclude>
                    </excludes>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>

gitlab管道是这样的

代码语言:javascript
运行
复制
# This file is a template, and might need editing before it works on your project.
image: maven:latest
before_script:
  # Install JFrog CLI
  -  curl -fL https://getcli.jfrog.io | sh
  # Configure Artifactory instance with JFrog CLI
  - ./jfrog rt config --url=$ARTIFACTORY_URL --user=$ARTIFACTORY_USER --password=$ARTIFACTORY_PASS
  - ./jfrog rt c show
  # Set the M2_HOME environment variable
  - export M2_HOME=/usr/share/maven
  # Replace the repository name in the configuration.yml to the correct one.
  - sed -i 's,MAVEN_REPO_KEY,'"$MAVEN_REPO_KEY"',g' configuration.yml
build:
  script:
    # Run the MVN command
    - ./jfrog rt mvn "clean install" configuration.yml --build-name=gitlabci-maven-artifactory --build-number=$CI_JOB_ID
    # Collect the environment variables
    - ./jfrog rt bce gitlabci-maven-artifactory $CI_JOB_ID
    # Pass the build information to Artifactory
    - ./jfrog rt bp gitlabci-maven-artifactory $CI_JOB_ID
  only:
    - main

我知道问题的原因是,没有指定pom.xml,我不确定是否应该向jFrog添加某些内容,还是只将某些内容更改为pom.xml文件

我在终端中尝试了mvn部署,它成功了,它将jar和pom部署到了工件中,但是使用gitlab管道它不起作用。

EN

回答 1

Stack Overflow用户

发布于 2022-03-26 05:09:57

您收到的409错误表明pom.xml有问题。在上面的pom.xml中,我注意到您添加了"relativePath“闭包,但没有打开或指定它。我认为pom验证器不喜欢这样。

无论如何,您可以通过在存储库配置页面中勾选“禁止POM一致性”框来告诉Artifactory忽略这类问题。

有关此标志的更多信息,您可以阅读JFrog文档这里

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/71222872

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档