Binary Libraries in Maven / Eclipse

I am new to Maven and trying to decide how to deal with a situation where I have a set of binary libraries (.jars) that I want to include in several projects run by Maven.

There is no pom.xml file in the libraries and is not available in any Maven repository.

How do I configure Maven / m2eclipse to include these libraries in my other projects? I assume that I need to set up some of Maven's “shell projects” to solve these problems?

+3
source share
2 answers

You will need to first install the banks in your Maven repository shown by @Will post. Keep in mind that these banks only exist in your Maven repository. In other words, if you share this project code with other developers, they must do the same in their local repositories, otherwise they will not be able to find banks.

, , Nexus . Nexus, ( ). , Nexus " " (, 3 Nexus). , Nexus . , , , . , pom.xml.:)

+1

, @limc.

, :

maven, .

mvn install:install-file -DgroupId=<your_group_name>  \
-DartifactId=<your_artifact_name>  \
-Dversion=<snapshot>  \
-Dfile=<path_to_your_jar_file>  \
-Dpackaging=jar \
-DgeneratePom=true

jar :

    <dependency>
        <groupId>com.package</groupId>
        <artifactId>id</artifactId>
        <version>5.2</version>
        <scope>system</scope>
        <systemPath>${basedir}/src/main/webapp/WEB-INF/lib/my.jar</systemPath>
    </dependency>
+2

Source: https://habr.com/ru/post/1791366/


All Articles