As the title puts it, I am facing a strange situation with Maven. Given is the output of my debug process, which I ran with mvn install -X
command:
[DEBUG] =======================================================================
[WARNING] The POM for sampleModule:sampleModule.msg:jar:1.0.0.qualifier is invalid, transitive dependencies (if any) will not be available: 2 problems were encountered while building the effective model for sampleModule:sampleModule.msg:1.0.0.qualifier
[ERROR] 'dependencies.dependency.systemPath' for sampleModule:org.apache.felix:jar must specify an absolute path but is ${project.basedir}/../org.apache.felix/felix.jar @
[ERROR] 'dependencies.dependency.systemPath' for sampleModule:com.google.protobuf:jar must specify an absolute path but is ${project.basedir}/../com.google.protobuf/protobuf-java-2.5.0.jar @
which tells me that my sampleModule.msg
module is somewhat "not-okay". However, a bit below I see this line:
[DEBUG] sampleModule:sampleModule.msg:jar:1.0.0.qualifier:compile
Note that it says "compile" and there is no error afterwards.
Here is the pom.xml
file of sampleModule.msg
module of mine:
<?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>sampleModule</groupId>
<artifactId>sampleModule.master</artifactId>
<relativePath>../pom.xml</relativePath>
<version>1.0.0-SNAPSHOT</version>
</parent>
<groupId>sampleModule</groupId>
<artifactId>sampleModule.msg</artifactId>
<name>sampleModule.msg</name>
<version>1.0.0.qualifier</version>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>sampleModule</groupId>
<artifactId>org.apache.felix</artifactId>
<version>1.0.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/../org.apache.felix/felix.jar</systemPath>
</dependency>
<dependency>
<groupId>sampleModule</groupId>
<artifactId>com.google.protobuf</artifactId>
<version>2.5.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/../com.google.protobuf/protobuf-java-2.5.0.jar</systemPath>
</dependency>
</dependencies>
<build>
<sourceDirectory>src/</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<source>${jdk.version}</source>
<target>${jdk.version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.1</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
</manifest>
<manifestEntries>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
<Bundle-Version>${project.version}</Bundle-Version>
<Bundle-ClassPath>.</Bundle-ClassPath>
<Export-Package>sampleModule.msg</Export-Package>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<tasks>
<mkdir dir="target/src-gen"/>
<exec executable="protoc">
<arg value="--java_out=target/src-gen"/>
<arg value="target/proto/Empty.proto"/>
<arg value="target/proto/ComponentState.proto"/>
</exec>
</tasks>
<sourceRoot>target/src-gen</sourceRoot>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
I have the same problem with another module. Shows 5 dependency errors, yet it compiles. I am kinda confused. If we solve this, I'll get rid of the other one too.
Therefore my question is, should I take this error seriously? Is there a reason for this contradiction?