有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java无法从远程maven存储库下载源代码,但可以从本地下载

我有两个java项目:payment-commonpayment-service。 在{}中,我添加了{}:

<project>
    <builds>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>

如果我运行mvn clean package,我会在目标中看到sources.jar

enter image description here

我也看到了这一点。在mvn clean deploy之后远程存储库中的jar文件:

enter image description here

我在项目payment-service中有下一个依赖项:

<dependency>
    <groupId>com.***</groupId>
    <artifactId>payment-common</artifactId>
    <version>1.540.0-SNAPSHOT</version>
</dependency>

如果我试图在Idea中下载源代码,我会遇到下一个错误:

enter image description here

然后呢。我运行mvn clean install,在它们之后我可以成功地下载源代码。 我做错了什么

UPD:pom中的存储库。xml:

    <repositories>
        <repository>
            <id>cloudfront-snapshots</id>
            <name>***</name>
            <url>https://maven.***.net/</url>
        </repository>
        <repository>
            <id>jcenter-snapshots</id>
            <name>jcenter</name>
            <url>https://jcenter.bintray.com/</url>
        </repository>
        <repository>
            <id>maven.***</id>
            <url>s3://***-maven-repo/</url>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>maven.***</id>
            <url>s3://***-maven-repo/</url>
        </pluginRepository>
    </pluginRepositories>
    <distributionManagement>
        <repository>
            <id>maven.***</id>
            <url>s3://***-maven-repo/</url>
        </repository>
        <snapshotRepository>
            <id>maven.***</id>
            <url>s3://***-maven-repo/</url>
        </snapshotRepository>
    </distributionManagement>

共 (0) 个答案