Glad you sorted it out, Marc.

[1] and [2] look correct to me, though - the ":" is there.  Perhaps a bit
tricky to see depending on resolution?

To answer your question more generally - and as you've probably gathered -
it's only necessary to run "datanucleus:enhance" in the modules where there
are entities.  In the archetypes there is just one module - for
"helloworld" it's a one-module project anyway, while for "simpleapp" it's
the "module-simple" module.

If you choose to split out your entities across multiple Maven modules then
you will need to run "datanucleus:enhance" in all of them.  Suppose you've
got modules in "module-customer" and "module-order"; then you could run the
following in the parent module:

mvn -pl module-customer,module-order datanucleus:enhance -o

Here "-pl" flag takes a comma-separated list of modules to run the enhance
goal in.

An alternative approach is to define a profile in the parent module, eg:

<profiles>
  <profile>
    <id>enhance</id>
    <activation>
      <property>
         <name>enhance</name>
      </property>
    </activation>
    <modules>
      <module>module-customer</module>
      <module>module-order</module>
    </modules>
  </profile>
</profiles>

Then you could use:

mvn -Denhance datanucleus:enhance -o

with the profile activated by the presence of the system property.

HTH
Dan


On Mon, 23 Jul 2018 at 09:50 Marc Fargas <[email protected]> wrote:

> On Mon, Jul 23, 2018 at 10:38 AM Marc Fargas <[email protected]>
> wrote:
> > On Mon, Jul 23, 2018 at 9:52 AM Martin Grigorov <[email protected]>
> wrote:
> > > On Mon, Jul 23, 2018 at 10:44 AM Marc Fargas <[email protected]>
> > > > My problem is with the enhancer though. Following the steps to make
> > > > IntelliJ work I shall call
> > > > "mvn datanucleusenhancer  -o" and there are screenshots etc but...
> This is
> > > > not for multimodule projects.
> > > >
> > > > Of course, Option A) would be to add the task for every module I
> have on
> > > > the Run Configuration.
> > > > But, and the reason I write you, Is there an Option B) by which I
> can call
> > > > datanucleusenhancer on all modules without manually listing them?
> > > >
> > > You need to enhance only the 'dom' module, the one that contains your
> > > domain objects.
>
> I just found out I can do
>     mvn  datanucleus:enhance -o
> From the root folder of my project.
>
> Please note that the IntelliJ instructions, on the screenshot of the
> run configutations, says "datanucleusenhance" (without the ":" in the
> middle) [1] and [2]. It is properly shown in [3]
>
> [1]:
> https://isis.apache.org/guides/dg/dg.html#__dg_ide_intellij_running_the-app
> [2]:
> https://isis.apache.org/guides/dg/images/intellij-idea/110-running-the-app/010-run-configuration.png
> [3]:
> https://isis.apache.org/guides/dg/dg.html#_dg_hints-and-tips_enhance-only
>
> Thanks for the help,
> Marc
>
-- 
DISCLAIMER: This e-mail is from Haywood Associates Ltd (Registered Number
3525455) and it and its attachments may be confidential and are intended
solely for the use of the individual to whom it is addressed.  Any
unauthorised use or dissemination of this communication is strictly
prohibited. Any information provided to Haywood Associates Ltd shall be
retained and used in accordance with our Privacy Statement at
http://www.haywood-associates.co.uk/privacy.  If you have received this
communication in error, please immediately notify the sender by return
e-mail message and delete all copies of the original communication.

Reply via email to