Difference between revisions of "FR3403603 Mavenize"

From ADempiere
Jump to: navigation, search
This Wiki is read-only for reference purposes to avoid broken links.
(Overview)
(Working with Eclipse)
 
(45 intermediate revisions by 4 users not shown)
Line 4: Line 4:
  
 
==Overview==
 
==Overview==
 
  
 
*Tasks:
 
*Tasks:
**Collect the new clean ant files written by the "Swiss Guys" from Metux
+
<!--
 +
**Collect the [[Feature: Cleanup of Ant build scripts|new clean ant files]] written by the "Swiss Guys" from metuX GmbH
 
**Define modules based on relations in the ant files
 
**Define modules based on relations in the ant files
 
**Define work packages and who is responsible to which package
 
**Define work packages and who is responsible to which package
 
**Define project coordinator  
 
**Define project coordinator  
 
**Collect money and/or resources for doing this effort  
 
**Collect money and/or resources for doing this effort  
 +
-->
 
**Define time schedule together with TT and FT for organize the switch to maven build process
 
**Define time schedule together with TT and FT for organize the switch to maven build process
 
**Prepare training for all developers who don't know about maven building philosophy and how it works in the ADempiere world
 
**Prepare training for all developers who don't know about maven building philosophy and how it works in the ADempiere world
Line 18: Line 19:
 
===References===
 
===References===
  
*Feature Request: #3403603 "Mavenize ADempiere" [https://sourceforge.net/tracker/?func=detail&atid=879335&aid=3403603&group_id=176962]
+
;Feature Request:
 +
:#3403603 "Mavenize ADempiere" [https://sourceforge.net/tracker/?func=detail&atid=879335&aid=3403603&group_id=176962]
  
*Forum thread about this task: http://sourceforge.net/projects/adempiere/forums/forum/611167/topic/4659270
+
;Related task that includes an analysis of the current ant-based build process
*Maven home page: http://maven.apache.org/
+
:[[Feature: Cleanup of Ant build scripts]]
**Maven IDE for eclipse: http://mevenide.codehaus.org/
+
*ADempiere Software development procedure: http://www.adempiere.com/Software_Development_Procedure
+
*Mercurial home page: http://mercurial.selenic.com/
+
**Mercurial flow extension https://bitbucket.org/yinwm/hgflow/wiki/UserManual
+
  
*ADempiere HG repo: http://adempiere.hg.sourceforge.net:8000/hgroot/adempiere/adempiere
+
;Forum thread about this task:
 +
:http://sourceforge.net/projects/adempiere/forums/forum/611167/topic/4659270
 +
;Maven
 +
:home page: http://maven.apache.org/
 +
:Maven IDE for eclipse: http://mevenide.codehaus.org/
  
*ADempiere Maven-Repo: http://nexus.adempiere.de/nexus
+
;ADempiere Software development procedure:
**[[User:Tobi|Tobi]] 08:28, 7 September 2011 (UTC) : feel free to contact me for a "deployer" account, meaning that you can deploy artifacts to this repo, if they are not found anywhere else
+
:http://www.adempiere.com/Software_Development_Procedure
 +
 
 +
;Mercurial home page:
 +
:http://mercurial.selenic.com/
 +
:*Mercurial flow extension https://bitbucket.org/yinwm/hgflow/wiki/UserManual
 +
 
 +
;ADempiere HG repo:
 +
:http://adempiere.hg.sourceforge.net:8000/hgroot/adempiere/adempiere
 +
 
 +
;ADempiere Maven-Repo:
 +
:http://nexus.adempiere.de/nexus
 +
:*[[User:Tobi|Tobi]] 08:28, 7 September 2011 (UTC) : feel free to contact me for a "deployer" account, meaning that you can deploy artifacts to this repo, if they are not found anywhere else
  
 
==Development==
 
==Development==
 +
 +
=== Directory Layout ===
 +
 +
; common
 +
: contains the common code: base, patches-ecs (extracted from tools with a meaningful name)
 +
; desktop client
 +
: the desktop client
 +
; web-client
 +
: the various web clients and application, with code separated from webapp to ease dependency management of extensions
 +
; JasperReports
 +
: the jasper report library, ejb bean, and web application
 +
; lagacy
 +
