【问题标题】:Connector for maven deployment?Maven部署的连接器?
【发布时间】:2013-08-17 16:03:11
【问题描述】:

我为 Vaadin/Hibernate/Spring 项目创建了一个工作的 maven 原型。我能够将此原型安装到我的本地存储库并使用它来生成新的 maven 项目。

现在我想将原型部署到我公司的内部存储库,以便其他开发人员可以使用它。但是,当我运行 mvn deploy 时,我收到以下错误消息:

[ERROR] Failed to execute goal org.apache.maven.plugins:
maven-deploy-plugin:2.7:deploy (default-deploy) on project 
vaadin-hibernate-archetype: Failed to deploy artifacts/metadata: 
No connector available to access repository maven.planet-ic.de 
(maven.planet-ic.de/planet-ic-releases) of type default using the 
available factories WagonRepositoryConnectorFactory -> [Help 1]

我缺少的connector 是什么?

编辑:我不是要找人来解决我的问题,只是想了解'connector' 是什么。

如果你感兴趣的话,这里是我的 pom.xml:

<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">

    <modelVersion>4.0.0</modelVersion>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>
    <groupId>de.planetic.maven.archetype.vaadin</groupId>
    <artifactId>vaadin-hibernate-archetype</artifactId>
    <version>1.1.0</version>
    <packaging>jar</packaging>
    <inceptionYear>2013</inceptionYear>
    <description>
        This archetype generates a Vaadin application for use with Hibernate, and to be deployed to a Tomcat 7 server.  It may also work with other Tomcat versions and other servers.
    </description>
    <developers>
        <developer>
            <name>Maximilian Friedersdorff</name>
            <email>max.friedersdorff@planet-ic.de</email>
        </developer>
    </developers>
    <scm>
        <connection>scm:svn:http://subversion.planet-ic.de/internal/maven/archetype/pinnwand-webapp/tags/pinnwand-webapp-archetype-1.1.0</connection>
        <developerConnection>scm:svn:http://subversion.planet-ic.de/internal/maven/archetype/pinnwand-webapp/tags/pinnwand-webapp-archetype-1.1.0</developerConnection>
        <url>http://subversion.planet-ic.de/internal/maven/archetype/pinnwand-webapp/tags/pinnwand-webapp-archetype-1.1.0</url>
    </scm>
    <distributionManagement>
        <repository>
            <id>maven.planet-ic.de</id>
            <name>planet-ic-releases</name>
            <url>maven.planet-ic.de/planet-ic-releases</url>
        </repository>
        <snapshotRepository>
            <id>maven.planet-ic.de</id>
            <name>planet-ic-snapshots</name>
            <url>http://maven.planet-ic.de/planet-ic-snapshots</url>
        </snapshotRepository>
    </distributionManagement>

    <build>
        <pluginManagement>
            <plugins>  
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>2.7</version>
                </plugin>
            </plugins>
        </pluginManagement>

        <extensions>
            <extension>
                <groupId>org.apache.maven.wagon</groupId>
                <artifactId>wagon-ssh</artifactId>
                <version>2.4</version>
            </extension>
        </extensions>
    </build>
</project>

【问题讨论】:

  • pom.xml 中没有相关节表示没有帮助
  • @JarrodRoberson 正如我所说:我不是在寻求解决特定问题的帮助,而是寻求关于“连接器”是什么的解释。
  • @DB5 哇!不错的编辑。你是怎么做到的?
  • @maxf130,基本上只是开启了语法高亮:stackoverflow.com/editing-help#syntax-highlighting

标签: maven maven-deploy-plugin


【解决方案1】:

根据您尝试部署到的 Maven 存储库,有多种方法可用于上传您的工件。

这些方法是使用 Maven Wagon 连接器实现的,用于不同的传输协议(例如 ssh、dav 等),这是您要查找的术语。

Apache Maven Guide to using Extensions 向您介绍如何将连接器添加到您的设置中。

【讨论】:

  • @Torten 谢谢,这正是我想要的。感谢您为我指明正确的方向。
  • 感谢您的回答。它刚刚救了我!
【解决方案2】:

在下面一行:

<url>maven.planet-ic.de/planet-ic-releases</url>

您需要添加“file://”前缀,因为您需要告诉 maven 您使用的是文件连接器而不是 ftp、http 或其他东西。 你最好在那里使用相对路径。例如:

<url>file://${project.basedir}/maven.planet-ic.de/planet-ic-releases/</url>

【讨论】:

  • 这不是文件存储库
  • 仍然需要是正确的网址。对我来说是一个有用的评论
【解决方案3】:
 <build>
 <extensions>
    <extension>
        <groupId>org.apache.maven.wagon</groupId>
        <artifactId>wagon-ssh</artifactId>
        <version>2.4</version>
    </extension>
 </extensions>
 </build>

 <distributionManagement>
 <repository>
  <id>remoteserver</id>
  <name>MyCompany Repository</name>
  <url>scp://server/path/repo</url>
</repository>

【讨论】:

  • 那是 SCP,不是 SFTP。
【解决方案4】:

如果它对其他人有帮助,请将以下内容添加到 pom.xml 让它为我工作

<build>
  <extensions>
    <extension>
      <groupId>org.springframework.build</groupId>
      <artifactId>aws-maven</artifactId>
      <version>5.0.0.RELEASE</version>
    </extension>
  </extensions>
</build>

【讨论】:

    猜你喜欢
    • 2017-01-20
    • 1970-01-01
    • 1970-01-01
    • 2014-09-13
    • 1970-01-01
    • 1970-01-01
    • 2015-01-05
    • 2011-05-12
    • 2019-08-01
    相关资源
    最近更新 更多