mhchae3@DESKTOP-SRQ9MD1:~/mvnproject/mvn-lib$ mvn compile
mhchae3@DESKTOP-SRQ9MD1:~/mvnproject/mvn-lib$ mvn package
mhchae3@DESKTOP-SRQ9MD1:~/mvnproject/mvn-lib/target$ ls
classes generated-sources generated-test-sources maven-archiver maven-status mvn-lib-1.0-SNAPSHOT.jar surefire-reports test-classes
실행 : 에러 발생
mhchae3@DESKTOP-SRQ9MD1:~/mvnproject/mvn-lib/target$ java -jar mvn-lib-1.0-SNAPSHOT.jar
no main manifest attribute, in mvn-lib-1.0-SNAPSHOT.jar
mhchae3@DESKTOP-SRQ9MD1:~/mvnproject/mvn-lib/target$
mhchae3@DESKTOP-SRQ9MD1:~/mvnproject/mvn-lib$ mvn exec:java
Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/4.0.0/plexus-utils-4.0.0.jar (192 kB at 987 kB/s)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.825 s
[INFO] Finished at: 2024-02-02T12:38:09+09:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.1.1:java (default-cli) on project mvn-lib: The parameters 'mainClass' for goal org.codehaus.mojo:exec-maven-plugin:3.1.1:java are missing or invalid -> [Help 1]
[ERROR]
pom.xml 수정 - 다음 내용을 추가함
재실행
mhchae3@DESKTOP-SRQ9MD1:~/mvnproject/mvn-lib$ mvn exec:java
[INFO] Scanning for projects...
[INFO]
[INFO] -------------------------< com.tuyano:mvn-lib >-------------------------
[INFO] Building mvn-lib 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- exec-maven-plugin:3.1.1:java (default-cli) @ mvn-lib ---
Lib [name=Hanako, msg=I am flower....]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.556 s
[INFO] Finished at: 2024-02-02T13:12:48+09:00
[INFO] ------------------------------------------------------------------------
mhchae3@DESKTOP-SRQ9MD1:~/mvnproject/mvn-lib$
정상적으로 실행됨
'Infra > maven' 카테고리의 다른 글
jetty plugin (0) | 2024.02.05 |
---|---|
maven webapp 만드는 법... (0) | 2024.02.05 |
maven 프로젝트 생성하고, Eclipse에서 열기 (0) | 2024.02.02 |
maven 사용법 - 콘솔 프로젝트 생성 (IntelliJ) (0) | 2024.01.24 |
ubuntu에 maven 설치하기 (0) | 2024.01.24 |
댓글