LoginSignup
0
0

WindowsセットアップスクリプトによるiDempiere環境構築

Posted at

前回は「画面のカスタマイズ」というテーマで、シンプルな画面を追加してみました。
今回は、iDempiereのLinux開発環境構築のためのスクリプトがiDempiereの有識者から提供されていましたので、そのスクリプトをWindows環境で実行できるように修正し、実際に環境を構築してみました。
今回の記事では、その内容を紹介したいと思います。

スクリプトの参考元

スクリプトはこちらのコードを参考にさせていただきました。ありがとうございました。

スクリプトの処理内容

環境構築スクリプトを実行すると以下の処理が行われます。
スクリプトを実行後、iDempiereのEclipseでの開発環境が出来上がります。

  • iDempiereのソースをクローンしてMavenビルドを実行します。
  • iDempiereはVer.11に相当(執筆時点で開発中のバージョン)。
  • Eclipse JEE 2023-06をダウンロードしてセットアップします。
  • クローンしたiDempiereフォルダ内に新しいワークスペースを作成し、すべてのプロジェクトをワークスペースにインポートします。
  • ターゲットプラットフォームを設定してワークスペースをビルドします。
  • 接続プロパティ(idempiere.properties)とJettyサーバー(jettyhome)をセットアップします。
  • iDempiereデータベースをインポートします。
  • スクリプトの実行が完了すると、実行可能なEclipseワークスペースが完成します。

Windows環境用の環境構築スクリプト

今回の検証で、Windows用に修正したスクリプトをこちらに公開しています。
参考にしていだたければと思います。

事前準備

環境構築のスクリプトを実行するにあたり、以下の環境を前提としています。

  • Windows 10
  • 空きディスク容量 約5G前後あり
  • Docker Windows版がインストール済
  • GitBashがインストール済
  • posgreSQLクライアントがインストール済(psqlコマンドラインのみのインストールでよい)

スクリプト実行/環境構築開始

以下のコマンドを実行します。
今回の検証では、cドライブ直下にidempiere-devフォルダを作成しidempiere-devフォルダ配下を開発環境のフォルダとします。idempiere-devフォルダにセットアップスクリプト、eclipse、idempiereソースコードを配置します。
repositoryへダウンロードしながらセットアップが進みます。私の環境では、スクリプト実行完了まで約20分かかりました。
それでは、GitBashを起動し、セットアップを進めます。

スクリプトの実行

GitBashからスクリプトをクローンして、セットアップシェルを実行します。

cd /c/
mkdir idempiere-dev
cd idempiere-dev
git clone https://github.com/idempierefan/idempiere-setup-script-win.git .
./setup.sh --branch master --docker-postgres-create --db-admin-pass postgres

※ 実行中のメッセージ

$ cd /c/
./setup.sh --branch master --docker-postgres-create --db-admin-pass postgres
idempierefan@DEV-DESKTOP MINGW64 /c
$ mkdir idempiere-dev

idempierefan@DEV-DESKTOP MINGW64 /c
$ cd idempiere-dev

idempierefan@DEV-DESKTOP MINGW64 /c/idempiere-dev
$ git clone https://github.com/idempierefan/idempiere-setup-script-win.git .
Cloning into '.'...
remote: Enumerating objects: 14, done.
remote: Counting objects: 100% (14/14), done.
remote: Compressing objects: 100% (9/9), done.
remote: Total 14 (delta 3), reused 11 (delta 3), pack-reused 0
Receiving objects: 100% (14/14), 9.87 KiB | 4.93 MiB/s, done.
Resolving deltas: 100% (3/3), done.

idempierefan@DEV-DESKTOP MINGW64 /c/idempiere-dev (main)
$ ./setup.sh --branch master --docker-postgres-create --db-admin-pass postgres

*** Download Eclipse ***

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  522M  100  522M    0     0  12.3M      0  0:00:42  0:00:42 --:--:-- 12.0M

*** Extract Eclipse ***

Archive:  eclipse-jee-2023-06-R-win32-x86_64.zip
   creating: eclipse/
   creating: eclipse/p2/
   creating: eclipse/p2/org.eclipse.equinox.p2.engine/
   creating: eclipse/p2/org.eclipse.equinox.p2.engine/profileRegistry/
