Download Maven2 dependency from non-standard layout repository

I need to download a file from a non-standard layout repository.

The standard repository layout is groupId>/<artifactId>/<version>/<artifactId>-<version>.<packaging> however, I need to download the following file:

http://hudson.myserver.com:10000/repo/ocp-services/schemas/trunk/201/archive/schemas/dist/schemas.jar

where ocp-services is effectively the groupId, schemas is the artifactId and 201 is the version.

How would I add a dependency to this file and get it downloaded into my project and local repository?

This is a Hudson file repository if this is of any help, but it is a third parties so difficult to get them to change any location.

Answers


One option would be to register a custom ArtifactRepositoryLayout implementation and to declare a repository using this custom layout. I've never done that but it should be possible, check this blog post.

A second option would be to configure Maven to go through some kind of custom proxy (e.g. a Servlet) and to rewrite the URL on the fly for this particular dependency.

In both cases, I'm afraid Maven will complain about missing metadata ("A dependency in Maven isn't just a JAR file", see 3.5.5. Maven's Dependency Management) because the hudson file repository is just not a Maven repository. Maybe this can be handled programmatically though. But as I said, I've never done this.

A third option would be to ask the project building the JAR you need to deploy it (in the maven sense). That would be of course the best solution.

A last one option would be to just download this JAR and to install it manually in your local repository. If this is an option, go for it.


Have you tried adding this to your pom.xml :

<dependencies>
            <dependency>
                <groupId>ocp-services</groupId>
                <artifactId>schemas</artifactId>
                <version>201</version>
                <type>jar</type>
            </dependency>
        </dependencies>

or if that don't work as Pascal says install it manually


Need Your Help

mvc ajax begin form and renderpartial validation open

partial-views renderpartial

ı am using a view in ajax begin form. ı search one thing and result is correct then alert not render the partial view. but it isnt render correct view a blank page and a see my partial view. thanks...

Magento Sale Emails Not Centered

html css email magento

I can't figure out why the sale email I received is not centered. Here is the screen shot from my email account (yahoo mails)

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.