Monday, 30 April 2012

Installing multiple external jars into a local maven repository.

Suppose you have a variety of dependency jars you need to install into your local repository - Note: These arent artefacts produced by your build but external jars. Well, no shortcuts here. From a recent reply I gave on Stackoverflow - You'll have to do it via a script, the long and boring way. This is what we use - modifying the values in each of the `set` statements
    set GROUP_ID=someNamespace
    set ARTIFACT_ID=myartifact
    set VERSION=1
    set COMPONENT=%ARTIFACT_ID%-%VERSION%
    set FILEPATH=D:\my.jar
    
    call mvn install:install-file ^
     -DgroupId=%GROUP_ID% ^
     -DartifactId=%ARTIFACT_ID% ^
     -Dversion=%VERSION% ^
     -Dfile=%FILEPATH% ^
     -Dpackaging=jar ^
     -DgeneratePom=true
    
    set GROUP_ID=someNamespace2
    set ARTIFACT_ID=myartifact2
    set VERSION=1
    set COMPONENT=%ARTIFACT_ID%-%VERSION%
    set FILEPATH=D:\my2.jar
    
    call mvn install:install-file ^
     -DgroupId=%GROUP_ID% ^
     -DartifactId=%ARTIFACT_ID% ^
     -Dversion=%VERSION% ^
     -Dfile=%FILEPATH% ^
     -Dpackaging=jar ^
     -DgeneratePom=true

No comments:

Post a Comment

How to connect Raspberry Pi Pico to a external temperature sensor(DHT11 or DHT22)

How to connect Raspberry Pi to DHT 11 / DHT 22   Connect your DHT11 sensor to the Pico accordingly -   Left pin (Signal) - GPIO Pin 22 (or a...