梅文。快照更新(首次下载)不起作用

发布于 2024-10-19 09:54:26 字数 8014 浏览 3 评论 0原文

我从本地存储库创建了远程存储库(发布版和快照)。两个新的远程存储库均已添加到组/公共中。 我尝试从头开始构建项目,但我的新本地存储库是空的。

在快照下载期间,我收到以下错误:

[WARNING] The POM for net.homecredit.ws:integration.tests.base.ru:jar:1.0.0-SNAPSHOT is missing, no dependency information available

...

[ERROR] Failed to execute goal on project webclient-ru: Could not resolve dependencies for project net.company.ws:webclient-ru:jar:1.0.0-SNAPSHOT:

Could not find artifact net.company.ws:integration.tests.base.ru:jar:1.0.0-SNAPSHOT -> [Help 1]

Output of dir command in snapshot-repo in directory with Problem snapshot:

Dir C:\Nexus\sonatype-work\nexus\storage\rep-snapshots\net\company\ws\integration.tests.base.ru\1.0.0-SNAPSHOT
28.02.2011  11:28    <DIR>          .
28.02.2011  11:28    <DIR>          ..
28.02.2011  11:28                 0 1
25.02.2011  11:50            15 551 integration.tests.base.ru-1.0.0-20100429-030459-1.jar
28.02.2011  11:19                32 integration.tests.base.ru-1.0.0-20100429-030459-1.jar.md5
28.02.2011  11:19                40 integration.tests.base.ru-1.0.0-20100429-030459-1.jar.sha1
25.02.2011  11:50             1 462 integration.tests.base.ru-1.0.0-20100429-030459-1.pom
28.02.2011  11:19                32 integration.tests.base.ru-1.0.0-20100429-030459-1.pom.md5
28.02.2011  11:19                40 integration.tests.base.ru-1.0.0-20100429-030459-1.pom.sha1
25.02.2011  11:50            15 551 integration.tests.base.ru-1.0.0-SNAPSHOT.jar
28.02.2011  11:19                32 integration.tests.base.ru-1.0.0-SNAPSHOT.jar.md5
28.02.2011  11:19                40 integration.tests.base.ru-1.0.0-SNAPSHOT.jar.sha1
25.02.2011  11:50             1 462 integration.tests.base.ru-1.0.0-SNAPSHOT.pom
28.02.2011  11:19                32 integration.tests.base.ru-1.0.0-SNAPSHOT.pom.md5
28.02.2011  11:19                40 integration.tests.base.ru-1.0.0-SNAPSHOT.pom.sha1
25.02.2011  18:26               794 maven-metadata.xml
28.02.2011  11:19                32 maven-metadata.xml.md5
28.02.2011  11:19                40 maven-metadata.xml.sha1

经过一番尝试后,我放置了具有两种可能名称的文件。它们的内容是相同的。

我的 maven settings.xml:

