Chuyển đến nội dung chính

[Maven] How to generate java project from maven archetype

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.


Nhận xét

Bài đăng phổ biến từ blog này

Windows 10 enable long file/folder path

Windows 10 enable long file/folder path Registry Import Enabling Long Paths Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\FileSystem] "LongPathsEnabled"=dword:00000001 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem] "LongPathsEnabled"=dword:00000001 Enable via group policy editor Local Computer Policy -> Computer Configuration -> Administrative Templates -> System -> FileSystem -> Double click Enable Win32 long paths and select Enabled

[Solved] Adobe Premiere Pro CC 2015 has stopped on Windows 10 x64 (card AMD)

First you can check yours graphic card fully support Adobe Premiere Pro CC 2015 at here: http://blogs.adobe.com/premierepro/2013/05/improved-gpu-support-in-adobe-premiere-pro-cc.html If you open "Configure Switchable Graphics", you'll see the adobe premiere pro.exe has been locked. By default, it only run on Intel graphics, so you cant change or unlock this. To make your Adobe Premiere Pro CC 2015 run on AMD Graphics card, just rename file Adobe Premiere Pro.exe into Adobe Premiere Pro CC.exe After rename, run application again, and open Configure Switchable Graphics and choose High Performance. See this thread for more information: https://community.amd.com/thread/167905