8
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Webアプリ用プロジェクトを速攻で用意する

Posted at

空のWebアプリ用プロジェクトを用意するときは以下のようなスクリプトを用意して、叩いています。

generate_project.sh
#!/bin/sh

if [ $# -ne 3 ]; then
  echo "usage: >`basename $0` groupId artifactId package"
  exit 0
fi

GROUP_ID=$1
ARTIFACT_ID=$2
PACKAGE=$3

mvn archetype:generate -B \
-DarchetypeGroupId=org.apache.maven.archetypes \
-DarchetypeArtifactId=maven-archetype-webapp \
-DarchetypeVersion=1.0 \
-DgroupId=$GROUP_ID \
-DartifactId=$ARTIFACT_ID \
-Dversion=1.0-SNAPSHOT \
-Dpackage=$PACKAGE

cd $ARTIFACT_ID
mkdir -p src/main/java
mkdir -p src/test/java
mkdir -p src/test/resources

mvn eclipse:eclipse

Eclipseからこのプロジェクトをインポートして、コーディング開始です。

※ mvnのgenerateでweb.xmlもソースディレクトリも同時に作る方法知っている方いたら教えてください(-_-ゞ

8
7
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?