<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
    <!-- localRepository
  | The path to the local repository maven will use to store artifacts.
  |
  | Default: ~/.m2/repository
    -->
    <localRepository>C:\Donz\Projects\Maven\repository</localRepository>
        <servers>
        <server>
            <id>hci-private-releases</id>
            <username>deployment</username>
            <password>deployment123</password>
        </server>
        <server>
            <id>hci-private-snapshots</id>
            <username>deployment</username>
            <password>deployment123</password>
        </server>
        <server>
            <id>thirdparty</id>
            <username>deployment</username>
            <password>deployment123</password>
        </server>
    </servers>

    <profiles>
        <profile>
            <id>dev</id>
            <repositories>
                <repository>
                    <id>central</id>
                    <name>central</name>
                    <url>http://rep-pc.company.ru:8081/nexus/content/groups/public</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <updatePolicy>always</updatePolicy>
                        <enabled>true</enabled>
                    </snapshots>
                </repository>
                <repository>
                    <id>public</id>
                    <name>Local repository for public group</name>
                    <url>http://rep-pc.company.ru:8081/nexus/content/groups/public</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <updatePolicy>always</updatePolicy>
                        <enabled>true</enabled>
                    </snapshots>
                </repository>
                <repository>
                    <id>public-snapshots</id>
                    <name>Local repository for public snapshots group</name>
                    <url>http://rep-pc.company.ru:8081/nexus/content/repositories/rep-snapshots</url>
                    <releases>
                        <enabled>false</enabled>
                    </releases>
                    <snapshots>
                        <updatePolicy>always</updatePolicy>
                        <enabled>true</enabled>
                    </snapshots>
                </repository>
            </repositories>
            <pluginRepositories>
                <pluginRepository>
                    <id>hci-plugins-releases</id>
                    <name>Maven plugins repository</name>
                    <url>http://rep-pc.company.ru:8081/nexus/content/groups/public</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <updatePolicy>always</updatePolicy>
                        <enabled>true</enabled>
                    </snapshots>
                </pluginRepository>
                <pluginRepository>
                    <id>hci-plugins-snapshots</id>
                    <name>Maven plugins releases repository</name>
                    <url>http://rep-pc.company.ru:8081/nexus/content/repositories/rep-snapshots</url>
                    <releases>
                        <enabled>false</enabled>
                    </releases>
                    <snapshots>
                        <updatePolicy>always</updatePolicy>
                        <enabled>true</enabled>
                    </snapshots>
                </pluginRepository>
            </pluginRepositories>
        </profile>
    </profiles>

    <mirrors>
        <!-- mirror
        | Specifies a repository mirror site to use instead of a given repository. The repository that
        | this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used
        | for inheritance and direct lookup purposes, and must be unique across the set of mirrors.
        |
        -->
        <mirror>
          <id>central</id>
          <mirrorOf>central</mirrorOf>
          <name>nexus  repo</name>
          <url>http://rep-pc.company.ru:8081/nexus/content/groups/public</url>
        </mirror>
    </mirrors>
</settings>

maven 的控制台参数:

--no-plugin-registry --fail-fast --no-plugin-updates --strict-checksums \
--update-snapshots -s C:\Donz\Projects\Maven\settings.xml -f \
C:\Donz\Projects\WebClient\pom.xml install

缓存、元数据、索引已过期、快照存储库和组/公共的重建和更新。快照存储库已重新启动。

如果我将丢失的快照文件放入本地存储库,maven 不会报告任何错误。

从远程仓库下载快照有什么问题?

I created remote repositories (release and snapshot) from local repository. Both new remote reposotories were added yo groups/public.
I try to make project build from scratch and my new local repo is empty.

During snapshot downloading I get following error:

[WARNING] The POM for net.homecredit.ws:integration.tests.base.ru:jar:1.0.0-SNAPSHOT is missing, no dependency information available

...

[ERROR] Failed to execute goal on project webclient-ru: Could not resolve dependencies for project net.company.ws:webclient-ru:jar:1.0.0-SNAPSHOT:

Could not find artifact net.company.ws:integration.tests.base.ru:jar:1.0.0-SNAPSHOT -> [Help 1]

Output of dir command in snapshot-repo in directory with problem snapshot:

Dir C:\Nexus\sonatype-work\nexus\storage\rep-snapshots\net\company\ws\integration.tests.base.ru\1.0.0-SNAPSHOT
28.02.2011  11:28    <DIR>          .
28.02.2011  11:28    <DIR>          ..
28.02.2011  11:28                 0 1
25.02.2011  11:50            15 551 integration.tests.base.ru-1.0.0-20100429-030459-1.jar
28.02.2011  11:19                32 integration.tests.base.ru-1.0.0-20100429-030459-1.jar.md5
28.02.2011  11:19                40 integration.tests.base.ru-1.0.0-20100429-030459-1.jar.sha1
25.02.2011  11:50             1 462 integration.tests.base.ru-1.0.0-20100429-030459-1.pom
28.02.2011  11:19                32 integration.tests.base.ru-1.0.0-20100429-030459-1.pom.md5
28.02.2011  11:19                40 integration.tests.base.ru-1.0.0-20100429-030459-1.pom.sha1
25.02.2011  11:50            15 551 integration.tests.base.ru-1.0.0-SNAPSHOT.jar
28.02.2011  11:19                32 integration.tests.base.ru-1.0.0-SNAPSHOT.jar.md5
28.02.2011  11:19                40 integration.tests.base.ru-1.0.0-SNAPSHOT.jar.sha1
25.02.2011  11:50             1 462 integration.tests.base.ru-1.0.0-SNAPSHOT.pom
28.02.2011  11:19                32 integration.tests.base.ru-1.0.0-SNAPSHOT.pom.md5
28.02.2011  11:19                40 integration.tests.base.ru-1.0.0-SNAPSHOT.pom.sha1
25.02.2011  18:26               794 maven-metadata.xml
28.02.2011  11:19                32 maven-metadata.xml.md5
28.02.2011  11:19                40 maven-metadata.xml.sha1

