Maven내에서 컴파일시 배포를 함께 처리하도록 플러그인을 설정한다.
핵심내용
- Maven-jar-plugin(MANIFEST파일 커스텀), maven-dependency-plugin(종속된 라이브러리를 지정 디렉터리에 복사에서 제공) 를 이용하도록 추가했다
-
Maven-jar-plugin 은 <archive>하위에 <addClasspath>, <classpathPrefiex>, <mainClass> 지정maven-dependency-plugin은 <execution> 하위에 <id>, <phase>, <goals>, <configuration> 등을 지정상기항목 모두 하위 예제와 같은 형태이다.
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>Scheduler</groupId>
<artifactId>Scheduler</artifactId>
<version>0.5</version>
<name>Scheduler</name>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
<mainClass>com.test.quartzMain</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy</id>
<phase>install</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>
${project.build.directory}/lib
</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<properties>
<org.springframework-version>5.0.6.RELEASE</org.springframework-version>
<project.lib.path>${project.basedir}/src/main/lib</project.lib.path>
</properties>
<dependencies>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.4</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<dependency>
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.2.2</version>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.4.6</version>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>1.3.2</version>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
</dependencies>
</dependencyManagement>
</project>
'프로그래밍' 카테고리의 다른 글
Spring boot starter data MongoDB interface repository 를 인식하지 못할 때 (0) | 2019.02.19 |
---|---|
[maven] maven-resources-plugin을 이용한 properties.xml 별도 배포 (0) | 2018.07.13 |
AOP 사용하지 않던 프로젝트에 AOP 추가 시 발생한 문제 (0) | 2018.07.09 |
AspectJ 수동 추가 후 일부 Pointcut이 정상적으로 동작하지 않을 때 해결하기 (0) | 2018.06.29 |
[Java/Servlet]Read timed out 에러 (0) | 2017.07.12 |