"xxx.jar에 기본 Manifest 속성이 없습니다." 해결방법
오류의 원인은 Main 클래스의 위치를 찾지 못해서 발생하는 것입니다.
pom.xml 파일에 플러그인(plugin)을 추가 하고 그 안에 있는 "mainClass" 태그에 "패키지명.클래스명" 을 정의 해 주면 해결 할 수 있습니다.
pom.xml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | <project xmlns= "..." > <modelversion> 4.0 . 0 </modelversion> <groupid>com.maven.tutorial</groupid> <artifactid>Tutorial</artifactid> <version> 0.0 . 1 -SNAPSHOT</version> <name>Tutorial</name> <url>http: //maven.apache.org</url> <properties> <project.build.sourceencoding>UTF- 8 </project.build.sourceencoding> </properties> <dependencies> <dependency> ... </dependency> </dependencies> <build> <plugins> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-jar-plugin</artifactid> <version> 2.6 </version> <configuration> <archive> <manifest> <mainclass>Tutorial.Tutorial</mainclass> // 메인 클래스 위치정의 </manifest> </archive> </configuration> </plugin> </plugins> </build> </project> |
'JAVA' 카테고리의 다른 글
Spring Boot::DB 에 한글이 깨져서 저장될 때 해결 방법. (2) | 2016.03.08 |
---|---|
"[WARNING] The requested profile "pom.xml" could not be activated because it does not exist." 해결 방법 (1) | 2016.02.17 |
[JAVA] InputStream 타입을 File 타입으로 변환하기 (0) | 2015.12.15 |