King of Stock

[Maven] maven wrapper install 본문

IT 기술

[Maven] maven wrapper install

king of stock 2019. 4. 6. 11:54

사전 조건

  • 현재 로컬환경에 maven 설치

    설치가 되었는지 아래처럼 버전확인 커맨드나 아니면 그냥 mvn 커맨드를 실행해보면 설치가 되었으면 output이 나오면 설치된 것으로 봐도 무방해 보인다. 아래는 본인 환경(macOS)에서 확인해본 출력 결과는 아래와 같다.

    $ mvn --version
    Apache Maven 3.6.0 (97c98ec64a1fdfee7767ce5ffb20918da4f719f3; 2018-10-25T03:41:47+09:00)
    Maven home: /usr/local/Cellar/maven/3.6.0/libexec
    Java version: 1.8.0_111, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home/jre
    Default locale: en_US, platform encoding: UTF-8
    OS name: "mac os x", version: "10.14.4", arch: "x86_64", family: "mac"

현재 디렉토리를 기준해서 mvnw 설치하는 커맨드

다음과 같은 커맨드를 사용하면 현재 디렉토리를 기준으로 mvnw, mvnw.cmd 등의 maven wrapper 설치가 될 것이다.

$ mvn -N io.takari:maven:wrapper

아래는 실행한 결과 출력

  [INFO] Scanning for projects...
  [WARNING]
  [WARNING] Some problems were encountered while building the effective model for com.smartkuk:front-service:jar:0.0.1-SNAPSHOT
  [WARNING] 'dependencies.dependency.exclusions.exclusion.artifactId' for org.springframework.boot:spring-boot-starter-test:jar is missing. @ com.smartkuk:smart-factory-services-parent:0.0.1-SNAPSHOT, /Users/pipe0502/Desktop/remote_repository/smartkuk-public-service-parent/pom.xml, line 105, column 20
  [WARNING]
  [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
  [WARNING]
  [WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
  [WARNING]
  [INFO]
  [INFO] ---------------------< com.smartkuk:front-service >---------------------
  [INFO] Building front-service 0.0.1-SNAPSHOT
  [INFO] --------------------------------[ jar ]---------------------------------
  [INFO]
  [INFO] --- maven:0.7.4:wrapper (default-cli) @ front-service ---
  [INFO]
  [INFO] Maven Wrapper version 0.5.3 has been successfully set up for your project.
  [INFO] Using Apache Maven: 3.6.0
  [INFO] Repo URL in properties file: https://repo.maven.apache.org/maven2
  [INFO]
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD SUCCESS
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time:  0.626 s
  [INFO] Finished at: 2019-04-06T11:43:42+09:00
  [INFO] ------------------------------------------------------------------------

디렉토리 리스트를 확인해보면 다음과 같이 확인이 가능

  $ ls -atlr
  total 112
  drwxr-xr-x   3 pipe0502  staff     96 Feb  9 20:46 src
  drwxr-xr-x   4 pipe0502  staff    128 Feb  9 20:56 target
  -rw-r--r--   1 pipe0502  staff   1236 Feb  9 20:56 .classpath
  -rw-r--r--   1 pipe0502  staff    690 Feb  9 21:02 .project
  drwxr-xr-x   6 pipe0502  staff    192 Mar 12 20:42 .settings
  -rw-r--r--@  1 pipe0502  staff   6148 Apr  3 19:52 .DS_Store
  -rw-r--r--   1 pipe0502  staff  14452 Apr  4 20:38 README.md
  drwxr-xr-x  17 pipe0502  staff    544 Apr  4 20:47 frontend
  drwxr-xr-x  16 pipe0502  staff    512 Apr  4 20:52 ..
  drwxr-xr-x   3 pipe0502  staff     96 Apr  6 11:41 node
  -rw-r--r--   1 pipe0502  staff   3150 Apr  6 11:42 pom.xml
  drwxr-xr-x   3 pipe0502  staff     96 Apr  6 11:43 .mvn
  -rwxrwx---   1 pipe0502  staff   9892 Apr  6 11:43 mvnw
  drwxr-xr-x  15 pipe0502  staff    480 Apr  6 11:43 .
  -rwxrwx---   1 pipe0502  staff   6301 Apr  6 11:43 mvnw.cmd
Comments