: contains unused projects: looks and interface (both was empty), serverApps and serverRoot (what remains after the code and webapp has been extracted), tools, JasperReportsTools, sqlj and posterita
 +
; server
 +
: the server components, and installation
 +
; assembly
 +
: the ear assemblies, will contain the webstart client when its ready, and the final assemblies
 +
 +
As of now the ear and war assemblies have still to be finalized, because it will depends on how all of adempiere will be assembled.
 +
Webstart client has still to be done, and there are still some directory layout changes that could be done.
 +
 +
<!--
 +
=== ToDo List ===
 +
 +
{|cellpadding="5" cellspacing="0" border="1"
 +
|-
 +
! Todo
 +
! Working on it
 +
! Status
 +
|-
 +
| Prepare parent pom
 +
| Freepath
 +
| Done
 +
|-
 +
| Migrate 'base' to compile with maven
 +
| Freepath
 +
| Done
 +
|-
 +
| Migrate 'tools' to compile with maven
 +
| Freepath
 +
| Done
 +
|-
 +
| Migrate 'client' to compile with maven
 +
| Freepath
 +
| Done
 +
|-
 +
| Migrate 'server' to compile with maven
 +
| Freepath
 +
| Done
 +
|-
 +
| Migrate 'webui' to compile with maven
 +
| Freepath
 +
| Done
 +
|-
 +
| Migrate 'webStore' to compile with maven
 +
| Freepath
 +
| Done
 +
|-
 +
| Migrate 'webCM' to compile with maven
 +
| Freepath
 +
| Done
 +
|-
 +
| Install and setup maven mirror
 +
| Tobi
 +
| Done
 +
|-
 +
| Upload of missin artifact
 +
| Tobi/Freepath
 +
| Done
 +
|-
 +
| Refactor directory structure
 +
| Freepath
 +
| Done
 +
|-
 +
| Migrate Webstart client
 +
| Tobi
 +
| In progress
 +
|-
 +
| Finalize assemblies
 +
| Tobi/Teo
 +
| In progress
 +
|}
 +
-->
  
 
===Developers===
 
===Developers===
Line 38: Line 134:
 
* [[User:tobi | Tobias Schöneberg]]
 
* [[User:tobi | Tobias Schöneberg]]
 
* [[User:Dominik|Banym]]
 
* [[User:Dominik|Banym]]
* [[User:Trifonnt|Trifon Trifonov]]
+
* [[User:freepath|Freepath]]
 
+
* [[User:Philip|Philip Gossweiler]]
 +
* [[User:Teo sarca|Teo Sarca]]
 
Please add you here if you want to help.
 
Please add you here if you want to help.
  
 
===Testers===
 
===Testers===
 
===Sponsors===
 
===Sponsors===
 +
 +
[[User:Tobi|Tobi]] 06:28, 23 November 2011 (UTC) Other developers, testers and so on: feel free to add your company, if it donated time, money or infrastructure (or something else I forgot to mention :-) )
 +
 +
