Maven configuration on new machine

I work in a small lab, we have 2 machines with intellij, svn and maven used to develop. I have been tasked with configuring a 3rd machine for development. Id like some guidance as to how to do this. I have svn checkout and have all the files and the project is open in intellij:

--main: --java: --ca: --virology: --src: pom.xml

And my pom.xml looks like:

<?xml version="1.0" encoding="UTF-8"?>
<project 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/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

<parent>
    <groupId>ca.virology</groupId>
    <artifactId>virology-parent</artifactId>
    <version>1.0</version>
</parent>

<groupId>ca.virology</groupId>
<artifactId>gatu</artifactId>
<version>1.0-SNAPSHOT</version>

<dependencies>
    <dependency>
        <groupId>ca.virology</groupId>
        <artifactId>virology-lib</artifactId>
        <version>1.0-SNAPSHOT</version>
    </dependency>
    <dependency>
        <groupId>ca.virology</groupId>
        <artifactId>base-by-base</artifactId>
        <version>1.0-SNAPSHOT</version>
    </dependency>
    <dependency>
        <groupId>ca.virology</groupId>
        <artifactId>vgo</artifactId>
        <version>1.0-SNAPSHOT</version>
    </dependency>
    <dependency>
        <groupId>ca.virology</groupId>
        <artifactId>jdotter</artifactId>
        <version>1.0-SNAPSHOT</version>
    </dependency>

    <dependency>
        <groupId>ptolemy</groupId>
        <artifactId>ptolemy2</artifactId>
        <version>0</version>
    </dependency>
    <dependency>
        <groupId>ca.virology</groupId>
        <artifactId>virology-common</artifactId>
        <version>1.0-SNAPSHOT</version>
    </dependency>

    <dependency>
        <groupId>org.biojava</groupId>
        <artifactId>core</artifactId>
        <!--virology-lib used 1.4, 1.8.2 is most recent-->
        <version>1.8.2</version>
    </dependency>

    <!-- this is only in the local repository because the only available maven versions do not contain the classes we need-->
    <!-- use "mvn install:install-file -DgroupId=org.ggf.drmaa -DartifactId=drmaa -Dversion=0 -Dpackaging=jar -Dfile=/path/to/file.jar" to install the file to your local repository if necessary-->
    <dependency>
        <groupId>org.ggf.drmaa</groupId>
        <artifactId>drmaa</artifactId>
        <version>0</version>
    </dependency>

    <!-- this is only in the local repository because a maven version does not exist-->
    <!-- use "mvn install:install-file -DgroupId=javax.jnlp -DartifactId=jnlp -Dversion=0 -Dpackaging=jar -Dfile=/path/to/file.jar" to install the file to your local repository if necessary-->
    <dependency>
        <groupId>javax.jnlp</groupId>
        <artifactId>jnlp</artifactId>
        <version>0</version>
    </dependency>

    <dependency>
        <groupId>xml-apis</groupId>
        <artifactId>xml-apis</artifactId>
        <version>2.0.2</version>
    </dependency>

    <dependency>
        <groupId>xerces</groupId>
        <artifactId>xercesImpl</artifactId>
        <version>2.8.0</version>
    </dependency>

    <!-- this is only in the local repository because a maven version does not exist-->
    <!-- use "mvn install:install-file -DgroupId=pal -DartifactId=pal -Dversion=1.5 -Dpackaging=jar -Dfile=/path/to/file.jar" to install the file to your local repository if necessary-->
    <dependency>
        <groupId>pal</groupId>
        <artifactId>pal</artifactId>
        <version>1.5</version>
    </dependency>

    <dependency>
        <groupId>org.apache.ant</groupId>
        <artifactId>ant-apache-oro</artifactId>
        <version>1.9.2</version>
    </dependency>

    <!--Intellij GUI-->
    <dependency>
        <groupId>com.intellij</groupId>
        <artifactId>forms_rt</artifactId>
        <version>6.0.5</version>
    </dependency>