:
:
:
  inflating: eclipse/configuration/org.eclipse.equinox.simpleconfigurator/bundles.info
  inflating: eclipse/configuration/config.ini
  inflating: eclipse/configuration/org.eclipse.update/platform.xml
  inflating: eclipse/eclipse.exe
  inflating: eclipse/eclipsec.exe

*** Clone iDempiere ***

Cloning into 'idempiere'...
remote: Enumerating objects: 280177, done.
remote: Counting objects: 100% (2848/2848), done.
remote: Compressing objects: 100% (1575/1575), done.
remote: Total 280177 (delta 1435), reused 2007 (delta 1071), pack-reused 277329
Receiving objects: 100% (280177/280177), 381.67 MiB | 14.04 MiB/s, done.
Resolving deltas: 100% (215317/215317), done.
Updating files: 100% (11168/11168), done.

*** Download groovy ***

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
 53 28.2M   53 15.1M    0     0   160k      0  0:02:59  0:01:36  0:01:23  178k
:
:
:
  inflating: groovy-4.0.13/licenses/hamcrest-license.txt
  inflating: groovy-4.0.13/licenses/jline2-license.txt
  inflating: groovy-4.0.13/licenses/jsr166y-license.txt
  inflating: groovy-4.0.13/licenses/jsr223-license.txt
  inflating: groovy-4.0.13/licenses/junit4-license.txt
  inflating: groovy-4.0.13/licenses/junit5-license.txt
  inflating: groovy-4.0.13/licenses/xstream-license.txt

*** Run Maven Build ***

