How to build custom plugins using Maven?

410 views
Skip to first unread message

Anton Mostovenko

unread,
Mar 9, 2023, 9:32:46 AM3/9/23
to iDempiere
Hello,
I'm a member of palich.ru team and we are migrating our system to iDempiere 10 from iDempiere 3.1.
Because of that we need to learn how to use Maven instead of Buckminster.
I created a test plugins for that purpose. One plugin contains a process and it works fine while server is running in Eclipse. Another one is for Target Platform.
I was looking at this page trying to understand basic principles. Now I have a following structure:

>org.ipalich.targetplatform
>>org.ipalich.targetplaform.target
>>pom.xml
>org.ipalich.test
>>src
>>>...
>>pom.xml
>pom.xml

First level pom.xml:
 <groupId>org.idempiere</groupId>
  <artifactId>org.ipalich.allplugins</artifactId>
  <version>10.0.0-SNAPSHOT</version>
  <packaging>pom</packaging>
  <modules>  
  <module>org.ipalich.test</module>
  <module>org.ipalich.targetplatform</module>
  </modules>
</project>


Two other pom.xml have "org.idempiere.parent" as a Parent.

After executing this command:
[org.ipalich.allplugins]$ mvn clean verify -Didempiere.target=org.ipalich.targetplatform -X

I get:
...
[WARNING] Failed to build parent project for org.ipalich:org.ipalich.targetplatform:eclipse-target-definition:10.0.0-SNAPSHOT
org.apache.maven.project.ProjectBuildingException: Error resolving project artifact: org.idempiere:org.idempiere.parent:pom:${revision} was not found in https://repo1.maven.org/maven2 during a previous attempt. This failure was cached in the local repository and resolution is not
reattempted until the update interval of Central has elapsed or updates are forced for project org.idempiere:org.idempiere.parent:pom:${revision}

(and same erros for org.ipalich.test)

...
[ERROR] Internal error: java.lang.RuntimeException: Could not resolve target platform specification artifact org.idempiere:org.ipalich.targetplatform:target:10.0.0-SNAPSHOT -> [Help 1]
org.apache.maven.InternalErrorException: Internal error: java.lang.RuntimeException: Could not resolve target platform specification artifact org.idempiere:org.ipalich.targetplatform:target:10.0.0-SNAPSHOT
   at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:120)

What am I missing?
Is there any tutorial that can help me to understand how to create new plugins using Maven and how to build jars from command line? On Wiki I found only some pieces of information.

Vladislav Khrenov

unread,
Mar 9, 2023, 9:39:06 AM3/9/23
to idem...@googlegroups.com
Try to access https://repo1.maven.org/maven2 through VPN, because some MVN repos are blocked in Russia

чт, 9 мар. 2023 г. в 19:32, Anton Mostovenko <dori...@gmail.com>:
--
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/fa061fca-48c9-4c2d-b53c-2b1b736b52c2n%40googlegroups.com.

Heng Sin Low

unread,
Mar 9, 2023, 9:58:07 AM3/9/23
to idem...@googlegroups.com

Anton Mostovenko

unread,
Mar 9, 2023, 10:24:55 AM3/9/23
to iDempiere
I cloned "org.idempiere.zk.iceblue_c.theme" and placed it in the same folder as "idempiere".
After that I ran "mvn verify" in "idempiere-themes/org.idempiere.zk.iceblue_c.theme" directory and got this error:
[ERROR] Internal error: java.lang.RuntimeException: Could not resolve target platform specification artifact org.idempiere:org.idempiere.p2.targetplatform:target:10.0.0-SNAPSHOT -> [Help 1]
org.apache.maven.InternalErrorException: Internal error: java.lang.RuntimeException: Could not resolve target platform specification artifact org.idempiere:org.idempiere.p2.targetplatform:target:10.0.0-SNAPSHOT

Is it a right way to do it?

