Local maven dependency (2)

As an alternative to local maven dependency (1) You can go this way:

<repository>
 <id>mylib</id>
 <name>My Lib</name>
 <layout>default</layout>
 <url>file:///${project.basedir}/lib</url>
</repository>
Advertisements

Local maven dependency (1)

A local maven dependency can be defined like this:

<dependency>
    <groupId>io.takari.junit</groupId>
    <artifactId>takari-cpsuite</artifactId>
    <version>1.2.7-SNAPSHOT</version>
    <scope>system</scope>
    <systemPath>${project.basedir}/../lib/takari-cpsuite/target/takari-cpsuite-1.2.7-SNAPSHOT.jar</systemPath>
</dependency>

Maven Project Build Lifecycle Mapping Problem

Eclipse does not accept the pom.xml as shown:

<build>
 <plugins>
 <plugin>
 <groupId>io.takari.maven.plugins</groupId>
 <artifactId>takari-lifecycle-plugin</artifactId>
 <version>1.10.1</version>
 <extensions>true</extensions>
 </plugin>
 </plugins>
 </build>

It shows the error message below.

Plugin execution not covered by lifecycle configuration: 
io.takari.maven.plugins:takari-lifecycle-plugin:1.10.1:compile 
(execution: default-compile, phase: compile) pom.xml /takari-cpsuite 
line 24 Maven Project Build Lifecycle Mapping Problem

To solve this issue, leave Eclipse, do not install m2e, go to project in shell,

mvn clean install

will download the needed maven plugins automatically. Afterwards this project can be used as a maven dependency in other projects, e.g. in Eclipse projects with maven nature.