Open paulvi opened 7 years ago
This is gross. I think you missed the point, this plugin is a crutch, not the right way to do anything. You have a list of versioned jars, the majority of which are in Central. Just do the work and fix your pom.
You have a list of versioned jars, the majority of which are in Central. Just do the work and fix your pom.
And I have to do so too many times for old projects.
When creating new project to handle old jars, I would recommend now just use maven-install-plugin
<?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>
<groupId>com.company</groupId>
<artifactId>3rd-parties-jars</artifactId>
<version>1.0</version>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
<executions>
<execution>
<id>install-ojdbc7</id>
<phase>install</phase>
<goals>
<goal>install-file</goal>
</goals>
<configuration>
<file>ojdbc7-12.1.0.1.0.jar</file>
<groupId>com.oracle</groupId>
<artifactId>ojdbc7</artifactId>
<version>12.1.0.1.0</version>
<packaging>jar</packaging>
</configuration>
</execution>
<!--
<execution>
<id>install2</id>
<phase>package</phase>
<goals>
<goal>install-file</goal>
</goals>
... etc
</execution>
... other executions
-->
</executions>
</plugin>
</plugins>
</build>
</project>
Then this non-maven-jar-maven-plugin
is direction if it is possible to get and compile sources later (when modification is needed.)
Well, if jar in question has some dependencies, then we should use this non-maven-jar-maven-plugin
to define that <dependency>
It is as well possible to create 1 project with pom.xml per jar (as README suggest), define dependency if needed (see #3 ), but use maven-install-plugin
to install or deploy to LAN repository manager like Nexus.
what to do for many files that are often in
lib
folder?While this plugin is great step to show developers right way, it is still requires moving every jar to separate folder.
I came here from https://stackoverflow.com/questions/364114/can-i-add-jars-to-maven-2-build-classpath-without-installing-them
P.S. Asked on https://stackoverflow.com/questions/45307633/maven-equivalent-for-gradle-compile-filetreedir-libs-include-jar