After some tries I put files with both possible names. Their content is the same.

My settings.xml for maven:

<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
    <!-- localRepository
  | The path to the local repository maven will use to store artifacts.
  |
  | Default: ~/.m2/repository
    -->
    <localRepository>C:\Donz\Projects\Maven\repository</localRepository>
        <servers>
        <server>
            <id>hci-private-releases</id>
            <username>deployment</username>
            <password>deployment123</password>
        </server>
        <server>
            <id>hci-private-snapshots</id>
            <username>deployment</username>
            <password>deployment123</password>
        </server>
        <server>
            <id>thirdparty</id>
            <username>deployment</username>
            <password>deployment123</password>
        </server>
    </servers>

    <profiles>
        <profile>
            <id>dev</id>
            <repositories>
                <repository>
                    <id>central</id>
                    <name>central</name>
                    <url>http://rep-pc.company.ru:8081/nexus/content/groups/public</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <updatePolicy>always</updatePolicy>
                        <enabled>true</enabled>
                    </snapshots>
                </repository>
                <repository>
                    <id>public</id>
                    <name>Local repository for public group</name>
                    <url>http://rep-pc.company.ru:8081/nexus/content/groups/public</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <updatePolicy>always</updatePolicy>
                        <enabled>true</enabled>
                    </snapshots>
                </repository>
                <repository>
                    <id>public-snapshots</id>
                    <name>Local repository for public snapshots group</name>
                    <url>http://rep-pc.company.ru:8081/nexus/content/repositories/rep-snapshots</url>
                    <releases>
                        <enabled>false</enabled>
                    </releases>
                    <snapshots>
                        <updatePolicy>always</updatePolicy>
                        <enabled>true</enabled>
                    </snapshots>
                </repository>
            </repositories>
            <pluginRepositories>
                <pluginRepository>
                    <id>hci-plugins-releases</id>
                    <name>Maven plugins repository</name>
                    <url>http://rep-pc.company.ru:8081/nexus/content/groups/public</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <updatePolicy>always</updatePolicy>
                        <enabled>true</enabled>
                    </snapshots>
                </pluginRepository>
                <pluginRepository>
                    <id>hci-plugins-snapshots</id>
                    <name>Maven plugins releases repository</name>
                    <url>http://rep-pc.company.ru:8081/nexus/content/repositories/rep-snapshots</url>
                    <releases>
                        <enabled>false</enabled>
                    </releases>
                    <snapshots>
                        <updatePolicy>always</updatePolicy>
                        <enabled>true</enabled>
                    </snapshots>
                </pluginRepository>
            </pluginRepositories>
        </profile>
    </profiles>

    <mirrors>
        <!-- mirror
        | Specifies a repository mirror site to use instead of a given repository. The repository that
        | this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used
        | for inheritance and direct lookup purposes, and must be unique across the set of mirrors.
        |
        -->
        <mirror>
          <id>central</id>
          <mirrorOf>central</mirrorOf>
          <name>nexus  repo</name>
          <url>http://rep-pc.company.ru:8081/nexus/content/groups/public</url>
        </mirror>
    </mirrors>
</settings>

Console arguments for maven:

--no-plugin-registry --fail-fast --no-plugin-updates --strict-checksums \
--update-snapshots -s C:\Donz\Projects\Maven\settings.xml -f \
C:\Donz\Projects\WebClient\pom.xml install

Cache, metadata, indexes were expired, rebuild and renewed for snapshot repo and groups/public. Snapshot-repo was restarted.

If I put missing snapshot files to my local repo maven doesn't report any error.

What is the problem with downloading snapshots from remote repo?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

兔姬 2024-10-26 09:54:26

尝试在 元素内添加 dev

Try to add <activeProfiles><activeProfile>dev</activeProfile></activeProfiles> inside <settings> element.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文