</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
                <source>1.6</source>
                <target>1.6</target>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <version>2.4</version>
            <configuration>
                <archive>
                    <manifest>
                        <mainClass>ca.virology.gatu.GenomeAnnotator</mainClass>
                    </manifest>
                    <manifestEntries>
                        <Permissions>all-permissions</Permissions>
                        <Codebase>*</Codebase>
                    </manifestEntries>
                </archive>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-shade-plugin</artifactId>
            <version>1.7</version>
            <executions>
                <execution>
                    <phase>package</phase>
                    <goals>
                        <goal>shade</goal>
                    </goals>
                    <configuration>
                        <minimizeJar>true</minimizeJar>
                        <filters>
                            <filter>
                                <artifact>xerces:xercesImpl</artifact>
                                <includes>
                                    <include>**</include>
                                </includes>
                            </filter>
                            <filter>
                                <artifact>*:*</artifact>
                                <excludes>
                                    <exclude>META-INF/*.SF</exclude>
                                    <exclude>META-INF/*.DSA</exclude>
                                    <exclude>META-INF/*.RSA</exclude>
                                </excludes>
                            </filter>
                        </filters>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

intellij complains about maven "Unable to import maven project: See logs for details" (not sure where log is either :/)

when i cd into ../pom.xml and run mvn install it spits out

[INFO] Scanning for projects... [ERROR] [ERROR] Some problems were encountered while processing the POMs: [FATAL] Non-resolvable parent POM for ca.virology:gatu:1.0-SNAPSHOT: Failure to find ca.virology:virology-parent:pom:1.0 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced and 'parent.relativePath' points at wrong local POM @ line 7, column 13 @ [ERROR] The build could not read 1 project -> [Help 1] [ERROR] [ERROR] The project ca.virology:gatu:1.0-SNAPSHOT (/Users/chadsmit/Desktop/Developement/repo/gatu/pom.xml) has 1 error [ERROR] Non-resolvable parent POM for ca.virology:gatu:1.0-SNAPSHOT: Failure to find ca.virology:virology-parent:pom:1.0 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced and 'parent.relativePath' points at wrong local POM @ line 7, column 13 -> [Help 2] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException [ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException

My guess is that there are certain .jar files missing in the .m2 folder, but how do i tell maven to look for them there if i copy them from another machine?

EDIT: The jars from the new machines have been copied and dont seem to be causing problems. The pom.xml has been changed to include :

<parent>
    <groupId>ca.virology</groupId>
    <artifactId>virology-parent</artifactId>
    <version>1.0</version>
    <relativePath>/Users/chadsmit/.m2/repository/ca/virology/virology-parent/1.0/virology-parent-1.0.pom</relativePath>
</parent>

and yet maven is still trying to download it from elsewhere:

[FATAL] Non-resolvable parent POM for ca.virology:gatu:1.0-SNAPSHOT: Failure to find ca.virology:virology-parent:pom:1.0 in https://repo.maven.apache.org>/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced and 'parent.relativePath' points at wrong local POM @ line 7, column 13

Any insights? i feel as though im missing something important

Answers


Did you do a new installation of maven on the 3rd machine or you copied the maven folder from the previous two machines. If you installed a new version than you also need to take a look at the settings.xml file in the .m2 folder on the previous machines. It may be a possibility that the repositories configured in the settings.xml file on those machines are not present on settings.xml on the third machine.

If your parent project is not on the local maven repository, then you can also add relativePath in entry for parent like this:

<parent>
  <groupId>com.test</groupId>
  <artifactId>test-artifact</artifactId>
  <version>1.0-SNAPSHOT</version>
  <relativePath>{path to}/test-artifact/pom.xml</relativePath>
 </parent>

Also, you need to check if intellij is pointing to the maven installation you copied from the previous machines. It is a possibility that Intellij is pointing to built in maven setup.


  1. Run mvn clean install from the project folder.
  2. Just check once your svn has not changed the version of the parent specified here on line number 7 virology-parent, instead try something like ${project.version} in the version for the module

In case you have the jar-files locally, you might be able to [edited]

Try downloading the file manually from the project website.

Then, install it using the command:

mvn install:install-file -DgroupId=ca.virology -DartifactId=virology-parent \
      -Dversion=1.0 -Dpackaging=jar -Dfile=/path/to/file

(and have you tried the -offline switch to maven?)


Need Your Help

CGridview Date Range in Yii framework

php yii date-range cgridview

I would like to use CGridView with Date range in Yii framework , I tried this one and this also but it is not working for me,

Parsing and extracting JSON in Javascript

javascript json parsing geocoding google-geocoder

I'm using Google geocoding API and trying to get the value: