开发者

Setup a remote FTP as a remote Maven repository?

We've been working with maven for quite some time now, and we are trying to take it to the next level...

There are a couple of Jars, that we would like to allow access to people in our organization only. So at first we all referred to the same shared folder as our local repository in the settings.xml, and it was nice for a while, when there was an individual working on a single project.

Now, we would like to have our own "Remote repository" if that is how it is called, a remote FTP that will hold the repository, with HTTP domain which points to the repository folder on that FTP.

For some reason, we can deploy Jar's, Sources and JavaDocs, but we cannot rebuild the indexes of the repository. We assume that some sort of indexing files are required, for the FTP repository, but we are unable to create these using Nexus or Artifactory. (We have something fundamentally wrong in our understanding of remote repositories)

So our question is, what are we doing wrong?

The Error we keep getting from Eclipse:

Unable to update index for repository|http://domain-referring-to-the-ftp-repository-folder

We have updated our settings.xml to:

<settings xmlns="http://maven.apache.org/SETTINGS/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
<localRepository>
    c:\localRepository\
</localRepository>
<servers>
    <server>
        <username>user</username>
        <password>pass</password>
        <id>rep-id</id>
    </server>
</servers>
<mirrors>
    <mirror>
        <mirrorOf>rep-id</mirrorOf>
        <name>My Repository</name>
        <url>http://domain-referring-to-the-ftp-repository-folder</url>
        <id>repository</id>
    </mirror>
</mirrors>
</settings>

Just to be sure here are the deploy configuration which works, and deploy as described开发者_如何学JAVA above:

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-deploy-plugin</artifactId>
            <version>2.5</version>
            <configuration>
                <altDeploymentRepository>rep-id::default::ftp://x.x.x.x/repository</altDeploymentRepository>
            </configuration>
        </plugin>

Thanks in advance,

Adam.


Sharing local repository is really bad: local repository should be considered as private cache of Maven running on developers machine... For start, it's not concurrency safe at all, so you have to be lucky (or work on really non-interleaving projects) to not hit any problem so far with your initial setup.

Your idea about remote repository is good, but there are some problems with it's implementations. MRMs (Maven Repository Manager, both Artifactory and Nexus are MRMs and much more) will solve all your problems.

For start I'd recommend reading some of these: http://www.sonatype.com/books/nexus-book/reference/ http://www.sonatype.com/books.html

And some blogs: http://www.sonatype.com/people/2011/04/how-not-to-download-the-internet/

In nutshell: For transport, use HTTP for best results. Maven and MRMs have the best support for it. When having MRM, you don't need any "infra" next to it, like FS server with HTTPd or FTP daemon, since MRMs itself not just hosts your deploys, it shares them to your teammates, but also proxies, secure them, index them, etc.

From your question, it's unclear why do you deploy using FTP (none of the MRMs support FTP transport, AFAIK at least), where are your artifacts located, and many other details. Read the docos, and build up nice and cozy ecosystem for your shop!

Good luck!

Note: as Nexus lead dev, I am affiliated with Sonatype and Nexus.


Your ftp repository does not have a repository index file, which is requested by m2eclipse. Hence the message.

The message by itself is nothing to worry about. Dependencies in this repository should get downloaded, if the groupId/projectId are correctly/explicitly specified.

You may want to look at this related SO post and the link referred therein as well.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