Offline all material of idempiere

From iDempiere en


while do IDEMPIERE-3136, i also contribute a patch to help create all material offline.

this wiki to explain how to use this feature

what's offline for

1. all file extend file get from source forge

https://sourceforge.net/projects/idempiere/files/binary.file/jarfile

2. all file get from maven

http://central.maven.org

3. all file get from maven of zk

http://mavensync.zkoss.org

4. restlet p2

http://maven.restlet.org

5. equinox p2

http://download.eclipse.org/eclipse/updates/4.4

6. orbit p2

http://download.eclipse.org/tools/orbit/downloads/drops

why have to offline

1. To setup development environment for idempiere (you always success if strict follow this guideline Installing iDempiere)

step Setting up Eclipse boring, take time, sometime can't finish by network issue.

it become worst when sourcefoge server or maven server have trouble.

(i get trouble when build from jenkin, it take over 100 minute but after that fail,

link from sourceforge can easy download by web browse, but wrong by ant script, buckminster

i guess reason by sourceforge dynamic change link to file to download,

maybe buckminster and ant normal comfort with this. but sometime not)

2. you have slow network.

i sure it's terrible. you wish a download accelerator come in to help increase speed, resume when break.

3. you have to setup environment for some machine.

yes, you can copy all idempiere folder, but i sure soon or late you will meet trouble.

4. you have to re-setup your environment but you ever don't have network.

............


setup offline repository

for now, you have to work with experience branch.

1. create a folder call root_offline, in guide i use [root_offline], you have to replace real path.

mkdir -P [root_offline]

2. offline sourceforge: download all from binary.file

i use rsync to sync all folder, sub-folder, file

to use rsync you must have a sourceforge account.

not require but for convenice you have to setup authenticate by ssh

when you done, do bellow command to download

rsync -avrPq hiepgau,idempiere@frs.sourceforge.net:/home/frs/project/idempiere/binary.file [root_offline]

(my account is hiepgau, please replace your account id)

it's linux, please contribute window way if you can.

3. offline p2 of equinox by mirrow: (now idempiere use luna version, so version on link is 4.4)

$ECLIPSE_FOLDER/eclipse \
     	 -application org.eclipse.equinox.p2.artifact.repository.mirrorApplication \
     	 -source $URL \
     	 -destination file:[root_offline]/eclipse-4.4.2 \
       -writeMode clean \
       -verbose

$ECLIPSE_FOLDER/eclipse \
       -application org.eclipse.equinox.p2.metadata.repository.mirrorApplication \
     	 -source $URL \
     	 -destination file:[root_offline]/eclipse-4.4.2 \
       -writeMode clean \
       -verbose

$ECLIPSE_FOLDER is path to your eclipse, or you can use eclipse sdk download from EclipseSDK

$URL for 4.4 is http://download.eclipse.org/eclipse/updates/4.4

p2 server of eclipse sometime also verry slow, you can download from my sourceforge

rsync -avrPq hiepgau,hsv@frs.sourceforge.net:/home/frs/project/hsv/p2/eclipse-4.4.2/ [root_offline]

4. offline p2 of orbit:

orbit provide a zip file of p2 repository, so just download it from orbit download

now idempiere use luna, so click to R20150124073747 to go to R20150124073747

get link to download from area "Zipped Orbit Build Repository"

