Posts Tagged ‘maven’

Adding a new Library to an existing Maven Repository

Monday, June 25th, 2007

Today i wanted to add DWR 2.0.1 as dependency from within the Eclipse Plugin and recognized that it was not found on the Maven Repository Server…

The install:install command is the key…

  1. Get the Library you want to use (download DWR).
  2. Open console (press: windows + r and enter “cmd” or better install Tweak UI)
  3. enter: mvn install:install-file -Dfile=dwr.jar -DgroupId=org.directwebremoting -DartifactId=dwr -Dversion=2.0.1 -Dpackaging=jar
  4. prints out:
    [INFO] Scanning for projects...
    [INFO] Searching repository for plugin with prefix: 'install'.
    [INFO] ----------------------------------------------------------------------------
    [INFO] Building Maven Default Project
    [INFO]    task-segment: [install:install-file] (aggregator-style)
    [INFO] ----------------------------------------------------------------------------
    [INFO] [install:install-file]
    [INFO] Installing C:\Dokumente und Einstellungen\_\.m2\dwr.jar to C:\Dokumente und Einstellungen\_\.m2\repository\org\directwebremoting\dwr\2.0.1\dwr-2.0.1.jar
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD SUCCESSFUL
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 1 second
    [INFO] Finished at: Mon Jun 25 14:24:27 CEST 2007
    [INFO] Final Memory: 1M/4M
    [INFO] ------------------------------------------------------------------------
    
  5. Now there should be a new Folder for the imported lib in the local repository:
      .m2
       |__org
          |__directwebremoting
             |__dwr
                |__2.0.1
                   |__dwr-2.0.1.jar
                   |__dwr-2.0.1.pom
                   |__dwr-2.0.1.pom.sha1
  6. Et voila, now you can use the added lib as dependency in all .pom Files….