Howto configure maven2 repositories in a pom.xml

Posted on 2009-02-24
Last Modified: 2012-05-06
I've used the wagon-plugin to create a maven repository in my GoogleCode svn-repository and wanted to configure another project to correctly access this repository, but I seem to completely miss the point, or maybe maven2 is?

Here's what I setup in my pom.xml for the project where I want to use the plugin:

I had added the pluginRepositories after many a failed attempt to get the jar-file, even thought the pom for my jsdoctk-plugin was being downloaded, somehow, don't ask me what the specific setup was at that time. However, this configuration in maven 2.0.8 will simply state that the required files were not found, it even includes these mirrors in the places it supposedly went looking. So, I upgraded to 2.0.10, thinking that maybe my maven was too old. As a result it didn't even check my custom repositories anymore, so I started muddling around again and in the end added these mirrors to my settings.xml:

                   <name>jsdoctk Maven Repository</name>
                   <name>jsdoctk Maven Repository</name>

This will make it work, in both 2.0.8 as well as 2.0.10, but I'm left thinking, did I do something wrong? It should be easier than this, right?

The reason I want to know for sure that this is the only way to do it, is because I want to setup a howto on my GoogleCode project to make easy for other developers to start using my plugin without manualy installing it to their local repo... Hope somebody here knows more about repo's in maven2...
Question by:mreuring
    LVL 23

    Expert Comment

    I am not sure I got your question. Are you trying to add custom source
    code repository? The way you have written the pom.xml, you have added
    the plugin's maven repository location (*not* the source respository).
    LVL 17

    Author Comment

    No, I'll try to rephrase.
    I want to use a plugin called jsdoctk-plugin within a new project, for generating documentation out of javascript files. Since the plugin isn't in the maven repository I need to install it manually or get it from a seperate maven-repository which was created within the svn-repository of the plugin project at This is a valid maven repository, even though it is managed within a source repository.

    The objective is to create a pom.xml for a new project that will allow another programmer to install the project without the need to modify his/her settings.xml and without the need to install the plugin manually, however all my attempts seem to need those 'mirror' configurations within the settings.xml, otherwise maven simply fails to download the pom and jar for the plugin, I just don't understand why and was hoping somebody here has plenty of experience with this and can point out the obvious error that I overlooked?
    LVL 17

    Accepted Solution

    I've figured it out, my pom.xml was fine, the problem was in my 'settings.xml'. Long time ago, when I wasn't so wise in maven 2 and working on a new project that required projects that weren't in the apache repository somebody had told me to add a couple of mirrors with a <mirrorOf>*</mirrorOf> attribute, these mirrors were now replacing the repository defined within my project. Only by specifying a more specific <mirroOf>jsdoctk1</mirrorOf> was I overruling these mirrors, the other option being to simply remove the other mirrors...

    So, everything's now working as expected! The original settings for my pom.xml were all I needed :)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Live - One-on-One Java Help from Top Experts

    Solve your toughest problems, fast.
    Java experts are online now and ready to help you.

    Suggested Solutions

    Title # Comments Views Activity
    userCompare  challenge 3 54
    changePi Challenge 15 56
    How Complex Is This Java Course ? 9 51
    Running Jira on Raspberry PI 2? 3 44
    INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
    After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
    This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now