VPN did not help :(
четверг, 9 марта 2023 г. в 17:58:07 UTC+3, hengsin:

Heng Sin Low

unread,
Mar 9, 2023, 10:45:46 AM3/9/23
to idem...@googlegroups.com
Have you run mvn verify at idempiere folder ?

Anton Mostovenko

unread,
Mar 9, 2023, 10:51:14 AM3/9/23
to iDempiere
Yes, and it works well every time.

четверг, 9 марта 2023 г. в 18:45:46 UTC+3, hengsin:

Heng Sin Low

unread,
Mar 9, 2023, 11:07:52 AM3/9/23
to idem...@googlegroups.com
then if the following is your folder structure, it should just work.

<folder>
|
| - idempiere/org.adempiere.base
|
| - idempiere-themes/org.idempiere.zk.iceblue_c.theme

Anton Mostovenko

unread,
Mar 9, 2023, 11:21:21 AM3/9/23
to iDempiere
It is, exactly.
I'm using latest available Maven version. Not the one from recommendations on Wiki (3.6.3 I believe). Could it cause the problem?

четверг, 9 марта 2023 г. в 19:07:52 UTC+3, hengsin:

Heng Sin Low

unread,
Mar 9, 2023, 10:06:22 PM3/9/23
to idem...@googlegroups.com
I'm with Apache Maven 3.8.5 and Open JDK11.

"mvn verify" at idempiere folder followed by "mvn verify" at org.idempiere.zk.iceblue_c.theme folder.

If your problem persists, you might want to try removing the "~/.m2" folder.

Message has been deleted

Anton Mostovenko

unread,
Mar 10, 2023, 12:39:03 AM3/10/23
to iDempiere
I already tried to delete ~/.m2
Also it's the same on another server. Not only on my local machine.

пятница, 10 марта 2023 г. в 06:06:22 UTC+3, hengsin:

Heng Sin Low

unread,
Mar 10, 2023, 2:29:14 AM3/10/23
to idem...@googlegroups.com
ic, that's beyond me then, hopefully someone else can help you out.

Orlando Curieles

unread,
Mar 10, 2023, 6:05:11 AM3/10/23
to idem...@googlegroups.com
Hi, maybe our target platform plugin can help you, put in the branch 10


Best regards

Orlando

Anton Mostovenko

unread,
Mar 13, 2023, 8:36:15 AM3/13/23
to iDempiere
Problem was solved with help of my colleague - Anna Smirnova.
It's necessary to run "mvn install" in main workspace directory. "mvn verify" does not create required files in ~/.m2 directories. All Wiki pages contains information only about "verify".

Also plugin from this page is not modified to work with version 10, despite it has "release-10" branch. I was trying to build it for a long time, before author answered to my mail.

Thanks everyone!
пятница, 10 марта 2023 г. в 14:05:11 UTC+3, Orlando Curieles:

Anton Mostovenko

unread,
Mar 13, 2023, 8:37:11 AM3/13/23
to iDempiere
Btw, "mvn install" did not help me until I start everything from scratch. Including delete of ~/.m2 directory.

понедельник, 13 марта 2023 г. в 15:36:15 UTC+3, Anton Mostovenko:

Heng Sin Low

unread,
Mar 13, 2023, 8:40:23 AM3/13/23
to idem...@googlegroups.com
Not sure why you need to use mvn install instead, I've been using "mvn verify" only and it never gives me any problem.

Of course, mvn install should work but it shouldn't be required either.

Anna Fadeeva

unread,
Mar 13, 2023, 9:10:55 AM3/13/23
to iDempiere
On the Internet, my name is Anna Fadeeva ;-)

понедельник, 13 марта 2023 г. в 16:36:15 UTC+4, Anton Mostovenko:

Anna Fadeeva

unread,
Mar 13, 2023, 9:12:04 AM3/13/23
to iDempiere
Perhaps a Clean install can help in some cases. But this needs to be checked.

понедельник, 13 марта 2023 г. в 16:37:11 UTC+4, Anton Mostovenko:

Anna Fadeeva

unread,
Mar 13, 2023, 9:14:58 AM3/13/23
to iDempiere
This link helped me 


понедельник, 13 марта 2023 г. в 16:36:15 UTC+4, Anton Mostovenko:
Problem was solved with help of my colleague - Anna Smirnova.
Reply all
Reply to author
Forward
0 new messages