当前位置: 首页 > 知识库问答 >
问题:

无法将快照项目部署到nexus

齐朝明
2023-03-14

我刚刚在我的Windows Tomcat上安装了Nexus2.7.1,并启动运行。我试图使用“maven deploy”命令将一个快照jar部署到Nexus快照repo中,但收到以下错误。使用Maven 3.0.5版。请引导。

<settings>
    <mirrors>
        <mirror>
            <id>Nexus</id>
            <name>Nexus Public Mirror</name>
            <url>http://localhost:9090/nexus/content/groups/public</url>
            <mirrorOf>central</mirrorOf>
        </mirror>
    </mirrors>
    <servers>
        <server>
            <id>nexus-server</id>
            <username>admin</username>
            <password>admin123</password>
        </server>
    </servers>
</settings>
<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>com.study</groupId>
    <artifactId>release-plugin-rnd</artifactId>
    <version>1.3-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>release-plugin-rnd</name>
    <url>http://maven.apache.org</url>

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

    <scm>
        <connection>scm:svn:https://my-svn-server/svn/maven-rnd/release-plugin-rnd/trunk</connection>
        <developerConnection>scm:svn:https://my-svn-server/svn/maven-rnd/release-plugin-rnd/trunk</developerConnection>
        <url>https://my-svn-server/svn/maven-rnd/release-plugin-rnd/trunk</url>
    </scm> 

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <configuration>
                    <tagBase>https://my-svn-server/svn/maven-rnd/release-plugin-rnd/tags</tagBase>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>2.7</version>
                <executions>
                    <execution>
                        <id>default-deploy</id>
                        <phase>deploy</phase>
                        <goals>
                            <goal>deploy</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <distributionManagement>
        <snapshotRepository>
            <id>snapshots</id>
            <name>Internal Snapshots</name>
            <url>http://my-nexus-server:9090/nexus/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>releases</id>
            <name>Internal Releases</name>
            <url>http://my-nexus-server:9090/nexus/content/repositories/releases</url>
        </repository>
    </distributionManagement>

</project>

共有1个答案

卢朝
2023-03-14

我对镜像功能没有任何经验,但我可以尝试从我设置我们的私人公司nexus服务器时提供帮助。当您在pom中指定一个id时,它应该与您在settings.xml中定义的id匹配。所以你想做的事情是这样的:

  <servers>
        <server>
            <id>terraframe-releases</id>
            <username>myUsername</username>
            <password>myPassword</password>
        </server>
        <server>
            <id>terraframe-snapshots</id>
            <username>myUsername</username>
            <password>myPassword</password>
        </server>
        <server>
            <id>terraframe-thirdparty</id>
            <username>myUsername</username>
            <password>myPassword</password>
        </server>
    </servers>

然后在pom中引用相同的ID:

 <distributionManagement>
    <repository>
      <id>terraframe-releases</id>
      <name>terraframe-releases</name>
      <url>http://terraframe.com:8081/nexus/content/repositories/releases/</url>
      <layout>default</layout>
    </repository>
    <snapshotRepository>
      <id>terraframe-snapshots</id>
      <name>terraframe-snapshots</name>
      <url>http://terraframe.com:8081/nexus/content/repositories/snapshots/</url>
      <layout>default</layout>
    </snapshotRepository>
  </distributionManagement>
 类似资料:
  • 无法将快照工件部署到Nexus存储库。我一直收到返回代码400。无法部署项目:无法传输项目网络。iin:iin-web-0.0.1-snapshot:jar:iin-parent从/到快照(http://localhost:8081/nexus/content/repositories/snapshots/net/iin/iin-web-0.0.1-snapshot/iin-parent/iin-

  • 我正在尝试使用 aws 工具包从 eclipse 将亚马逊 Java Web 应用程序部署到豆茎(适用于 Tomcat 7 的 AWS 弹性豆茎)。 但是我面临着以下错误:

  • 我在使用以下内容进行构建时遇到问题: mvn清理-U安装-Dmaven.test.skip=true 人工制品不在nexus中,而是在我的本地存储库中创建的。 [错误]无法在项目mis-core上执行目标:无法解决项目x. y. z: mis-core: ejb: 0.0.1-SNAPSHOT的依赖关系:无法在https://company.net:8080/nexus/content/repos

  • 2. 项目部署 本章主要介绍如何部署Camel。 首先,介绍Vagrant这个虚拟机工具。借助Vagrant,我们可以保证本地开发及测试环境与线上环境的一致。 随后介绍slb-admin的部署。管理端本地也要安装Dengine,用以测试Nginx配置文件的语法是否正确。此外,还需要部署数据库:MySQL及MongoDB。 最后介绍Nginx服务器的部署。我们可以根据具体需求部署Nginx集群,每台

  • 描述 本文档提供了 3 种部署方式,对应 Jboot 里的 3 种打包方式。 通过 脚本 运行 在 打包方式 文档中,我们可以把项目打包成一个 .zip 的压缩包项目,里面带有 jboot.sh (和 jboot.bat) 执行脚本, 只需要我们解压 .zip 压缩文件,通过如下命令就可以对 jboot 项目进行启动和停止。 # 启动 ./jboot.sh start # 停止 ./jboot.

  • 部署中,你可以先构建打包生成环境代码,再启动服务。因此,构建和启动分为下面两条命令: next build next start 例如,使用now去部署package.json配置文件如下: { "name": "my-app", "dependencies": { "next": "latest" }, "scripts": { "dev": "next",