"STS 메이븐 프로젝트 jar 패키지 빌드"의 두 판 사이의 차이

32번째 줄: 32번째 줄:
</source>
</source>


==확인==
==mvnw clean==
* STS(이클립스)에서 Run As --- Spring Boot App 을 실행한 적이 있다면 아래와 같이 target 폴더가 남아 있다.
<source lang='doscon'>
<source lang='doscon'>
D:\workspace-sts\HelloWorld>mvnw compiler:compile
D:\workspace-sts\HelloWorld>tree
DATA 볼륨에 대한 폴더 경로의 목록입니다.
볼륨 일련 번호가 00000010 6D80:24A7입니다.
D:.
├─.mvn
│  └─wrapper
├─.settings
├─src
│  ├─main
│  │  ├─java
│  │  │  └─com
│  │  │      └─example
│  │  └─resources
│  └─test
│      └─java
│          └─com
│              └─example
└─target
    ├─classes
    │  ├─com
    │  │  └─example
    │  └─META-INF
    │      └─maven
    │          └─com.example
    │              └─HelloWorld
    └─test-classes
        └─com
            └─example
</source>
* CMD에서 새롭게 컴파일하기 위해 mvnw install을 실행하자.
<source lang='doscon'>
D:\workspace-sts\HelloWorld>mvnw clean
[INFO] Scanning for projects...
[INFO] Scanning for projects...
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-help-plugin/2.2/maven-help-plugin-2.2.pom
Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-help-plugin/2.2/maven-help-plugin-2.2.pom (8.7 kB at 6.3 kB/s)
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-help-plugin/2.2/maven-help-plugin-2.2.jar
Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-help-plugin/2.2/maven-help-plugin-2.2.jar (68 kB at 117 kB/s)
Downloading: https://repo.maven.apache.org/maven2/org/codehaus/mojo/xml-maven-plugin/1.0/xml-maven-plugin-1.0.pom
Downloaded: https://repo.maven.apache.org/maven2/org/codehaus/mojo/xml-maven-plugin/1.0/xml-maven-plugin-1.0.pom (7.3 kB at 23 kB/s)
Downloading: https://repo.maven.apache.org/maven2/org/codehaus/mojo/mojo-parent/28/mojo-parent-28.pom
Downloaded: https://repo.maven.apache.org/maven2/org/codehaus/mojo/mojo-parent/28/mojo-parent-28.pom (26 kB at 84 kB/s)
Downloading: https://repo.maven.apache.org/maven2/org/codehaus/mojo/xml-maven-plugin/1.0/xml-maven-plugin-1.0.jar
Downloaded: https://repo.maven.apache.org/maven2/org/codehaus/mojo/xml-maven-plugin/1.0/xml-maven-plugin-1.0.jar (34 kB at 107 kB/s)
Downloading: https://repo.maven.apache.org/maven2/org/codehaus/mojo/build-helper-maven-plugin/1.10/build-helper-maven-plugin-1.10.pom
Downloaded: https://repo.maven.apache.org/maven2/org/codehaus/mojo/build-helper-maven-plugin/1.10/build-helper-maven-plugin-1.10.pom (5.8 kB at 20 kB/s)
Downloading: https://repo.maven.apache.org/maven2/org/codehaus/mojo/mojo-parent/38/mojo-parent-38.pom
Downloaded: https://repo.maven.apache.org/maven2/org/codehaus/mojo/mojo-parent/38/mojo-parent-38.pom (33 kB at 103 kB/s)
Downloading: https://repo.maven.apache.org/maven2/org/codehaus/mojo/build-helper-maven-plugin/1.10/build-helper-maven-plugin-1.10.jar
Downloaded: https://repo.maven.apache.org/maven2/org/codehaus/mojo/build-helper-maven-plugin/1.10/build-helper-maven-plugin-1.10.jar (51 kB at 153 kB/s)
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.6.1/maven-clean-plugin-2.6.1.pom
Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.6.1/maven-clean-plugin-2.6.1.pom (5.0 kB at 17 kB/s)
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-plugins/26/maven-plugins-26.pom
Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-plugins/26/maven-plugins-26.pom (11 kB at 38 kB/s)
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/25/maven-parent-25.pom
Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/25/maven-parent-25.pom (37 kB at 118 kB/s)
[INFO]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
63번째 줄: 73번째 줄:
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-cli) @ HelloWorld ---
[INFO] --- maven-clean-plugin:2.6.1:clean (default-clean) @ HelloWorld ---
[INFO] Changes detected - recompiling the module!
[INFO] Deleting D:\workspace-sts\HelloWorld\target
[INFO] Compiling 1 source file to D:\workspace-sts\HelloWorld\target\classes
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.508 s
[INFO] Total time: 0.813 s
[INFO] Finished at: 2017-07-14T13:37:12+09:00
[INFO] Finished at: 2017-07-14T14:30:23+09:00
[INFO] Final Memory: 25M/151M
[INFO] Final Memory: 12M/115M
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
</source>
</source>
* 다시 tree를 확인해보면 target 폴더가 사라졌다.
<source lang='doscon'>
D:\workspace-sts\HelloWorld>tree
DATA 볼륨에 대한 폴더 경로의 목록입니다.
볼륨 일련 번호가 000000FF 6D80:24A7입니다.
D:.
├─.mvn
│  └─wrapper
├─.settings
└─src
    ├─main
    │  ├─java
    │  │  └─com
    │  │      └─example
    │  └─resources
    └─test
        └─java
            └─com
                └─example
