I have the following child pom.xml
:
<?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>runtime_shared</groupId>
<artifactId>runtime_shared.master</artifactId>
<relativePath>../pom.xml</relativePath>
<version>1.0.0-SNAPSHOT</version>
</parent>
<groupId>runtime_shared</groupId>
<artifactId>javax.vecmath</artifactId>
<name>javax.vecmath</name>
<version>1.0.0.qualifier</version>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>2.3.1</version>
<executions>
<execution>
<id>vecmath</id>
<phase>install</phase>
<goals>
<goal>install-file</goal>
</goals>
<configuration>
<file>${basedir}/vecmath.jar</file>
<groupId>${project.groupId}</groupId>
<artifactId>${project.artifactId}</artifactId>
<version>${project.version}</version>
<packaging>jar</packaging>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
which I want it to install javax.vecmath
to my local repository (.m2/repository
). Later on I specify this in my parent pom.xml
like this:
<dependency>
<groupId>runtime_shared</groupId>
<artifactId>javax.vecmath</artifactId>
<version>1.0.0.qualifier</version>
</dependency>
However, when I do mvn install -X
I get to see that maven looks for an entirely different path, such as:
[DEBUG] /home/usr/workspace_runtime/runtime_shared/javax.vecmath/target/javax.vecmath-1.0.0.qualifier.jar
and obviously gives an error. Is it because of some environment variable set wrong, or because of the <file>${basedir}/vecmath.jar</file>
tag where ${basedir}
refers somewhere else somehow? I also tried using ${project.basedir}
but it also did not work.
To give a clearer picture, here is another case:
[DEBUG] /home/usr/.m2/repository/x/org.apache.felix.main/1.0.0/org.apache.felix.main-1.0.0.jar
[DEBUG] /home/usr/.m2/repository/x/org.apache.felix.gogo/0.10.0/org.apache.felix.gogo-0.10.0.jar
[DEBUG] /home/usr/workspace_runtime/x/com.google.protobuf/target/com.google.protobuf-2.5.0.jar
If you notice, with the first two projects the directory is correct. However, the last one, somehow is looked under the wrong directory. And as a result:
package com.google.protobuf does not exist
Any suggestions?