views:

126

answers:

2

I have used Maven extensively for my personal projects, but now I have to set it up for a small team of 5-7 developers.

My main question is, what's the recommended approach for managing dependencies to commercial libraries that are not available in the Maven repos? How can I manage the dependency of these commercial libraries on the open source libraries that they use and are available in Maven repos?

Also, are there any other recommendations and advices that I should know or implement to make the setup as efficient, effective, and smooth as possible?

Thanks in advance.

+5  A: 

You probably want to start by setting up your own internal Maven repository using Nexus or Artifactory. Configure it as a repository for your own artifacts, and as a caching proxy for Central and any other external repositories that you need to fetch stuff from.

Then create binary only POM files for each of the commercial libraries, including dependencies on the published libraries that they depend on. Upload the POM files and corresponding JAR files to your internal repository in the required structure. Just make sure that these POMs and JARs are not visible outside your group / organization ... depending on what the license for the respective commercial products permit / require.

Of course, this means that you won't be able to make your applications (that depend on these libraries) publicly available via Maven. But you've probably already factored this into your planning.

Stephen C
You **can** make your apps public but your consumers will need to add the private POM+JARs to their own repository (or proxy) just like you did.
Chris Nava
@Chris - agreed, but that is a **LOT** to ask of the consumers of your software!
Stephen C
Thanks. Any other advices and recommendations?
Bytecode Ninja
@Stephen_C True. Wish it weren't so. :-(
Chris Nava
Use the Maven Repository Browser (http://www.mvnbrowser.com/index.html) to find a public repository for your dependencies.
Chris Nava
@Chris - I'm not impressed with mvnbrowser. It failed to find repositories for Sesame which I know to be publicly available.
Stephen C
@Chris - the way I deal with proprietary libraries is to avoid using them :-)
Stephen C
@Stephen C right on! Also, if you find something better then mvnbrowser please post it. I'm not exactly thrilled with the current options. ;-)
Chris Nava
+4  A: 

i strongly advise to use a super parent pom with some common settings like

                <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <inherited>true</inherited>
                <configuration>
                    <source>1.6</source><!-- java version -->
                    <target>1.6</target>
                    <encoding>UTF-8</encoding><!-- your source encodings -->
                    <debug>true</debug><!-- false for production -->
                    <optimize>false</optimize><!-- true for production -->
                    <showDeprecation>true</showDeprecation>
                </configuration>
            </plugin>

actually there a lot of those "common" settings (report plugins), a parent pom guarantees that all use the same and a change reaches all

well what else - beside an own maven repo (try nexus) - ?

  • check used IDEs, Eclipse, Netbeans and IntelliJ have different levels of maven support and sad but true different behaviour, if you can, get your team to use one IDE
  • think about a build server like hudson
Michael Lange