*[http://www.metas.de metas Group] (donating office hours)
 +
*[http://www.freepath.it Freepath srl] (donating office hours)
  
 
=== Branch code ===
 
=== Branch code ===
  
Add HG repo URL(s) here
+
*Branch name is <tt>feature/FR3403603_mavenize</tt>
*Branch name is FR3403603_mavenize
+
  
 
=== Roadmap Document===
 
=== Roadmap Document===
Line 64: Line 165:
 
! style="background:#3399FF; color:white" | Summary
 
! style="background:#3399FF; color:white" | Summary
 
|-
 
|-
! align="left" style="background:#999999; color:white" | New Functionality
+
! align="left" style="background:#999999; color:white" | Migration Steps
 
|-
 
|-
  
!align="left"  style="background:#EFF5FB; color:#0080FF" | Functionality 1
+
!align="left"  style="background:#EFF5FB; color:#0080FF" | Migrate java code to compile with maven
!style="background:#EFF5FB; color:#0080FF"|Pending
+
!style="background:#EFF5FB; color:#0080FF"|Done
!style="background:#EFF5FB; color:#0080FF"|[[User:vpj-cd |Victor Perez]]
+
!style="background:#EFF5FB; color:#0080FF"|Freepath
 
!style="background:#EFF5FB; color:#0080FF"|High
 
!style="background:#EFF5FB; color:#0080FF"|High
 
!style="background:#EFF5FB; color:#0080FF"|Version No
 
!style="background:#EFF5FB; color:#0080FF"|Version No
Line 75: Line 176:
 
!style="background:#EFF5FB; color:#0080FF"|Draft
 
!style="background:#EFF5FB; color:#0080FF"|Draft
 
|-
 
|-
!align="left" style="background:#EFF5FB; color:#0080FF" |* Functionality 2
+
!align="left" style="background:#EFF5FB; color:#0080FF" | Install and setup maven mirror
 +
! style="background:#EFF5FB; color:#0080FF"|Done
 +
! style="background:#EFF5FB; color:#0080FF"|Tobi/Banym
 +
! style="background:#EFF5FB; color:#0080FF"|High
 +
! style="background:#EFF5FB; color:#0080FF"|Version No
 +
! style="background:#EFF5FB; color:#0080FF"|--
 +
! style="background:#EFF5FB; color:#0080FF"|Draft
 +
|-
 +
!align="left" style="background:#EFF5FB; color:#0080FF" | upload missing artifacts
 +
! style="background:#EFF5FB; color:#0080FF"|Done
 +
! style="background:#EFF5FB; color:#0080FF"|Freepath
 +
! style="background:#EFF5FB; color:#0080FF"|High
 +
! style="background:#EFF5FB; color:#0080FF"|Version No
 +
! style="background:#EFF5FB; color:#0080FF"|--
 +
! style="background:#EFF5FB; color:#0080FF"|Draft
 +
|-
 +
!align="left" style="background:#EFF5FB; color:#0080FF" | Finalize assemblies
 +
! style="background:#EFF5FB; color:#0080FF"|In progress
 +
! style="background:#EFF5FB; color:#0080FF"|Teo/Tobi
 +
! style="background:#EFF5FB; color:#0080FF"|High
 +
! style="background:#EFF5FB; color:#0080FF"|Version No
 +
! style="background:#EFF5FB; color:#0080FF"|--
 +
! style="background:#EFF5FB; color:#0080FF"|Draft
 +
|-
 +
!align="left" style="background:#EFF5FB; color:#0080FF" | Provide developer docs
 
! style="background:#EFF5FB; color:#0080FF"|Pending
 
! style="background:#EFF5FB; color:#0080FF"|Pending
! style="background:#EFF5FB; color:#0080FF"|[[User:vpj-cd |Victor Perez]]
+
! style="background:#EFF5FB; color:#0080FF"|Tobi
 
! style="background:#EFF5FB; color:#0080FF"|High
 
! style="background:#EFF5FB; color:#0080FF"|High
 
! style="background:#EFF5FB; color:#0080FF"|Version No
 
! style="background:#EFF5FB; color:#0080FF"|Version No
Line 85: Line 210:
  
 
=== Tracker ===
 
=== Tracker ===
URLs of related SourceForge trackers / threads.
+
*http://sourceforge.net/projects/adempiere/forums/forum/611167/topic/4659270
  
 
=== Migration Script ===
 
=== Migration Script ===
 +
==== Oracle ====
 +
/misc/src/main/resources/migration/370lts-release/oracle/820_FR3403603_drop_MyValidator.sql
 +
 +
==== PostgreSQL ====
 +
/misc/src/main/resources/migration/370lts-release/postgresql/820_FR3403603_drop_MyValidator.sql
  
<!--
 
commented this out, because aparently it doesn't apply hre
 
=== Java Package ===
 
=== Java Test ===
 
-->
 
 
=== Install Step ===
 
=== Install Step ===
Installation instructions
 
  
 +
====Running the mavenized adempiere-server====
 +
 +
*Download and extract the latest snapshot from
 +
:'''http://nexus.adempiere.de/nexus/content/repositories/snapshots/org/adempiere/adempiere-dist-jboss/3.7.0-FR3403603-SNAPSHOT/'''
 +
 +
*Execute RUN_Setup
 +
**'''IMPORTANT''' Currently, the setup will only work with JBoss
 +
**After making the settings, the setup process will finish ''very'' quickly. This is because most of the thing done by the old process ^have already been done during the maven build
 +
*Import the DB seed (Execute utils/)
 +
*Execute the migration script to get rid of the "MyModelValidator" sample GardenWorld validator
 +
*Start the server with /utils/RUN_Server2.sh
 +
 +
====Developing with the mavenized adempiere====
 +
 +
'''Notes:'''
 +
*We are still looking for better ways to work with the mavenized project(s) and modules
 +
*Currently, we check out the whole thing, which is a big overhead in most cases
 +
 +
 +
=====Preparations=====
 +
*Paste this into your local maven settings.xml to access the repository:
 +
<pre>
 +
<repository>
 +
<releases>
 +
<enabled>true</enabled>
 +
<updatePolicy>always</updatePolicy>
 +
<checksumPolicy>fail</checksumPolicy>
 +
</releases>
 +
<snapshots>
 +
<enabled>true</enabled>
 +
</snapshots>
 +
<id>adempiere-public</id>
 +
<url>http://nexus.adempiere.de/nexus/content/groups/public/</url>
 +
</repository>
 +
</pre>
 +
 +
*Make sure that you have maven-3.0.3 installed
 +
mvn --version
 +
*Make sure that the following environment variable is set (following is how to do it on WindowsXP command line)
 +
set MAVEN_OPTS=-Xmx1024m -XX:MaxPermSize=256M
 +
:Note: maven might have trouble with " signs, so pls be sure not to use them
 +
 +
=====Building from commandline=====
 +
*Check out the FR-branch from the adempiere repo
 +
*Go to the checked-out base directory and run
 +
mvn install
 +
:This should build adempiere at
 +
/assembly/adempiere-dist/jboss/target
 +
 +
=====Working with Eclipse=====
 +
 +
Note [[User:Tobi|Tobi]] 14:16, 27 November 2011 (UTC)
 +
:If you want to work with mavenized adempiere in eclipse, I recomment to proceed as follows.
 +
:However, I doubt that this is already the optimal way, so it would be nice if someone found and documented better ways
 +
 +
*Install the m2e plugin
 +
**I recomment using the external maven-3.0.3 and make sure that this maven installation is also used by the eclipse plugin
 +
***=> Window -> Preferences -> Maven -> Instalations -> "Add-Button"
 +
 +
To make sure that maven runs with enought mem, you can refer to this http://stackoverflow.com/questions/1705736/how-do-i-get-m2eclipse-to-recognize-m2-opts (however, the M2_OPTS solution didn't work for me!) or you can create a launch config and pass the parameters to java that way.
 +
 +
 +
*'''Important:''' If you build from command line, while eclipse with the m2e plugin is running, duplicate entries might turn up in artifacts. This will cause the jnlp build to fail, because it can't handle archives with duplicate entries. So, better make sure to close eclipse when running maven from command line.
  
 
<!--
 
<!--
Line 110: Line 297:
 
===Menu===
 
===Menu===
 
-->
 
-->
 +
 +
 +
[[Category:Feature Request - In Progress]]

Latest revision as of 01:44, 2 January 2012

Technical Specifications

Introduction

Overview

  • Tasks:
    • Define time schedule together with TT and FT for organize the switch to maven build process
    • Prepare training for all developers who don't know about maven building philosophy and how it works in the ADempiere world


References

Feature Request
  1. 3403603 "Mavenize ADempiere" [1]
Related task that includes an analysis of the current ant-based build process
Feature: Cleanup of Ant build scripts
Forum thread about this task
http://sourceforge.net/projects/adempiere/forums/forum/611167/topic/4659270
Maven
home page: http://maven.apache.org/
Maven IDE for eclipse: http://mevenide.codehaus.org/
ADempiere Software development procedure
http://www.adempiere.com/Software_Development_Procedure
Mercurial home page
http://mercurial.selenic.com/
ADempiere HG repo
http://adempiere.hg.sourceforge.net:8000/hgroot/adempiere/adempiere
ADempiere Maven-Repo
http://nexus.adempiere.de/nexus
  • Tobi 08:28, 7 September 2011 (UTC) : feel free to contact me for a "deployer" account, meaning that you can deploy artifacts to this repo, if they are not found anywhere else

Development

Directory Layout

common
contains the common code: base, patches-ecs (extracted from tools with a meaningful name)
desktop client
the desktop client
web-client
the various web clients and application, with code separated from webapp to ease dependency management of extensions
JasperReports
the jasper report library, ejb bean, and web application
lagacy
contains unused projects: looks and interface (both was empty), serverApps and serverRoot (what remains after the code and webapp has been extracted), tools, JasperReportsTools, sqlj and posterita
server
the server components, and installation
assembly
the ear assemblies, will contain the webstart client when its ready, and the final assemblies

As of now the ear and war assemblies have still to be finalized, because it will depends on how all of adempiere will be assembled. Webstart client has still to be done, and there are still some directory layout changes that could be done.


Developers

Please add you here if you want to help.

Testers

Sponsors

Tobi 06:28, 23 November 2011 (UTC) Other developers, testers and so on: feel free to add your company, if it donated time, money or infrastructure (or something else I forgot to mention :-) )

Branch code

  • Branch name is feature/FR3403603_mavenize

Roadmap Document

Use/Extend the table as required

Functionality / Feature Status Developer Priority Milestone Release Date Summary
Migration Steps
Migrate java code to compile with maven Done Freepath High Version No -- Draft
Install and setup maven mirror Done Tobi/Banym High Version No -- Draft
upload missing artifacts Done Freepath High Version No -- Draft
Finalize assemblies In progress Teo/Tobi High Version No -- Draft
Provide developer docs Pending Tobi High Version No -- Draft

Tracker

Migration Script

Oracle

/misc/src/main/resources/migration/370lts-release/oracle/820_FR3403603_drop_MyValidator.sql

PostgreSQL

/misc/src/main/resources/migration/370lts-release/postgresql/820_FR3403603_drop_MyValidator.sql

Install Step

Running the mavenized adempiere-server

  • Download and extract the latest snapshot from
http://nexus.adempiere.de/nexus/content/repositories/snapshots/org/adempiere/adempiere-dist-jboss/3.7.0-FR3403603-SNAPSHOT/
  • Execute RUN_Setup
    • IMPORTANT Currently, the setup will only work with JBoss
    • After making the settings, the setup process will finish very quickly. This is because most of the thing done by the old process ^have already been done during the maven build
  • Import the DB seed (Execute utils/)
  • Execute the migration script to get rid of the "MyModelValidator" sample GardenWorld validator
  • Start the server with /utils/RUN_Server2.sh

Developing with the mavenized adempiere

Notes:

  • We are still looking for better ways to work with the mavenized project(s) and modules
  • Currently, we check out the whole thing, which is a big overhead in most cases


Preparations
  • Paste this into your local maven settings.xml to access the repository:
<repository>
	<releases>
		<enabled>true</enabled>
		<updatePolicy>always</updatePolicy>
		<checksumPolicy>fail</checksumPolicy>
	</releases>
	<snapshots>
		<enabled>true</enabled>
	</snapshots>
	<id>adempiere-public</id>
	<url>http://nexus.adempiere.de/nexus/content/groups/public/</url>
</repository>
  • Make sure that you have maven-3.0.3 installed
mvn --version
  • Make sure that the following environment variable is set (following is how to do it on WindowsXP command line)
set MAVEN_OPTS=-Xmx1024m -XX:MaxPermSize=256M
Note: maven might have trouble with " signs, so pls be sure not to use them
Building from commandline
  • Check out the FR-branch from the adempiere repo
  • Go to the checked-out base directory and run
mvn install
This should build adempiere at
/assembly/adempiere-dist/jboss/target
Working with Eclipse

Note Tobi 14:16, 27 November 2011 (UTC)

If you want to work with mavenized adempiere in eclipse, I recomment to proceed as follows.
However, I doubt that this is already the optimal way, so it would be nice if someone found and documented better ways
  • Install the m2e plugin
    • I recomment using the external maven-3.0.3 and make sure that this maven installation is also used by the eclipse plugin
      • => Window -> Preferences -> Maven -> Instalations -> "Add-Button"

To make sure that maven runs with enought mem, you can refer to this http://stackoverflow.com/questions/1705736/how-do-i-get-m2eclipse-to-recognize-m2-opts (however, the M2_OPTS solution didn't work for me!) or you can create a launch config and pass the parameters to java that way.


  • Important: If you build from command line, while eclipse with the m2e plugin is running, duplicate entries might turn up in artifacts. This will cause the jnlp build to fail, because it can't handle archives with duplicate entries. So, better make sure to close eclipse when running maven from command line.