Search maven archetype from this maven reposiroty: https://maven-repository.com/
Create new bat file generate_maven_project.cmd.
Then paste this code:
@echo off
echo -------------- PROJECT ------------------------
set /p "groupId=Enter your project package: "
set /p "artifactId=Enter project artifactId: "
set /p "version=Enter project version: "
echo -------------- ARCHETYPE ------------------------
set /p "archetypeGroupId=Enter archetypeGroupId: "
set /p "archetypeArtifactId=Enter archetypeArtifactId: "
set /p "archetypeVersion=Enter archetypeVersion: "
echo Start generate project ....
pushd "%~dp0"
mvn archetype:generate -DinteractiveMode=false -DgroupId=%groupId% -DartifactId=%artifactId% -Dversion=%version% -DarchetypeGroupId=%archetypeGroupId% -DarchetypeArtifactId=%archetypeArtifactId% -DarchetypeVersion=%archetypeVersion%
pause
Now run file generate_maven_project.cmd by double click in this file.
Example: generate javaee7 project with wildfly archetype: https://maven-repository.com/artifact/org.wildfly.archetype/wildfly-javaee7-webapp-ear-archetype/8.2.0.Final
In here, you will see groupId, artifactId, version of this archetype template.
After this process completed, you will see project demojavaee in your directory like image below
Finally, open your project by your IDE: Intellij, Eclipse or Netbean or ... and these IDE will detect maven project correctly.
Create new bat file generate_maven_project.cmd.
Then paste this code:
@echo off
echo -------------- PROJECT ------------------------
set /p "groupId=Enter your project package: "
set /p "artifactId=Enter project artifactId: "
set /p "version=Enter project version: "
echo -------------- ARCHETYPE ------------------------
set /p "archetypeGroupId=Enter archetypeGroupId: "
set /p "archetypeArtifactId=Enter archetypeArtifactId: "
set /p "archetypeVersion=Enter archetypeVersion: "
echo Start generate project ....
pushd "%~dp0"
mvn archetype:generate -DinteractiveMode=false -DgroupId=%groupId% -DartifactId=%artifactId% -Dversion=%version% -DarchetypeGroupId=%archetypeGroupId% -DarchetypeArtifactId=%archetypeArtifactId% -DarchetypeVersion=%archetypeVersion%
pause
Now run file generate_maven_project.cmd by double click in this file.
Example: generate javaee7 project with wildfly archetype: https://maven-repository.com/artifact/org.wildfly.archetype/wildfly-javaee7-webapp-ear-archetype/8.2.0.Final
In here, you will see groupId, artifactId, version of this archetype template.
After this process completed, you will see project demojavaee in your directory like image below
Finally, open your project by your IDE: Intellij, Eclipse or Netbean or ... and these IDE will detect maven project correctly.
Nhận xét
Đăng nhận xét