Archetype은 프로젝트 템플릿을 통해 프로젝트를 생성하는 기능입니다. 다음과 같이 mvn archetype:generate
커맨드를 실행하여 →
# mvn archetype:generate 10:31:16 [INFO] Scanning for projects... [INFO] [INFO] ------------------< org.apache.maven:standalone-pom >------------------- [INFO] Building Maven Stub Project (No POM) 1 [INFO] --------------------------------[ pom ]--------------------------------- [INFO] [INFO] >>> maven-archetype-plugin:3.1.2:generate (default-cli) > generate-sources @ standalone-pom >>> [INFO] [INFO] <<< maven-archetype-plugin:3.1.2:generate (default-cli) < generate-sources @ standalone-pom <<< [INFO] [INFO] [INFO] --- maven-archetype-plugin:3.1.2:generate (default-cli) @ standalone-pom --- [INFO] Generating project in Interactive mode [INFO] No archetype defined. Using maven-archetype-quickstart (org.apache.maven.archetypes:maven-archetype-quickstart:1.0) Choose archetype: 1: remote -> am.ik.archetype:elm-spring-boot-blank-archetype (Blank multi project for Spring Boot + Elm) 2: remote -> am.ik.archetype:graalvm-blank-archetype (Blank project for GraalVM) 3: remote -> am.ik.archetype:graalvm-springmvc-blank-archetype (Blank project for GraalVM + Spring MVC) 4: remote -> am.ik.archetype:graalvm-springwebflux-blank-archetype (Blank project for GraalVM + Spring MVC) ... 생략 1588: remote -> org.apache.maven.archetypes:maven-archetype-archetype (-) 1589: remote -> org.apache.maven.archetypes:maven-archetype-j2ee-simple (-) 1590: remote -> org.apache.maven.archetypes:maven-archetype-marmalade-mojo (-) 1591: remote -> org.apache.maven.archetypes:maven-archetype-mojo (-) 1592: remote -> org.apache.maven.archetypes:maven-archetype-plugin (An archetype which contains a sample Maven plugin.) 1593: remote -> org.apache.maven.archetypes:maven-archetype-plugin-site (An archetype which contains a sample Maven plugin site. This archetype can be layered upon an existing Maven plugin project.) 1594: remote -> org.apache.maven.archetypes:maven-archetype-portlet (-) 1595: remote -> org.apache.maven.archetypes:maven-archetype-profiles (-) 1596: remote -> org.apache.maven.archetypes:maven-archetype-quickstart (-) 1597: remote -> org.apache.maven.archetypes:maven-archetype-simple (An archetype which contains a simple Maven project.) 1598: remote -> org.apache.maven.archetypes:maven-archetype-site (-) 1599: remote -> org.apache.maven.archetypes:maven-archetype-site-simple (-) 1600: remote -> org.apache.maven.archetypes:maven-archetype-site-skin (An archetype which contains a sample Maven Site Skin.) 1601: remote -> org.apache.maven.archetypes:maven-archetype-webapp (-) ... 생략 Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): 1596: → 템플릿의 번호를 입력합니다. Choose org.apache.maven.archetypes:maven-archetype-quickstart version: 1: 1.0-alpha-1 2: 1.0-alpha-2 3: 1.0-alpha-3 4: 1.0-alpha-4 5: 1.0 6: 1.1 7: 1.3 8: 1.4 Choose a number: 8: 8 → 버전을 선택합니다. Define value for property 'groupId': com.demo → Maven Group ID를 입력합니다. Define value for property 'artifactId': helloworld → Maven Artifact ID를 입력합니다. Define value for property 'version' 1.0-SNAPSHOT: : → Maven POM의 버전을 입력합니다. Define value for property 'package' com.demo: : → 패키지명을 입력합니다. Confirm properties configuration: groupId: com.demo artifactId: helloworld version: 1.0-SNAPSHOT package: com.demo Y: : Y → Y를 입력하여 프로젝트를 생성합니다. [INFO] ---------------------------------------------------------------------------- [INFO] Using following parameters for creating project from Archetype: maven-archetype-quickstart:1.4 [INFO] ---------------------------------------------------------------------------- [INFO] Parameter: groupId, Value: com.demo [INFO] Parameter: artifactId, Value: helloworld [INFO] Parameter: version, Value: 1.0-SNAPSHOT [INFO] Parameter: package, Value: com.demo [INFO] Parameter: packageInPathFormat, Value: com/demo [INFO] Parameter: package, Value: com.demo [INFO] Parameter: groupId, Value: com.demo [INFO] Parameter: artifactId, Value: helloworld [INFO] Parameter: version, Value: 1.0-SNAPSHOT [INFO] Project created from Archetype in dir: /Volumes/Data/Projects/pilot/helloworld [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 33.965 s [INFO] Finished at: 2020-05-05T10:32:06+09:00 [INFO] ------------------------------------------------------------------------