首页 > 解决方案 > Jenkins服务器上的Maven失败,出于某种原因试图从apache快照中获取java-websocket 1.3.0?

问题描述

我的詹金斯构建一个已经运行了很长时间的应用程序失败了。它失败了:

08:47:42 [ERROR] Failed to execute goal on project DataAdapterFB1: Could not resolve dependencies for project joy.com:DataAdapterFB1:jar:1.0.0: 
Failed to collect dependencies at org.java-websocket:java-websocket:jar:1.3.0: 
Failed to read artifact descriptor for org.java-websocket:java-websocket:jar:1.3.0: Could not transfer artifact org.java-websocket:java-websocket:pom:1.3.0 from/to apache-snapshots (http://139.69.2.40:8081/nexus/content/repositories/apache-snapshots): 
Failed to transfer file: http://139.69.2.40:8081/nexus/content/repositories/apache-snapshots/org/java-websocket/java-websocket/1.3.0/java-websocket-1.3.0.pom. 
Return code is: 400 , ReasonPhrase:Repository version policy: SNAPSHOT does not allow version: 1.3.0. -> [Help 1]

对于 1,我不太确定它为什么突然尝试从 apache 快照存储库中获取它,因为这不是快照,也没有在 POM 中如此列出。这似乎不会发生在我的本地日食上。

我最近唯一更改的是允许在各种快照存储库上创建快照,并始终在我们的 2 个本地托管的内部存储库上进行更新。

<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>joy.com</groupId>
<artifactId>DataAdapterFB1</artifactId>
<version>1.0.0</version>
<packaging>jar</packaging>

<name>DataAdapterFB1</name>
<url>http://maven.apache.org</url>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<distributionManagement>
    <repository>
        <!-- Where to put released artifacts -->
        <id>releases</id>
        <name>My Releases</name>
        <url>http://139.69.2.40:8081/nexus/content/repositories/releases</url>
    </repository>
    <snapshotRepository>
        <!-- Where to put snapshot artifacts -->
        <id>snapshots</id>
        <name>My Snapshots</name>
        <url>http://139.69.2.40:8081/nexus/content/repositories/snapshots</url>
    </snapshotRepository>
</distributionManagement>
<repositories>
    <repository>
        <id>central</id>
        <url>http://139.69.2.40:8081/nexus/content/repositories/central</url>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </repository>
    <repository>
        <id>apache-snapshots</id>
        <url>http://139.69.2.40:8081/nexus/content/repositories/apache-snapshots</url>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </repository>
    <repository>
        <id>thirdparty</id>
        <url>http://139.69.2.40:8081/nexus/content/repositories/thirdparty</url>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </repository>
    <repository>
        <id>releases</id>
        <url>http://139.69.2.40:8081/nexus/content/repositories/releases</url>
        <snapshots>
            <enabled>false</enabled>
            <updatePolicy>always</updatePolicy>         
        </snapshots>
    </repository>
    <repository>
        <id>snapshot</id>
        <url>http://139.69.2.40:8081/nexus/content/repositories/snapshots</url>
        <snapshots>
            <enabled>true</enabled>
            <updatePolicy>always</updatePolicy>         
        </snapshots>
    </repository>
</repositories>

<pluginRepositories>
    <pluginRepository>
        <id>central</id>
        <url>http://139.69.2.40:8081/nexus/content/repositories/central</url>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
        <releases>
            <updatePolicy>never</updatePolicy>
        </releases>
    </pluginRepository>
    <pluginRepository>
        <id>apache-snapshots</id>
        <url>http://139.69.2.40:8081/nexus/content/repositories/apache-snapshots</url>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
        <releases>
            <updatePolicy>never</updatePolicy>
        </releases>
    </pluginRepository>
    <pluginRepository>
        <id>thirdparty</id>
        <url>http://139.69.2.40:8081/nexus/content/repositories/thirdparty</url>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
        <releases>
            <updatePolicy>never</updatePolicy>
        </releases>
    </pluginRepository>
</pluginRepositories>
<dependencies>
    <dependency>
        <groupId>net.lingala.zip4j</groupId>
        <artifactId>zip4j</artifactId>
        <version>1.3.2</version>
    </dependency>
    <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-core</artifactId>
        <version>2.8.6</version>
    </dependency>
    <dependency>
        <groupId>com.github.fge</groupId>
        <artifactId>jackson-coreutils</artifactId>
        <version>1.8</version>
    </dependency>
    <dependency>
        <groupId>com.github.fge</groupId>
        <artifactId>json-schema-core</artifactId>
        <version>1.2.5</version>
    </dependency>
    <dependency>
        <groupId>com.github.fge</groupId>
        <artifactId>json-schema-validator</artifactId>
        <version>2.2.6</version>
    </dependency>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>3.8.1</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.icmp4j</groupId>
        <artifactId>platform</artifactId>
        <version>3.5.1</version>
    </dependency>
    <dependency>
        <groupId>org.icmp4j</groupId>
        <artifactId>jna</artifactId>
        <version>3.5.1</version>
    </dependency>
    <dependency>
        <groupId>org.icmp4j</groupId>
        <artifactId>icmp4j</artifactId>
        <version>3.5.1</version>
    </dependency>
    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-api</artifactId>
        <version>2.3</version>
    </dependency>
    <dependency>
        <groupId>commons-net</groupId>
        <artifactId>commons-net</artifactId>
        <version>3.6</version>
    </dependency>
    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-core</artifactId>
        <version>2.3</version>
    </dependency>
    <dependency>
        <groupId>com.google.code.gson</groupId>
        <artifactId>gson</artifactId>
        <version>2.3.1</version>
    </dependency>
    <dependency>
        <groupId>org.java-websocket</groupId>
        <artifactId>java-websocket</artifactId>
        <version>1.3.0</version>
    </dependency>
</dependencies>
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.18.1</version>
            <configuration>
                <skipTests>true</skipTests>
            </configuration>
        </plugin>
        <plugin>
            <artifactId>maven-source-plugin</artifactId>
            <version>3.0.1</version>
            <executions>
                <execution>
                    <id>attach-sources</id>
                    <phase>deploy</phase>
                    <goals>
                        <goal>jar-no-fork</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>3.0.0</version>
            <executions>
                <execution>
                    <id>attach-javadocs</id>
                    <phase>deploy</phase>
                    <goals>
                        <goal>jar</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
        <!-- Tell maven to compile using Java 1.8 -->

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.7.0</version>
            <configuration>
                <source>1.6</source>
                <target>1.6</target>
                <encoding>UTF-8</encoding>
                <executable>${JAVA_6_HOME}\bin\javac.exe</executable>
                <compilerArguments>
                    <bootclasspath>${JAVA_6_HOME}\jre\lib\rt.jar</bootclasspath>
                </compilerArguments>
                <fork>true</fork>
            </configuration>
        </plugin>
        <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <version>2.4</version>
            <executions>
                <execution>
                    <id>build-first</id>
                    <configuration>
                        <appendAssemblyId>false</appendAssemblyId>
                        <archive>
                            <manifest>
                                <mainClass>com.core.DataAdapterFB1</mainClass>
                            </manifest>
                        </archive>
                        <descriptorRefs>
                            <descriptorRef>jar-with-dependencies</descriptorRef>
                        </descriptorRefs>
                        <finalName>DataAdapterFB1</finalName>
                    </configuration>
                    <phase>package</phase>
                    <goals>
                        <goal>single</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

标签: javamaven

解决方案


推荐阅读