maven
EditMAVEN : The Definitive Guide
시작하기
http://maven.apache.org/guides/introduction/introduction-to-the-pom.html
[강좌 maven 따라하기 - 프로젝트 생성, 빌드, 레포팅, 배포]
생성 mvn archetype:create -DgroupId=com.mycompany.app -DartifactId=myapp
[Maven으로 프로젝트 빌드하기 (maven1)]
<dependency>
<groupId>.....</groupId>
<artifactId>.....</artifactId>
<version>1.0.1</version>
<scope>system</scope>
<systemPath>${basedir}/lib/xss.jar</systemPath>
</dependency>
Effective pom : mvn help:effective-pom
Super pom
Options
- -e : 발생한 error에 대해서 보여준다.
- -X : Debug를 보여준다. 보통 이 옵션에 > log.log 처럼 파일로 내보내서 무슨 문제가 생겼는지 확인하면 좋다.
- -U : 업데이트가 제대로 안되었을 경우 강제로 repository에서 업데이트 하도록한다.
- -fn : 에러가 나던 말던 일단 빌드부터 하고 본다.
- -P : 프로파일을 설정해서 하나의 프로젝트를 다른 설정으로 빌드할 수 있다.
기초개념
Life Cycle
- [MavenOption]
- 메이븐 상식: 기본 페이스(phase)
Dependency
[Maven을 쓴다고 해서 종속성을 안중에서 Out 시킬 수 있느냐?]
exclusion을 하까마까 "가장 가까운" 의존성을 사용하게 됩니다
mvn versions:display-dependency-updates : 상위 버전 보여주기
Site
디렉토리구조
Plug-in
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>ca.sqlpower.architect.swingui.ArchitectFrame</mainClass>
<classpathPrefix>lib/</classpathPrefix>
</manifest>
<manifestEntries>
<Class-Path>jdbc/</Class-Path>
</manifestEntries>
</archive>
</configuration>
</plugin>
exec plugin
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<phase>deploy</phase>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
<configuration>
<executable>/home1/irteam/bin/tomcat.sh</executable>
<workingDirectory>/home1/irteam/bin</workingDirectory>
<arguments>
<argument>start</argument>
<argument>buzz</argument>
</arguments>
</configuration>
</plugin>
Resource Filter encoding 설정
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
archetype
mvn install:install-file -Dfile=C:\aa.jar -DgroupId=aa -DartifactId=aa -Dversion=1.0 -Dpackaging=jar
mvn archetype:update-local-catalog
mvn archetype:generate