diestl
diestl

Reputation: 2058

Connector for maven deployment?

I have created a working maven archetype for a Vaadin/Hibernate/Spring project. I am able to install this archetype to my local repository and use it to generate new maven projects.

Now I want to deploy the archetype to my companies internal repository, so it might be used by other developers. However, when I run mvn deploy I recieve the following error message:

[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]

What is the connector that I am missing?

EDIT: I am not asking for someone to solve my problem, just some insight as to what the 'connector' is.

Here is my pom.xml if it should be of interest:

<?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>[email protected]</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>

Upvotes: 12

Views: 34423

Answers (5)

McAngujo
McAngujo

Reputation: 115

Was having the same issue with deployment to private repo through sftp instead of scp.

Resolved it by setting the following.

Java 11

pom.xml

    <distributionManagement>
        <repository>
            <id>setting_id</id>
            <url>sftp://maven...../maven</url>
        </repository>
        <snapshotRepository>
            <id>setting_id_snapshot</id>
            <url>sftp://maven...../maven</url>
        </snapshotRepository>
    </distributionManagement>
    <build>
        <plugins>
            <!-- ...other plugins...-->
            <plugin>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>3.0.0</version>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.maven.wagon</groupId>
                        <artifactId>wagon-ssh</artifactId>
                        <version>3.5.2</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <id>default-deploy</id>
                        <phase>deploy</phase>
                        <goals>
                            <goal>deploy</goal>
                        </goals>
                    </execution>
                </executions>
                </plugin>
        </plugins>
    </build>

settings.xml

    <server>
        <id>server_id</id>
        <username>repo_user</username>
        <privateKey>/var/lib/jenk_user/.ssh/id_rsa</privateKey>
        <directoryPermissions>744</directoryPermissions>
        <filePermissions>664</filePermissions>
    </server>

Had tried using <artifactId>wagon-ssh-external</artifactId> to no success.

Hope somebody finds it helpful.

Upvotes: 0

Nathan Adams
Nathan Adams

Reputation: 1255

In case it helps others, adding the following to the pom.xml got it working for me

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

Upvotes: 0

shifu.zheng
shifu.zheng

Reputation: 711

In the following line:

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

You need to add prefix of "file://", because you need to tell maven you are using file connector not ftp, http or something else. And you'd better to use relative path there. For example:

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

Upvotes: 3

ashok dethe
ashok dethe

Reputation: 11

 <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>

Upvotes: 0

Torsten
Torsten

Reputation: 6204

Depending on the maven repository you are trying to deploy to there are various methods available to upload your artifacts.

These methods are implemented using Maven Wagon connectors for different transport protocols (e.g. ssh,dav etc.), this is the term you are looking for.

Apache Maven Guide to using Extensions gives you an introduction on how to add connectors to your setup.

Upvotes: 15

Related Questions