Cache issue of download-maven-plugin for local building

745 views
Skip to first unread message

Ken Longnan

unread,
Jan 6, 2019, 9:56:48 AM1/6/19
to iDempiere
Hi,

I encountered cache problem during building 6.2. It was always using cached ones if building via "mvn clean verify". 

For example. the database seed files Adempiere_pg.jar and Adempiere.jar.
<execution>
<id>download-db-seed-pg</id>
<phase>validate</phase>
<goals>
<goal>wget</goal>
</goals>
<configuration>
<url>${url.file.srv}/database/6.2/Adempiere_pg.jar</url>
<unpack>false</unpack>
<outputDirectory>data/seed</outputDirectory>
<retries>5</retries>
</configuration>
</execution>

If old Adempiere_pg.jar existed in folder data/seed, or in cache folder ${local-repo}/.cache/maven-download-plugin, it would not download from github storage, and just copy each other for both folders. To fix the issue, it is very easy, just delete old files from both folders. Then next 'mvn verify', it will automatically download once.

If you have same problem like me unfortunately, have a try it could help.

BR,

Ken

Hiep Lq

unread,
Jan 7, 2019, 1:28:28 AM1/7/19
to Mohemmed Bilal Ilyas
Thanks for inform

can add (will do a patch for it)

<skipCache>true</skipCache>
<overwrite>true</overwrite>

but it will always download from github server.
i guess have better maven plugin for download that detect file change from server (by md5 example) to update cache like rsync


--
You received this message because you are subscribed to the Google Groups "iDempiere" group.
To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/idempiere/ae8bef27-caef-46a4-a2ec-e462e28d97a4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Lê Quý Hiệp
Email: hie...@hasuvimex.vn
Skype: admin.hasuvimex

Company: Thanh Hoa Fishery Import - Export J.s.c  (HasuvimexDL 47
Add: Lot E, Le Mon Industrial Zone, Thanh Hoa, Vietnam

Hiep Lq

unread,
Jan 7, 2019, 2:44:48 AM1/7/19
to Mohemmed Bilal Ilyas
to resolve that issue better add delete downloaded file on clean phase

Hiep Lq

unread,
Jan 7, 2019, 12:09:18 PM1/7/19
to iDempiere

Ken Longnan

unread,
Jan 10, 2019, 8:42:54 AM1/10/19
to iDempiere
Hi Hiep Lq,

I have updated with your commit, after "mvn clean", all downloaded jars have been cleaned in local source folder, but in next "mvn verify", it will still use cached jars from ${local-repo}/.cache/maven-
download-plugin. So I don't think it fixes the issue eventually.

Personally, I would like to add version tag as unique indicator into name of jar file, for example:
<url>${url.file.srv}/database/6.2/Adempiere_pg-6.2.jar</url>

Then even it cached at any time, it would not encounter issue of using wrong jar files. Sure, clean up old files in source folder is mandatory for new building.

BR,

Ken

Hiep Lq

unread,
Jan 10, 2019, 9:43:58 AM1/10/19
to Mohemmed Bilal Ilyas
your issue isn't cache issue.
your issue can explain like bellow:

1. you run "mvn verify" with 6.1
so it download https://github.com/idempiere/binary.file/blob/master/database/6.1/Adempiere.jar to .m2/repository/.cache/download-maven-plugin/Adempiere.jar_73924f4360dfdf19459955d9c9b999f5
and copy to [idempiere-src]\org.adempiere.server-feature/data/seed/Adempiere.jar

2. when you update to 6.2 and run "mvn verify"
because file already exists on [idempiere-src]\org.adempiere.server-feature/data/seed/Adempiere.jar
so it don't re-download so your binary use old version

now i change to delete [idempiere-src]\org.adempiere.server-feature/data/seed/Adempiere.jar each time run "mvn verify"
so it will always get correct file

--
You received this message because you are subscribed to the Google Groups "iDempiere" group.
To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Hiep Lq

unread,
Jan 10, 2019, 9:46:15 AM1/10/19
to Mohemmed Bilal Ilyas
version remove from jar to help each time update library we don't need to update .classpath .manifest
it don't have issue with cache because full url point to deference location

and


On Thu, Jan 10, 2019 at 8:42 PM Ken Longnan <ken.l...@gmail.com> wrote:
--
You received this message because you are subscribed to the Google Groups "iDempiere" group.
To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/idempiere/9c4d2471-3f7c-4f74-95bb-b9ee29652d6c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ken Longnan

unread,
Jan 10, 2019, 11:39:42 AM1/10/19
to iDempiere
I made several tests, the result is good with your fixing commit. but the logic which I found is not like what you said. Comments inline your email.

BR,

Ken

On Thursday, January 10, 2019 at 10:43:58 PM UTC+8, Hiep Lq wrote:
your issue isn't cache issue.
your issue can explain like bellow:

1. you run "mvn verify" with 6.1
so it download https://github.com/idempiere/binary.file/blob/master/database/6.1/Adempiere.jar to .m2/repository/.cache/download-maven-plugin/Adempiere.jar_73924f4360dfdf19459955d9c9b999f5
and copy to [idempiere-src]\org.adempiere.server-feature/data/seed/Adempiere.jar

2. when you update to 6.2 and run "mvn verify"
because file already exists on [idempiere-src]\org.adempiere.server-feature/data/seed/Adempiere.jar
so it don't re-download so your binary use old version

now i change to delete [idempiere-src]\org.adempiere.server-feature/data/seed/Adempiere.jar each time run "mvn verify"
so it will always get correct file
 
>  It will still use Adempiere.jar from .m2/repository/.cache/download-maven-plugin/, it will not download again. Because in index.ser the download URL already existed, then no need to download again.
>So the key is make sure to update download URL (keep same jar name) after each release. This is match what we did as usual, you can see the version 6.2 in the URL path.

Ken Longnan

unread,
Jan 10, 2019, 12:06:30 PM1/10/19
to iDempiere
Just see your last email regarding version, agree with you it is not cache issue.

BR,

Ken

Hiep Lq

unread,
Jan 10, 2019, 12:11:13 PM1/10/19
to Mohemmed Bilal Ilyas
add some step to clear (you can test by delete .m2/repository)

1. you run "mvn verify" with 6.1
so it download https://github.com/idempiere/binary.file/blob/master/database/6.1/Adempiere.jar to .m2/repository/.cache/download-maven-plugin/Adempiere.jar_73924f4360dfdf19459955d9c9b999f5
and copy to [idempiere-src]\org.adempiere.server-feature/data/seed/Adempiere.jar

2. when you update to 6.2 and run "mvn verify"
add step: it download https://github.com/idempiere/binary.file/blob/master/database/6.2/Adempiere.jar to .m2/repository/.cache/download-maven-plugin/Adempiere.jar_484de987cc7e6e3f884703b7faab1543
because file already exists on [idempiere-src]\org.adempiere.server-feature/data/seed/Adempiere.jar
so it don't re-download so your binary use old version => so it don't RE_COPY so your binary use old version

now i change to delete [idempiere-src]\org.adempiere.server-feature/data/seed/Adempiere.jar each time run "mvn verify"
so it will always get correct file
--
You received this message because you are subscribed to the Google Groups "iDempiere" group.
To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages