Last Published: 2009-03-23

Maven 2

Insight uses Maven 2 as its source code repository. For more on Maven see http://maven.apache.org. Insight also releases a number of modules in Maven to be referenced from Insight components and other projects. For more information on these see Insight Maven Repositories.

The page talks about...

  1. Maven POM
  2. Maven Settings.xml
  3. Artifacts In Local Repository

Maven POM

Most maven setting for insight modules is done using the pom.xml in the modules or the parent modules. For more information please go through them and should you think, please initiate discussions regarding them on the development mailing list.

Settings.xml

Even with the settings in the pom.xml, there are a number of settings that developers might need to make for their local environments, this is used to let maven know about your local settings like proxy settings, server passwords, non standard repository settings, etc. It is important to configure the insight maintained maven repositories in the maven settings xml file because for downloading certain artifacts, specially the parent modules and poms of insight modules.

Maven maintains its settings in a file by default at ~/.m2/settings.xml. For a reference of the entries in this file, head over to http://maven.apache.org/ref/2.0.8/maven-settings/settings.html. A sample settings.xml pre configured with some insight settings is given below for your reference:

<?xml version="1.0"?>
<settings xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
        <proxies>
                <proxy>
                        <active>false</active>
                        <id>enterprise.proxy</id>
                        <protocol>http</protocol>
                        <host>enterprise-proxy.domain.com</host>
                        <port>8080</port>
                        <nonProxyHosts>localhost, 10.0.0.0/24, 127.0.0.1, .local.domain</nonProxyHosts>
                        <username>domain\user</username>
                        <password>secret</password>
                </proxy>
        </proxies>
        <offline>false</offline>
        <profiles>
                <profile>
                        <id>insight</id>
                        <activation>
                                <activeByDefault>true</activeByDefault>
                        </activation>
                        <repositories>
                                <repository>
                                        <id>insight-releases</id>
                                        <url>http://mindtreeinsight.svn.sourceforge.net/svnroot/mindtreeinsight/maven-repo/trunk/release/</url>
                                        <layout>default</layout>
                                        <releases>
                                                <enabled>true</enabled>
                                                <checksumPolicy>warn</checksumPolicy>
                                                <updatePolicy>daily</updatePolicy>
                                        </releases>
                                        <snapshots>
                                                <enabled>false</enabled>
                                        </snapshots>
                                </repository>
                                <repository>
                                        <id>insight-snapshots</id>
                                        <url>http://mindtreeinsight.svn.sourceforge.net/svnroot/mindtreeinsight/maven-repo/trunk/snapshot/</url>
                                        <layout>default</layout>
                                        <releases>
                                                <enabled>false</enabled>
                                        </releases>
                                        <snapshots>
                                                <enabled>false</enabled>
                                                <checksumPolicy>warn</checksumPolicy>
                                                <updatePolicy>always</updatePolicy>
                                        </snapshots>
                                </repository>
                                <repository>
                                        <id>insight-dependencies</id>
                                        <url>http://mindtreeinsight.svn.sourceforge.net/svnroot/mindtreeinsight/maven-repo/trunk/dependency/</url>
                                        <layout>default</layout>
                                        <releases>
                                                <enabled>true</enabled>
                                                <checksumPolicy>warn</checksumPolicy>
                                                <updatePolicy>daily</updatePolicy>
                                        </releases>
                                        <snapshots>
                                                <enabled>false</enabled>
                                                <checksumPolicy>warn</checksumPolicy>
                                                <updatePolicy>daily</updatePolicy>
                                        </snapshots>
                                </repository>
                        </repositories>
                        <pluginRepositories>
                                <pluginRepository>
                                        <id>insight-releases</id>
                                        <url>http://mindtreeinsight.svn.sourceforge.net/svnroot/mindtreeinsight/maven-repo/trunk/release/</url>
                                        <layout>default</layout>
                                        <releases>
                                                <enabled>true</enabled>
                                                <checksumPolicy>warn</checksumPolicy>
                                                <updatePolicy>daily</updatePolicy>
                                        </releases>
                                        <snapshots>
                                                <enabled>false</enabled>
                                        </snapshots>
                                </pluginRepository>
                                <pluginRepository>
                                        <id>insight-snapshots</id>
                                        <url>http://mindtreeinsight.svn.sourceforge.net/svnroot/mindtreeinsight/maven-repo/trunk/snapshot/</url>
                                        <layout>default</layout>
                                        <releases>
                                                <enabled>false</enabled>
                                        </releases>
                                        <snapshots>
                                                <enabled>false</enabled>
                                                <checksumPolicy>warn</checksumPolicy>
                                                <updatePolicy>always</updatePolicy>
                                        </snapshots>
                                </pluginRepository>
                                <pluginRepository>
                                        <id>insight-dependencies</id>
                                        <url>http://mindtreeinsight.svn.sourceforge.net/svnroot/mindtreeinsight/maven-repo/trunk/dependency/</url>
                                        <layout>default</layout>
                                        <releases>
                                                <enabled>true</enabled>
                                                <checksumPolicy>warn</checksumPolicy>
                                                <updatePolicy>daily</updatePolicy>
                                        </releases>
                                        <snapshots>
                                                <enabled>false</enabled>
                                                <checksumPolicy>warn</checksumPolicy>
                                                <updatePolicy>daily</updatePolicy>
                                        </snapshots>
                                </pluginRepository>
                        </pluginRepositories>
                </profile>
        </profiles>
        <servers>
                <server>
                        <id>sourceforge.net.shell</id>
                        <username>user</username>
                        <privateKey>/path/to/your/private/key</privateKey>
                        <passphrase>secret</passphrase>
                </server>
        </servers>
</settings>

Artifacts In Local Repository

Maven always downloads and maintains a copy of all referenced artifacts in a local repository. The default location of the local repository is ~/.m2/repository.

Most of insights direct and indirect dependencies are either available in some Referenced Repositories or Insight maintained repository.

However, there are some dependencies which are not available at any referenced repository and also cannot be put up in the Insight dependency repository. Insight does not directly reference any of these repositories, but some dependencies of insight indirectly reference them.

Developers need to download the dependencies themselves and install them in the local repository. The dependencies are listed below with their download locations. To install the dependency in the local repository use the following command:

mvn install:install-file -DgroupId=${group.id} -DartifactId=${artifact.id} -Dversion=${version} -Dpackaging=jar -Dfile=/path/to/file    

com.sun.jdmk:jmxtools:1.2.1

Group Id com.sun.jdmk
Artifact Id jmxtools
Version 1.2.1
Referenced From log4j:log4j:jar:1.3.9alpha9-SNAPSHOT
Download Location http://java.sun.com/products/JavaManagement/download.html
License https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/ViewLicense-Start?LicenseUUID=dBzACUFBSSEAAAEYHN85AXiO&ProductUUID=w3PACUFB1y8AAAEY_Bw5AXiy

com.sun.jmx:jmxri:1.2.1

Group Id com.sun.jmx
Artifact Id jmxri
Version 1.2.1
Referenced From log4j:log4j:jar:1.3.9alpha9-SNAPSHOT
Download Location http://java.sun.com/products/JavaManagement/download.html
License https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/ViewLicense-Start?LicenseUUID=dBzACUFBSSEAAAEYHN85AXiO&ProductUUID=w3PACUFB1y8AAAEY_Bw5AXiy