We will not go into the specifics of Maven as that is beyond the scope of this document. If you have never used Maven, you need to read "What is Maven" just to get a sense of the role of Maven in a software development project. If your project involves more than one or two people, you may want to look into Maven in more detail since it does simplify and standardize many of the project management issues that are commonly encountered.
この文書では、Maven の仕様については述べません。もし今まで Maven を使ったことがないのでしたら、以下の "What is Maven" という文書を読む必要があるでしょう。そうすれば、Maven がソフトウェア開発のプロジェクトにおいて果たす役割の概略が分かるでしょう。 もし、プロジェクトに一人以上関与しているなら、Maven でより詳細を確認すると良いでしょう。Maven は、一般に直面するプロジェクト管理の多くの問題を簡素化および標準化します。
Here are a few bits of standard maven jargon we feel is important for you to know.
ここで、あなたが知っておくべき重要な maven の基本的な専門用語を、以下に少しだけ挙げておきます。
You will see mention of a
maven repository
in this document. When you install Maven the .maven/
directory is created in your ${USER_HOME) directory.
Under .maven/ you will see a
repository
directory. This is were Maven stores all of the jars
that it downloads when you run your builds. This is
also were Maven puts your jars and wars that you
build.
Jar files will be stored in a directory structure
that has the format of
${groupId}/${projectId}/jars/${projectId}-{$version}.jar.
The portal war file is stored as
${groupId}/${projectId}/wars/${projectId}.war. The
${groupId}, ${projectId} and ${version} variables
are discussed later on in this document. Jar and war
files will also be created in your project in the
/target
directory.
あなたは文書内で、maven リポジトリ について触れるのを目にすることがあるでしょう。maven をインストールすると、.maven/ ディレクトリが ${USER_HOME} ディレクトリに作成されます。
.maven/ 以下に repository というディレクトリがあるはずです。ここにはビルドを実行するときに maven がダウンロードした jar ファイルが保存されます。ここはあなたのビルドでできた jar ファイルや war ファイルも置かれることがあります。jar ファイルは ${groupId}/${projectId}/jars/${projectId}-{$version}.jar の形式で置かれます。ポータル war ファイルは ${groupId}/${projectId}/wars/${projectId}.war の形式となります。${groupId}、${projectId}、${version} の各変数についてはこの文書の後の方で触れます。jar ファイルと war ファイルは、あなたのプロジェクトの /target ディレクトリにも作成されます。
Variables are represented as ${ some_variable }. Variable names are case sensitive. Variables are defined in several places in a Maven project and according to the Maven Setup section of the on-line Maven User's Guide, the properties files in Maven are processed in the following order:
The usage of these files is quite different from the way they are used in a project that develops from the sources since the project in that case is the Jetspeed project rather than your own portal. In that case, the user's build.properties is used much more intensively used to override Jetspeed's parameters.
変数は、${ some_variable } として表されます。変数名は、大文字小文字の区別があります。変数は、maven プロジェクトのいくつかの場所で定義されます。 Maven Setup のオンラインユーザガイドによると、Maven プロジェクト内のプロパティファイルの以下のような順番で認識されます。
これらのファイルの使い方は、ソースからの開発プロジェクトでの使用法とは全く違います。ここでのプロジェクトは、あなた自身のポータルというよりは Jetspeed プロジェクトであるからです。このような場合、ユーザ特有の build.properties ファイルは、特に Jetspeed のパラメータを上書きしたい場合に使われます。
Maven processes this sequence of properties files, overriding any previously defined properties with newer definitions. The last definition wins! In this sequence, your ${user.home}/build.properties has the final say in the list of properties files processed.
Maven は、これらのプロパティファイルを順に処理します。前に定義されたプロパティは、後に定義された新しい定義によって上書きされます。そして最後に定義されたプロパティが採用されます。この順でいくと、${user.home}/build.properties が、このプロパティファイルのリストで最後に処理されます。
This list of properties files that Maven processes is called the "standard properties file set".
Maven が処理するこのプロパティファイルのリストを、「標準プロパティファイル集合」と呼びます。
In addition, System properties are processed after the standard properties files. So, a property specified on the command line using the -Dproperty=value convention will override any previous definition of that property.
加えて、システムプロパティは、この "standard properties files set" の後に処理されます。なので、-Dproperty=value を使ってコマンドラインで指定されたプロパティは、それ以前に定義されたどのプロパティをも上書きします。
For example, ${org.apache.jetspeed.server.home} references either:
例えば、${org.apache.jetspeed.server.home} は以下のどれかを参照します。
The documentation refers to some common locations by the following names:
この文書では、以下のような場所を使用します。
These are not used in the Jetspeed configuration but are merely shorthand notations to make the documentation more concise and precise.
これらの変数は、Jetspeed の設定には使いません。しかし、文書をより簡潔にかつ明解にするために、これらの表記を使います。
Subversion (SVN) is used in the Jetspeed project to manage the source files. SVN is very similar to CVS. For those user's on Windows system who prefer non-command line access we suggest using TortoiseSVN which plugs into your Windows Explorer view. For those using the Eclipse IDE, the Subclipse plugin is available for SVN access.
Subversion (SVN) は、Jetspeed のソースファイルを管理するために使われます。SVN は CVS にとても似ています。Windows システムでコマンドラインを使用しないユーザは、 TortoiseSVN を使ってみると良いでしょう。このツールは、Windows Explorer にプラグインされます。Eclipse IDE を使っているユーザは、 Subclipse プラグインが SVN アクセスに使用できます。
Setting up a custom portal development project using the binary distribution is a fairly simple process. At the end, you will you have a directory structure and set of files that will simplify building and deploying your own custom portal.
バイナリディストリビューションを利用した、カスタムポータルの開発プロジェクトをセットアップするのは、極めて簡単なプロセスで済みます。最後に、簡単にビルドできて、簡単にカスタムポータルに配備できる、ファイル群とディレクトリ構造が得られるでしょう。
If you want to setup a Jetspeed portal application using Eclipse as your IDE, you should continue reading this page for background material but refer to Building a Jetspeed Enterprise Portal with Eclipse for the actual instructions on using Eclipse for Jetspeed 2 portal development.
もし、IDE として Eclipse を使って、Jetspeed のポータルアプリケーションをセットアップしたいのなら、その背景を理解するために、このページを引き続き読んでください。一方、Eclipse を使った Jetspeed 2 のポータル開発の実際の手順については、以下の文章を参照してください。 Building a Jetspeed Enterprise Portal with Eclipse
Creating your own custom portal is very easy with the maven plugin provided by Jetspeed 2. The steps are:
カスタムポータルの作成は、Jetspeed 2 が提供する maven プラグインを使って、非常に簡単に行えます。その手順は以下のようになります。
The Jetspeed 2 maven-plugin defines default values for most of the properties you can set, but not all. As you customize the portal, you will override others.
Jetspeed 2 の Maven プラグインは、設定可能な殆んどの値にデフォルト値が定義されています。しかし、全ての値に定義されているわけではありません。ポータルをカスタマイズするときは、異なる値でこれらを上書きします。
Now we're going to configure your
${user.home}build.properties file to give Maven the
information that it needs to download the Jetspeed-2
maven-plugin. The base directory where you are going
to build your portal needs to be specified to Maven
as well as the the maven remote repository need to
be configured properly in your
${USER_HOME}/build.properties
:
basedir = c:/myportal maven.repo.remote = http://www.bluesunrise.com/maven/, http://www.ibiblio.org/maven/, \ http://dist.codehaus.org/, http://cvs.apache.org/repository
まずは、Jetspeed 2 の Maven プラグインをダウンロードするのに必要な情報を、Maven に与えるために、${user.home}build.properties ファイルを設定します。あなたのポータルをビルドするベースとなるディレクトリを、Maven が特定できるように、また同様に Maven のリモートリポジトリの場所を Maven が特定できるように、
${USER_HOME}/build.properties
に値を適切に設定する必要があります。
basedir = c:/myportal maven.repo.remote = http://www.bluesunrise.com/maven/, http://www.ibiblio.org/maven/, \ http://dist.codehaus.org/, http://cvs.apache.org/repository
The first time, and when you want to upgrade to a newer version of Jetspeed 2, you need to install the maven-plugin as follows:
maven -DartifactId=maven-jetspeed2-plugin -DgroupId=org.apache.portals.jetspeed-2 -Dversion=2.1.2 plugin:download
はじめてインストールするときと、一度インストールした後に最新のバージョンの Jetspeed 2 にアップグレードしたくなった場合は、以下のように Maven プラグインをインストールする必要があります。
maven -DartifactId=maven-jetspeed2-plugin -DgroupId=org.apache.portals.jetspeed-2 -Dversion=2.1.2 plugin:download
Once you have the maven-plugin installed and set properties as needed, generate a default portal configuration using the plugin as follows:
maven j2:portal.genapp
Maven プラグインをインストールし、必要なプロパティを設定したら、以下のようにプラグインを使ってデフォルトのポータルの設定を生成してください。
maven j2:portal.genapp
You can fill in as much of the project information in the project.xml file as you want. This will depend on how you intend to use Maven as a project management tool and is beyond the scope of this document. The information in the project.xml file distributed with Jetspeed reflects the Jetspeed development project.
あなたの望む可能な限りのプロジェクトの情報を、project.xml ファイル内に含めることができます。これは、あなたがどのように Maven を、プロジェクト管理のツールとして利用したいかによります。これはこの文書の範囲外です。Jetspeed で配布される project.xml ファイルの情報は、Jetspeed 開発プロジェクトを反映しています。
You can now customize the properties files to reflect your database installation and local environment.
プロパティファイルをカスタマイズして、ローカルの環境やデータベース環境を反映させることが可能です。
The
${basedir}project.properties
file provided by the Jetspeed developers includes
all of the variables that are common to all portals
based on Jetspeed. You should not have to change
these.
Jetspeed 開発者によって提供される
${basedir}project.properties
ファイルは、Jetspeed 上の全てのポータルに共通する全ての変数を含みます。あなたは、これらを変更する必要はありません。
The project properties are described in the
Maven Properties Reference
documentation. We have already filled in the value
for basedir and maven.repo.remote in previous steps.
You can fill in as much of the project information
in the
${basedir}project.xml
file as you want. This will depend on how you intend
to use Maven as a project management tool and is
beyond the scope of this document. The
Maven site
has all of the information that you need to use
Maven successfully.
プロジェクトのプロパティについては、
Maven Properties Reference
で説明されています。前のステップで、既に basedir と maven.repo.remote の値が設定されているものとします。あなたの望む可能な限りのプロジェクトの情報を、${basedir}project.xml
ファイルに含めることができます。これは、あなたがどのように Maven をプロジェクト管理のツールとして利用したいかによります。これはこの文書の範囲外です。
Maven site
に Maven をうまく使うために必要な情報が全てあります。
The configuration of your specific properties needs to be done before we can build the portal. Review the definition of the configuration properties described in Basic Configuration Parameters .
変更したいプロパティの設定は、ポータルをビルドする前に終わらせておく必要があります。プロパティ設定については、 基本的な設定パラメータ で述べます。
In the case of a binary build, the basic
configuration properties can be placed in
${basedir}build.properties
. A minimal custom portal configuration using the
default Derby database can be something like:
# required portal configuration properties org.apache.jetspeed.portal.home = /home/myportal/ org.apache.jetspeed.portal.groupId = myprojects org.apache.jetspeed.portal.artifactId = myportal org.apache.jetspeed.portal.name = My Test Portal org.apache.jetspeed.portal.currentVersion = 1.0
バイナリビルドの場合、基本となるプロパティ設定は、${basedir}build.properties
に置くことができます。デフォルトの Derby を使う場合の、最低限必要なカスタムポータルの設定は、以下のようなものです。
# 必要とされるポータルの設定プロパティ org.apache.jetspeed.portal.home = /home/myportal/ org.apache.jetspeed.portal.groupId = myprojects org.apache.jetspeed.portal.artifactId = myportal org.apache.jetspeed.portal.name = My Test Portal org.apache.jetspeed.portal.currentVersion = 1.0
If you are not using the Derby database that comes
pre-configured in the
${basedir}project.properties
file, you also need to define the database
parameters in the
${basedir}build.properties
file. Refer to the
Database Configuration
section for a description of the variables required.
もし、あらかじめ ${basedir}project.properties
に設定してある Derby を使わないのであれば、データベースのパラメータを、${basedir}project.properties
に定義する必要があります。どのような変数が必要なのかについての解説は、
データベース設定
を参照してください。
Before running the portal, we need to prepare the Application server to run a Jetspeed portal. This consists of telling Jetspeed where the application server expects files to be placed and what authentication values are required to request service from the Application Server's management tools. There may also be modifications to the server configuration so be sure to read the Application server configuration documentation .
ポータルを実行する前に、Jetspeed ポータルを実行するための、アプリケーションサーバの準備をする必要があります。これには以下のような準備があります。まず、アプリケーションサーバが、どこにファイルが置かれることを期待しているかを、Jetspeed に教える必要があります。そして、どのような認証のための値を、アプリケーションサーバの管理ツールから要求する必要があるのかを、Jetspeed に教える必要があります。サーバ設定の変更については アプリケーションサーバ設定の資料 を読んでください。
Verify that you made the Application Server changes suggested in the overview of the Getting Started documentation.
アプリケーションサーバに対して行う変更の概略については、 導入 を確認してください。
A minimal custom portal configuration using the Tomcat 5.5 Application Server could be something like:
# required portal configuration properties org.apache.jetspeed.portal.home = /home/myportal/ org.apache.jetspeed.portal.groupId = myprojects org.apache.jetspeed.portal.artifactId = myportal org.apache.jetspeed.portal.name = My Test Portal org.apache.jetspeed.portal.currentVersion = 1.0 # required application server properties org.apache.jetspeed.server.home = ${CATALINA_HOME}/ org.apache.jetspeed.server.shared = ${org.apache.jetspeed.server.home}/shared/lib/ org.apache.jetspeed.deploy.war.dir = ${org.apache.jetspeed.server.home}/webapps/ org.apache.jetspeed.services.autodeployment.user = j2deployer org.apache.jetspeed.services.autodeployment.password = xxxxx org.apache.jetspeed.catalina.version.major = 5.5
Tomcat 5.5 アプリケーションサーバを使った場合の、最低限のカスタムポータルのための設定は、以下のようなものになります。
# 必要なポータル設定プロパティ org.apache.jetspeed.portal.home = /home/myportal/ org.apache.jetspeed.portal.groupId = myprojects org.apache.jetspeed.portal.artifactId = myportal org.apache.jetspeed.portal.name = My Test Portal org.apache.jetspeed.portal.currentVersion = 1.0 # 必要なアプリケーションサーバのプロパティ org.apache.jetspeed.server.home = ${CATALINA_HOME}/ org.apache.jetspeed.server.shared = ${org.apache.jetspeed.server.home}/shared/lib/ org.apache.jetspeed.deploy.war.dir = ${org.apache.jetspeed.server.home}/webapps/ org.apache.jetspeed.services.autodeployment.user = j2deployer org.apache.jetspeed.services.autodeployment.password = xxxxx org.apache.jetspeed.catalina.version.major = 5.5
Once your portal configuration and setup is ready, you can build and install the portal application in your local maven repository (as needed for deployment) using the following standard maven goal from your custom portal project directory (in ${org.apache.jetspeed.portal.home}):
maven war:install
あなたのポータルの設定の準備が済んだら、ビルドを行い、ローカルの Maven リポジトリに、(配備のために必要な) ポータルアプリケーションをインストールすることが可能になります。これは、カスタムポータルのディレクトリ (${org.apache.jetspeed.portal.home}) 内で、以下のように標準の Maven のゴールを実行することでできます。
maven war:install
You are now ready to deploy the new portal application. For this, skip the following section on building the Jetspeed 2 portal from source and continue with the deployment section.
さあ、これで新しいポータルアプリケーションの配備の準備ができました。新しいポータルアプリケーションの配備をするには、続く Jetspeed 2 のソースからのビルドのセクションを飛ばし、 配備 を続いて読んでください。
You need to make sure that your database server is running. If you are not using the default Derby database, you need to make sure that it is running and that the user that will own the Jetspeed tables is setup and ready for use. Refer to the Database Configuration section for more information.
あなたは、データベースサーバが実行中であることを、確認する必要があります。もしデフォルトの Derby データベースを使わないのなら、Jetspeed で使うユーザと Jetspeed のテーブルがきちんと設定され、使用できる準備ができており、データベースサーバが実行中であることを確認する必要があります。もっと詳しい情報は、 データベースの設定 を参照してください。
You need to have this database running during the deployment and while running the application server.
配備を行っている間と、アプリケーションサーバを実行している間は、このデータベースを実行したままにしておく必要があります。
Note: this is required when using the
j2:quickStart
goal as described below. The Jetspeed 2 maven-plugin
provides other (sub)goals which you can use without
(re)creating a production database and/or inserting
default portal configuration data. See the
Plugin documentation
for further information about the available goals.
注意: これは、後で述べる j2:quickStart
を使うときに必要になります。Jetspeed 2 Maven プラグインには、本稼働用データベースを (再) 作成したり、デフォルトのポータル設定データを挿入したりする必要のないときに使える、他の (サブ) ゴールがあります。使用可能なゴールに関するより詳しい情報は、
プラグインの資料
を参照してください。
The database's tables and initial data needs to be loaded prior to Jetspeed being deployed. The maven-plugin includes a number of goals that can be used to manage the database. The easiest way to load the tables and deploy the application is to run the j2:quickstart goal.
データベースのテーブルと初期データは、Jetspeed が配備され、ロードされる時点で必要となります。 Maven プラグイン には、データベースの管理に必要なたくさんのゴールが含まれます。テーブルをロードし、アプリケーションを配備するのに最も簡単な方法は、j2:quickstart ゴールを実行することです。
cd ${org.apache.jetspeed.portal.home} maven j2:quickStart
cd ${org.apache.jetspeed.portal.home} maven j2:quickStart
This can only be run once without a bit of a cleanup afterwards since it defines the tables and loads the data as part of starting the application. If you have an error and you want to run it again, you must make sure that the tables and data are cleaned out either by manually dropping the tables in the database or by using the j2:db.drop.production Maven goal.
アプリケーションの開始の一部として、テーブルを定義したり、データをロードしたりした後で、消去をすることはないので、このコマンドは一度だけ実行可能です。もし、再度このコマンドを実行したくなって、エラーが出たら、手動でデータベース内のテーブルをドロップするか、もしくは j2:db.drop.production ゴールを実行するかしなければいけないことを理解しておいてください。
The j2:quickstart currently only covers deploying to Tomcat 5 or Tomcat 5.5 application servers.
j2:quickstart は現時点では Tomcat 5 か 5.5 のみの配備をサポートしています。
Information about deployment to other application servers can be found at the The Jetspeed 2 Wiki .
他のアプリケーションサーバへの配備についての情報は、Jetspeed 2 Wiki にあるでしょう。
To deploy a default Jetspeed 2 portal, including the demo portlet applications, run the following in a separate console:
cd ${org.apache.jetspeed.portal.home} maven j2:quickStart
デモポートレットアプリケーションを含んだ、デフォルトの Jetspeed 2 ポータルを配備するためには、以下のようなコマンドを 別の コンソールで実行します。
cd ${org.apache.jetspeed.portal.home} maven j2:quickStart
The j2:quickstart task does this for you. If you have used another Maven goal to initialize the database, then you can deploy the portal by using:
j2:quickstart が、この (デフォルトポータルの配備の) 作業をします。データベースを初期化するために、もし他の Maven ゴールを使ったのなら、以下のようなコマンドを実行することでポータルの配備ができます。
cd ${org.apache.jetspeed.portal.home} maven j2:fullDeploy
The j2:fullDeploy goal currently only covers deploying to Tomcat 5 or Tomcat 5.5 application servers.
j2:fullDeploy ゴールは、現時点では Tomcat 5 もしくは 5.5 のみの配備をサポートします。
Information about deployment to other application servers can be found at the The Jetspeed 2 Wiki .
他のアプリケーションサーバへの配備についての情報は、Jetspeed 2 Wiki にあるでしょう。
The final step in getting the default portal running is starting up your Tomcat server. The portal will automatically install any deployed portlet applications.
デフォルトポータルを実行する最後のステップは、Tomcat サーバを開始させることです。ポータルは、どのようなポートレットアプリケーションも自動的にインストールするでしょう。
Then you can access the portal with your browser at:
or replace "jetspeed" in the above url with the name of your own portal application (
${org.apache.jetspeed.portal.artifactId}
).
Tomcat を実行したら、ブラウザでポータルにアクセスできます。
もしくは、この URL の "jetspeed" の部分をあなたの設定したポータルアプリケーションの名前に置き換えてみてください (
${org.apache.jetspeed.portal.artifactId}
)。
If you see a running Jetspeed portal, we have succeeded in getting the software installed and working.
もし Jetspeed ポータルが実行されているのが確認できれば、ソフトウェアのインストールと実行が成功したことになります。
With the default Jetspeed 2 portal deployment, several example user accounts are inserted into the portal database with which you can logon to the portal:
username | password | roles |
---|---|---|
admin
|
admin
|
admin, manager, user
|
manager
|
manager
|
manager, user
|
jetspeed
|
jetspeed
|
manager
|
user
|
user
|
user
|
tomcat
|
tomcat
|
デフォルトの Jetspeed 2 のポータルの配備では、いくつかのサンプルユーザのアカウントがポータルデータベースに登録されています。それを使って、ポータルへのログオンが可能です。
ユーザ名 | パスワード | ロール |
---|---|---|
admin
|
admin
|
admin, manager, user
|
manager
|
manager
|
manager, user
|
jetspeed
|
jetspeed
|
manager
|
user
|
user
|
user
|
tomcat
|
tomcat
|
Now that the default portal is working we can try a small customization to test out the customization process. We are going to change the logo and portal name.
さて、デフォルトポータルは動作しましたので、カスタマイズのプロセスをテストするために小さなカスタマイズを試してみることができます。ここではロゴとポータル名を変えてみます。
The first step is to create a directory to hold your customized files. This will help you to preserve your changes when you install new versions of jetspeed. Create a directory in the top level of the portal home.
最初のステップは、カスタマイズしたファイルを保存しておくディレクトリを作成することです。この作業によって新しいバージョンの Jetspeed をインストールしたときでも、あなたが行った変更を保存しておくことが可能になります。ポータルホームのトップレベルディレクトリに、ディレクトリを作成してください。
cd ${org.apache.jetspeed.portal.home} mkdir customized
cd ${org.apache.jetspeed.portal.home} mkdir customized
Make a copy of the build.properties file that you have already modified.
既に変更済みの build.properties ファイルのコピーを作成してください。
You may also want to make a directory to hold the original files before you modify them. This is not strictly requirred since you can always reload the distribution. However it might be handy to keep a copy for reference or to quickly get back to the state before you made changes.
さらに、ファイルを変更する前に、オリジナルのファイルを保存しておくためのディレクトリの作成をしたいと思うかも知れません。しかし、いつでもディストリビューションをリロードすることができますので、このような作業は全く不要です。しかし、変更前の状態に素早く戻ったり、変更前の状態を参照するためのコピーを保存しておくのには便利かも知れません。
We are going to change the logo and the portal
name to test customization. You can make you own
logo to replace the Jetspeed logo. Take a look
at the ${basedir}/src/webapp/images/logo.png to
get the size and to verify the background
colour. Make your own logo or copy the
testlogo.png file to your
${basedir}/customized
directory.
カスタマイズのテストのために、ロゴとポータル名の変更を行います。自身で用意したロゴを Jetspeed のロゴと置き換えることができます。サイズや背景色を見るには ${basedir}/src/webapp/images/logo.png を見てください。自身のロゴを作成し、testlogo.png ファイルを ${basedir}/customized
にコピーしてください。
cd ${org.apache.jetspeed.portal.home} maven j2:fullDeploy
cd ${org.apache.jetspeed.portal.home} maven j2:fullDeploy
You can access the revised portal with your browser at:
http://localhost:8080/jetspeedor replace "jetspeed" in the above url with the name of your own portal application (
${org.apache.jetspeed.portal.artifactId}
).
変更を行ったポータルには、ブラウザ経由で以下の場所からアクセス可能です。
http://localhost:8080/jetspeedもしくは、この URL の "jetspeed" の部分をあなたのポータル名に置き換えてください (
${org.apache.jetspeed.portal.artifactId}
)。
You should see the new name and the new logo on the front page.
あなたはフロントページに、あたらしい名前と新しいロゴが表示されるのを見ることでしょう。