</source>
==mvnw install==
<source lang='doscon'>
</source>
==실행 확인==


==같이 보기==
==같이 보기==

2017년 7월 14일 (금) 14:32 판

1 개요

STS 메이븐 프로젝트 CMD 컴파일

2 mvnw 실행 확인

  • 만약 아래와 같이 나온다면 JAVA_HOME 환경변수가 설정되지 않은 것이다.
D:\workspace-sts\HelloWorld>mvnw

Error: JAVA_HOME not found in your environment.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.
D:\workspace-sts\HelloWorld>mvnw
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.719 s
[INFO] Finished at: 2017-07-14T14:20:33+09:00
[INFO] Final Memory: 12M/115M
[INFO] ------------------------------------------------------------------------
[ERROR] No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoGoalSpecifiedException

3 mvnw clean

  • STS(이클립스)에서 Run As --- Spring Boot App 을 실행한 적이 있다면 아래와 같이 target 폴더가 남아 있다.
D:\workspace-sts\HelloWorld>tree
DATA 볼륨에 대한 폴더 경로의 목록입니다.
볼륨 일련 번호가 00000010 6D80:24A7입니다.
D:.
├─.mvn
│  └─wrapper
├─.settings
├─src
│  ├─main
│  │  ├─java
│  │  │  └─com
│  │  │      └─example
│  │  └─resources
│  └─test
│      └─java
│          └─com
│              └─example
└─target
    ├─classes
    │  ├─com
    │  │  └─example
    │  └─META-INF
    │      └─maven
    │          └─com.example
    │              └─HelloWorld
    └─test-classes
        └─com
            └─example
  • CMD에서 새롭게 컴파일하기 위해 mvnw install을 실행하자.
D:\workspace-sts\HelloWorld>mvnw clean
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building HelloWorld 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.6.1:clean (default-clean) @ HelloWorld ---
[INFO] Deleting D:\workspace-sts\HelloWorld\target
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.813 s
[INFO] Finished at: 2017-07-14T14:30:23+09:00
[INFO] Final Memory: 12M/115M
[INFO] ------------------------------------------------------------------------
  • 다시 tree를 확인해보면 target 폴더가 사라졌다.
D:\workspace-sts\HelloWorld>tree
DATA 볼륨에 대한 폴더 경로의 목록입니다.
볼륨 일련 번호가 000000FF 6D80:24A7입니다.
D:.
├─.mvn
│  └─wrapper
├─.settings
└─src
    ├─main
    │  ├─java
    │  │  └─com
    │  │      └─example
    │  └─resources
    └─test
        └─java
            └─com
                └─example

4 mvnw install

5 실행 확인

6 같이 보기

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}