zoukankan      html  css  js  c++  java
  • How to include library manually into maven local repository?

    http://www.mkyong.com/maven/how-to-include-library-manully-into-maven-local-repository/

    How to include library manually into maven local repository?

        How to include library manually into maven local repository?
        Published: May 12, 2009 , Updated: April 14, 2011 , Author: mkyong

        There are still many Java libraries that are not support for Maven, or may be you want to create a custom library which is required to include it into your Maven local repository.

        Fortunately, Maven comes with command to let you include your “non-maven-support” library into your Maven local repository easily.
        Case study

        For example, “kaptcha” is a third party library which is used to generate “captcha” image to stop spamming, but it did not support Maven.

        Here’s a guide to show you how to install the “kaptcha” jar into your Maven’s local repository.
        1. Install library – mvn install

        Download the “kaptcha” jar file and put it into your “C:” drive, and issue following Maven’s command :

        mvn install:install-file -Dfile=c:\kaptcha-2.3.jar -DgroupId=com.google.code
        -DartifactId=kaptcha -Dversion=2.3 -Dpackaging=jar

        Result :

        D:\>mvn install:install-file -Dfile=c:\kaptcha-2.3.jar -DgroupId=com.google.code
        -DartifactId=kaptcha -Dversion=2.3 -Dpackaging=jar
        [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:\kaptcha-2.3.jar to
        D:\maven_repo\com\google\code\kaptcha\2.3\kaptcha-2.3.jar
        [INFO] ------------------------------------------------------------------------
        [INFO] BUILD SUCCESSFUL
        [INFO] ------------------------------------------------------------------------
        [INFO] Total time: < 1 second
        [INFO] Finished at: Tue May 12 13:41:42 SGT 2009
        [INFO] Final Memory: 3M/6M
        [INFO] ------------------------------------------------------------------------

        Now, the “kaptcha” jar library is included into your Maven local repository.
        2. Modify pom.xml file

        After installed, you can add the custom library details into your “pom.xml” file like this

        <dependency>
              <groupId>com.google.code</groupId>
              <artifactId>kaptcha</artifactId>
              <version>2.3</version>
        </dependency>

        3. Done

        Build it, now the “kaptcha” jar is able to retrieve from your Maven local repository.

  • 相关阅读:
    Django的常用方法以及配置
    orm 练习题
    Codeforces 898 贪心关闭最少闹钟 优先队列最少操作构造N/2squares 讨论情况哈希数字串分割a+b=c
    Codeforces 985 最短水桶分配 沙堆构造 贪心单调对列
    At grand 024
    Codeforces 982 树边两端点计数偶数连通块 鲨鱼活动最小K最大location 扩展欧几里得方块内光线反射
    Codeforces 984 扫雷check 欧几里得b进制分数有限小数判定 f函数最大连续子段
    Codeforces 979 字符串强制N变换最多出现字母 DFS子树 暴力01字典树
    Codeforces 899 1-N两非空集合最小差 末尾最多9对数计算 pair/链表加优先队列最少次数清空
    Atcoder Regular 097 相邻球交换目的递增DP
  • 原文地址:https://www.cnblogs.com/lexus/p/2358531.html
Copyright © 2011-2022 走看看