본문 바로가기
Programming/Spring

[maven] 로컬에 있는 jar 파일을 pom.xml에 추가하기

by NAMP 2017. 1. 24.

로컬에 있는 jar 파일을 pom.xml에 추가하기

  • axis.jar
  • commons-discovery-0.2.jar
  • commons-logging.jar
  • httpclient-4.3.1.jar
  • httpcore-4.3.jar
  • jaxrpc.jar
  • org.json.jar
  • saaj.jar
  • soap-2.3.jar
  • wsdl4j.jar

위의 목록들이 /WEB-INF/lib/ 에 있다면, pom.xml을 수정합니다.

<dependency>
    <groupId>my.group</groupId>
    <artifactId>my.artifact</artifactId>
    <version>a.b</version>
    <scope>system</scope>
    <systemPath>${basedir}/src/main/webapp/WEB-INF/lib/my.artifact.jar</systemPath>
</dependency>

버전 정보는 jar 파일을 열어서, MANIFEST.MF 파일의 내용을 확인합니다.

commons-discovery-0.2.jar 에서 MANIFEST.MF 파일의 내용은 아래와 같습니다.

Manifest-Version: 1.0
Created-By: Apache Ant 1.5
Extension-Name: org.apache.commons.discovery
Specification-Vendor: Apache Software Foundation
Specification-Version: 1.0
Implementation-Vendor: Apache Software Foundation
Implementation-Version: 0.2

이 정보를 바탕으로 pom.xml에 내용을 추가합니다.

<!-- WEB-INF/lib 에 있는 jar 포함 -->
<dependency>
    <groupId>org.apache</groupId>
    <artifactId>axis</artifactId>
    <version>1.4</version>
    <scope>system</scope>
    <systemPath>${basedir}/src/main/webapp/WEB-INF/lib/axis.jar</systemPath>
</dependency>

<dependency>
    <groupId>org.apache</groupId>
    <artifactId>commons.discovery</artifactId>
    <version>1.0</version>
    <scope>system</scope>
    <systemPath>${basedir}/src/main/webapp/WEB-INF/lib/commons-discovery-0.2.jar</systemPath>
</dependency>

<dependency>
    <groupId>org.apache</groupId>
    <artifactId>commons.logging</artifactId>
    <version>1.1.1</version>
    <scope>system</scope>
    <systemPath>${basedir}/src/main/webapp/WEB-INF/lib/commons-logging.jar</systemPath>
</dependency>

<dependency>
    <groupId>org.apache</groupId>
    <artifactId>httpclient</artifactId>
    <version>4.3.1</version>
    <scope>system</scope>
    <systemPath>${basedir}/src/main/webapp/WEB-INF/lib/httpclient-4.3.1.jar</systemPath>
</dependency>

<dependency>
    <groupId>org.apache</groupId>
    <artifactId>httpcore</artifactId>
    <version>4.3</version>
    <scope>system</scope>
    <systemPath>${basedir}/src/main/webapp/WEB-INF/lib/httpcore-4.3.jar</systemPath>
</dependency>

<dependency>
    <groupId>javax.xml</groupId>
    <artifactId>rpc</artifactId>
    <version>1.1</version>
    <scope>system</scope>
    <systemPath>${basedir}/src/main/webapp/WEB-INF/lib/jaxrpc.jar</systemPath>
</dependency>

<dependency>
    <groupId>org</groupId>
    <artifactId>json</artifactId>
    <version>1.0</version>
    <scope>system</scope>
    <systemPath>${basedir}/src/main/webapp/WEB-INF/lib/org.json.jar</systemPath>
</dependency>

<dependency>
    <groupId>javax.xml</groupId>
    <artifactId>soap</artifactId>
    <version>1.2</version>
    <scope>system</scope>
    <systemPath>${basedir}/src/main/webapp/WEB-INF/lib/saaj.jar</systemPath>
</dependency>

<dependency>
    <groupId>org.apache</groupId>
    <artifactId>soap</artifactId>
    <version>2.3</version>
    <scope>system</scope>
    <systemPath>${basedir}/src/main/webapp/WEB-INF/lib/soap-2.3.jar</systemPath>
</dependency>

<dependency>
    <groupId>javax.wsdl</groupId>
    <artifactId>wsdj4j</artifactId>
    <version>1.6</version>
    <scope>system</scope>
    <systemPath>${basedir}/src/main/webapp/WEB-INF/lib/wsdl4j.jar</systemPath>
</dependency>


댓글