Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting up Maven for a team

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.

like image 567
Behrang Avatar asked May 29 '10 03:05

Behrang


2 Answers

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.

like image 65
Stephen C Avatar answered Sep 23 '22 03:09

Stephen C


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
like image 25
Michael Pralow Avatar answered Sep 19 '22 03:09

Michael Pralow