[INFO] Scanning for projects...
[INFO] ### Using TychoRepositoryTransport for remote P2 access ###
[INFO]     Cache location:         C:\Users\idempierefan\.m2\repository\.cache\tycho
[INFO]     Transport mode:         online
[INFO]     Update mode:            cache first
[INFO]     Minimum cache duration: 60 minutes
[INFO]       (you can configure this with -Dtycho.p2.transport.min-cache-minutes=<desired minimum cache duration>)
[INFO] Resolving target definition file:/C:/idempiere-dev/idempiere/org.idempiere.p2.targetplatform/org.idempiere.p2.targetplatform.target for environments=[linux/gtk/x86_64, win32/win32/x86_64, macosx/cocoa/x86_64], include source mode=honor, execution environment=StandardEEResolutionHints [executionEnvironment=OSGi profile 'JavaSE-17' { source level: 17, target level: 17}], remote p2 repository options=org.eclipse.tycho.p2.remote.RemoteAgent@7a3ab73a...
:
:
:
[INFO] --- tycho-source-plugin:3.0.5:plugin-source (plugin-source) @ org.idempiere.main ---
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for org.idempiere.main 11.0.0-SNAPSHOT:
[INFO]
[INFO] org.apache.ecs ..................................... SUCCESS [  7.245 s]
[INFO] org.adempiere.base ................................. SUCCESS [ 46.250 s]
[INFO] org.adempiere.base.callout ......................... SUCCESS [  0.708 s]
[INFO] org.adempiere.base.process ......................... SUCCESS [  1.484 s]
[INFO] org.adempiere.payment.processor .................... SUCCESS [  2.429 s]
[INFO] org.adempiere.eclipse.equinox.http.servlet ......... SUCCESS [  2.715 s]
[INFO] org.adempiere.install .............................. SUCCESS [  0.676 s]
[INFO] org.adempiere.plugin.utils ......................... SUCCESS [  0.628 s]
[INFO] org.adempiere.pipo ................................. SUCCESS [  1.019 s]
[INFO] org.adempiere.pipo.handlers ........................ SUCCESS [  0.502 s]
[INFO] org.adempiere.replication .......................... SUCCESS [  0.337 s]
[INFO] org.adempiere.server ............................... SUCCESS [  9.467 s]
[INFO] org.adempiere.replication.server ................... SUCCESS [  0.300 s]
[INFO] org.adempiere.report.jasper.library ................ SUCCESS [ 31.342 s]
[INFO] org.adempiere.report.jasper ........................ SUCCESS [  0.372 s]
[INFO] org.adempiere.ui ................................... SUCCESS [  3.010 s]
[INFO] org.idempiere.zk.extra ............................. SUCCESS [ 46.087 s]
[INFO] org.idempiere.zk.billboard ......................... SUCCESS [  0.260 s]
[INFO] org.adempiere.ui.zk ................................ SUCCESS [ 31.454 s]
[INFO] org.compiere.db.oracle.provider .................... SUCCESS [  1.109 s]
[INFO] org.compiere.db.postgresql.provider ................ SUCCESS [  1.269 s]
[INFO] org.idempiere.felix.webconsole ..................... SUCCESS [  0.303 s]
[INFO] org.idempiere.hazelcast.service .................... SUCCESS [  5.260 s]
[INFO] Web Services Helper Resource Lookup ................ SUCCESS [  4.545 s]
[INFO] org.idempiere.webservices .......................... SUCCESS [ 19.161 s]
[INFO] org.idempiere.webservices.feature .................. SUCCESS [  4.528 s]
[INFO] org.idempiere.keikai ............................... SUCCESS [ 38.967 s]
[INFO] org.idempiere.printformat.editor ................... SUCCESS [  0.466 s]
[INFO] org.idempiere.zk.billboard.chart ................... SUCCESS [  0.465 s]
[INFO] org.adempiere.report.jasper.feature ................ SUCCESS [ 15.321 s]
[INFO] org.compiere.db.provider.feature ................... SUCCESS [  0.067 s]
[INFO] org.adempiere.payment.processor.feature ............ SUCCESS [  0.053 s]
[INFO] org.adempiere.pipo.feature ......................... SUCCESS [  0.057 s]
[INFO] org.adempiere.replication.feature .................. SUCCESS [  0.048 s]
[INFO] org.idempiere.webservices.client.feature ........... SUCCESS [ 10.290 s]
[INFO] org.adempiere.base.feature ......................... SUCCESS [ 11.614 s]
[INFO] org.adempiere.replication.server.feature ........... SUCCESS [  0.106 s]
[INFO] org.adempiere.ui.zk.feature ........................ SUCCESS [  0.136 s]
[INFO] org.idempiere.felix.webconsole.feature ............. SUCCESS [  0.064 s]
[INFO] org.idempiere.hazelcast.service.feature ............ SUCCESS [  0.049 s]
[INFO] org.idempiere.zk.feature ........................... SUCCESS [  0.342 s]
[INFO] org.idempiere.jetty.osgi.boot.fragment ............. SUCCESS [  0.315 s]
[INFO] org.idempiere.ui.sso.oidc .......................... SUCCESS [  3.811 s]
[INFO] org.adempiere.server.feature ....................... SUCCESS [ 25.074 s]
[INFO] org.idempiere.eclipse.platform.feature ............. SUCCESS [ 17.952 s]
[INFO] org.idempiere.equinox.p2.director.feature .......... SUCCESS [  0.074 s]
[INFO] org.idempiere.test ................................. SUCCESS [  3.953 s]
[INFO] org.idempiere.test.feature ......................... SUCCESS [  3.264 s]
[INFO] org.idempiere.p2 ................................... SUCCESS [02:02 min]
[INFO] org.idempiere.javadoc .............................. SUCCESS [  0.577 s]
[INFO] org.idempiere.p2.targetplatform .................... SUCCESS [  0.005 s]
[INFO] org.idempiere.main ................................. SUCCESS [  0.003 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  13:50 min
[INFO] Finished at: 2023-12-08T23:41:45+09:00
[INFO] ------------------------------------------------------------------------
:
:
:
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
Setting myEnvironment ....
Synchronize iDempiere Database - C:\idempiere-dev\idempiere\org.idempiere.p2\target\products\org.adempiere.server.product\win32\win32\x86_64 (idempiere)
Synchronize iDempiere Database
Upgrading database adempiere@idempiere
:
:
:
▒▒▒: Adding Language=ja, Country=JP, Locale=ja_JP
12▒▒ 08, 2023 11:48:10 ▒ߌ▒ org.adempiere.base.AnnotationBasedProcessFactory lambda$0
▒▒▒: BaseProcessFactoryImpl loaded 195 classes in 0.321s
12▒▒ 08, 2023 11:48:10 ▒ߌ▒ org.adempiere.base.AnnotationBasedColumnCalloutFactory lambda$0
▒▒▒: DefaultAnnotationBasedColumnCalloutFactory loaded 2 classes in 0.337s
12▒▒ 08, 2023 11:48:10 ▒ߌ▒ org.adempiere.base.AnnotationBasedProcessFactory lambda$0
▒▒▒: DefaultAnnotationBasedProcessFactory loaded 79 classes in 0.334s
23:48:10.791 Adempiere.startup: iDempiere(r) Release 11_2022-12-24 -Smart Suite ERP, CRM and SCM- (c) 1999-2023 iDempiere(r); Implementation: iDempiere - Supported by iDempiere community [1]
23:48:10.792 Ini.loadProperties: C:\idempiere-dev\idempiere\org.idempiere.p2\target\products\org.adempiere.server.product\win32\win32\x86_64\idempiere.properties #27 [1]
23:48:10.801 AnnotationBasedEventManager.lambda$0: DefaultAnnotationBasedEventManager loaded 2 classes in 0.169s [35]
23:48:11.962 SignDatabaseBuildApplication.start: Sign Database Build [1]
23:48:11.962 SignDatabaseBuildApplication.start: ------------------- [1]
23:48:11.964 SignDatabaseBuildApplication.start: Version = 11.0.0.202312081427 [1]
Version = 11.0.0.202312081427
23:48:11.966 SignDatabaseBuildApplication.start: UPDATE AD_System SET LastBuildInfo = ? [1]
UPDATE AD_System SET LastBuildInfo = ?
23:48:11.987     PreparedStatementProxy.invoke: Dec 8, 2023, 11:48:11 PM GMT+09:00,Update,AD_SYSTEM, (begin) [1]
23:48:12.002     PreparedStatementProxy.invoke: Dec 8, 2023, 11:48:12 PM GMT+09:00,Update,AD_SYSTEM, (end) [1]

スクリプト実行完了後のフォルダ構成

image.png

eclipseで環境の確認

eclipseを起動し開発環境を整えます。

1. C:\idempiere-dev\eclipseからeclipseアイコンをダブルクリックしeclipseを起動します。

image.png

2. eclipseが起動したら、Welcomタブが表示されます。×ボタンによりWelcomタブを閉じます。

Welcomタブを閉じるとProjectExplorerが表示されます。
ツリーの各パッケージに×が無いことを確認します。
image.png

Postgresqlの接続テスト

eclipseのメニューから[ Run ] => [ Run configurations... ]をクリックします。
ツリーからinstall.appをクリックし、Runボタンをクリックします。
image.png
テストボタンをクリックします。
チェックボックスで、緑色になれば設定は問題ありません。
保存ボタンをクリックします。
image.png

iDempiereサービス起動

1. eclipseのメニューから[ Run ] => [ Run configurations... ]をクリックします。

左側のツリーから、server.productをクリックし、Runボタンをクリックします。
image.png

2. 起動時のEclipseの処理メッセージ確認

実行後、Eclipseのコンソール画面が表示されるので内容を確認します。
メール関連のエラーメッセージが表示されますが、無視します。
ここまでメッセージが出力されればiDempiereサーバーの起動は成功です。

Please contact administrator. [44]
15:16:01.268-----------> EMail.setFrom: you @ company.org: javax.mail.internet.AddressException: Local address contains control or whitespace in string ``you @ company.org'' [44]
15:16:01.288-----------> EMail.addTo: you @ company.org: javax.mail.internet.AddressException: Local address contains control or whitespace in string ``you @ company.org'' [44]
15:16:01.288-----------> EMail.isValid: From is invalid=null [44]
15:16:01.289-----------> EMail.isValid: From is invalid=null [44]
15:16:01.289-----------> MClient.sendEMail: Could NOT Send Email: Server started: iDempiere (DESKTOP-VAHQ693:192.168.179.2) to you @ company.org: Invalid Data (System) [44]
15:16:10.689           LoggedSessionListener.contextInitialized: context initialized for 9.6.4 [44]
15:16:11.824-----------> DefaultAnnotationProcessor.fallbackToManualAnnotatedClasses: Unable to detect annotations. Application may fail to deploy. [44]
____________________________
Welcome to Apache Felix Gogo

iDempiereサービスの起動/動作確認

1. ブラウザを起動し、iDempiereメイン画面を開きます。

https://localhost:8443/webui/にアクセスし、以下のアカウントでログインします。

  • User: SuperUser
  • Password: System
    image.png

2. 以下のロール情報を選択し、OKボタンをクリックします。

  • Tenant: GardenWorld
  • Role: GardenWorld Admin
    image.png

3. ダッシュボードが表示されます。

  • ダッシュボード画面が表示されればログイン完了です。
    image.png

次回は

今回は、最新のiDempiereソースコード(Ver.11を想定)で開発環境を構築してみました。
次回から、今回構築した最新のソースコードを使用して各種機能の検証を進めたいと思います。

0
0
0

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
0
0