(if you have trouble to download it, you can get from my sourceforge https://sourceforge.net/projects/hsv/files/orginal/)

(*) by update jasper report, some bundle need to get from orbit of neon, so you have to download it.

create two folder [root_offline]/orbit-luna and [root_offline]/orbit-neon

extract zip file of orbit luna, go to folder contain folder plugin, copy all its content to [root_offline]/orbit-luna

so [root_offline]/orbit-luna will have folder features, plugins, artifacts.jar, contents.jar, index.html

do same to neon

(*) jetty also provide a zip version of p2. now idempiere use 9.2.10. go to this page to download 9.3.10.v20160621

after that, we get offline p2 of jetty at [root_offline]/jetty-9.2.10

5. offline p2 of restlet by mirrow to [root_offline]/restlet-2.3

do same step 3 of equinox, with link is http://p2.restlet.com/2.3/

6. remain offline maven to next step.

7. setup artifactory (4.9.1) to create offline of maven.

go to https://www.jfrog.com/open-source/

download follow link: https://api.bintray.com/content/jfrog/artifactory/jfrog-artifactory-oss-$latest.zip;bt_package=jfrog-artifactory-oss-zip

extract and go to bin folder to run server by run artifactory.sh

open web browse and go to localhost:8081 login with account admin/admin



go to admin/repositorys/Remote

click new after that choose maven in dialog 

in form fill:

     maven for "Repository Key"

     http://central.maven.org for "URL"

click next/finish to complete


click new to create other. choose generic on dialog

in form fill:

     file-srv-maven for "Repository Key"

     http://central.maven.org for "url"

click next/finish to complete


click new to create other. choose generic on dialog

in form fill:

     zkoss-maven for "Repository Key"

     http://mavensync.zkoss.org for "url"

click next/finish to complete

8. use offline repository:

modify content of file [idempiere-expermental]/org.adempiere.sdk-feature/materialize.properties become

buckminster.download.source=true
osgi.configuration.area.default=configuration
osgi.user.area=${user.home}
osgi.user.area.default=${user.home}
target.os=*
target.ws=*
target.arch=*

local.repository.root=file://[root_offline]  # replace by your real path, after replace it become file:///xxxxxxxx (three /)

url.maven2=http://localhost:8081/artifactory/maven
url.maven2.lib=${url.maven2}

url.maven.zkoss.lib=http://localhost:8081/artifactory/zkoss-maven
url.zkoss.osgi=${local.repository.root}/jarfile/zk-p2/zk-8.0.1.1/

url.equinox=${local.repository.root}/eclipse-4.4.2
url.jetty=${local.repository.root}/jetty-9.2.10
url.orbit=${local.repository.root}/orbit-luna
url.orbit.neon=${local.repository.root}/orbit-neon

url.file.srv=${local.repository.root}/binary.file

url.restlet.p2=${local.repository.root}/restlet-2.3

url.modify.bundle=${local.repository.root}/binary.file/jarfile/modifyBundle-1.0.0

url.file.jp.lib=${local.repository.root}/binary.file/jarfile/jp-6.3.0

extend.bundle.folder.1
extend.bundle.folder.2
extend.bundle.folder.3
extend.bundle.folder.4
extend.bundle.folder.5
extend.bundle.folder.6
extend.bundle.folder.7
extend.bundle.folder.8
extend.bundle.folder.9
extend.bundle.folder.10

you can create a new file with name local.materialize.properties to separate offline and online.

in case you create new file. you have to edit file [idempiere-expermental]/org.adempiere.sdk-feature/adempiere.cquery

change value of properties to path of new file

now just run materialize idempiere and wailting util finish

9. create maven offline.

go localhost:8081 again

go admin/Import & Export/repositories

on form:


  choose "maven" for "Target Local Repository"

  fill "/tmp/export/maven" for "Export Path on Server"

  tick "Create .m2 Compatible Export"

now click export 

 do again with file-srv-maven to /tmp/export/file-srv-maven
 do again with zkoss-maven to /tmp/export/zkoss-maven
create folder [root_offline]/maven

copy content inside folder /tmp/export/file-srv-maven/repositories into [root_offline]/maven

copy content inside folder /tmp/export/maven/repositories into [root_offline]/maven

copy content inside folder /tmp/export/zkoss-maven/repositories into [root_offline]/maven

now edit file properties as bellow

add a new line bellow row define local.repository.root with content is:

local.repository.root.maven=${local.repository.root}/maven

edit line

  url.maven2=http://localhost:8081/artifactory/maven become

  url.maven2=${local.repository.root.maven}/maven

  url.maven.zkoss.lib=http://localhost:8081/artifactory/zkoss-maven become

  url.maven.zkoss.lib=${local.repository.root.maven}/maven.zkoss

10. now clone a new idempiere-expermental.

by clone, file adempiere.cquery and materialize.properties is old file.

copy file modified, disconect network, stop artifactory.

rerun material to check everything is correct.

if it's fine, now you have a offline repository, you can forget artifactory

some solution for special case

1. hard code of local.repository.root

you can see. when setup a offline repository, we have a hard code of url on materialize.properties.

it's value of local.repository.root

you have two solution for overcome it

  • 1. you have to setup to make local.repository.root at every your environment have same value.


  • 2. make a copy of file materialize.properties call script.materialize.properties
  • on script.materialize.properties comment out line "local.repository.root=file://[root_offline]"
  • on script or jenkin, before step materialize, do bellow script

delete setting properties on cquery

sed -i "s|properties=\"[^\"]*\"| |" $SDK_PROJECT/adempiere.cquery

add two parameter to buckminster import

-Dlocal.repository.root="$LOCAL_REPOSITORY_ROOT"
-P "$PROPERTIES_FILE"

PROPERTIES_FILE is path to script.materialize.properties

2. when manual call "fetch.dependency.jar", have error relate url.

url to ant download file build up from materialize.properties

file materialize.properties point out from cquery file.

so when manual invoke action "fetch.dependency.jar" it hasn't this variable

to fix this issue, when dialog invoke action display, you choose action also set properties file to materialize.properties

how it's implement

all url in file rmap, and file copyjars.xml use varial.

value of varial is passed by properties file.

all old link keep on default file materialize.properties

adempiere.cquery use relation path to use materialize.properties

Cookies help us deliver our services. By using our services, you agree to our use of cookies.