Re: cayenne-maven-plugin and its executions environment

2021-02-03 Thread Maria Huber
Hey Andrus,
with this hint I could solved my issue. The problem was, that the cayenne:cgen 
command just calls the default-cli config info.
To directly run a specific execution it is needed to extra define the execution 
id (e.g. mvn cayenne:cgen@cgen1).
When the generate-source phase is reached, both goals are executed.

Thanks for your help.
Maria



On 2021/02/03 12:52:18, Andrus Adamchik  wrote:
> You have explicit execution ids (which is correct), while "default-cli" 
> mentioned in the previous log, refers to the default execution (not either of 
> the executions below). So yours are not called for some reason. >
>
> Try adding "generate-sources" to each execution. >
>
> Andrus>
>
>
> > On Feb 3, 2021, at 3:45 PM, Maria Huber  wrote:>
> > >
> > >
> > Hey Andrus,>
> > this is the relevant piece of code:>
> > >
> > >
> >>
> >>
> >org.apache.cayenne.plugins>
> >cayenne-maven-plugin>
> >${cayenne.version}>
> > >
> >>
> >  >
> > cgen1>
> > >
> >   
> > ${project.basedir}/src/main/resources/mapA.map.xml>
> > >
> > >
> >   cgen>
> > >
> >   >
> >   >
> > cgen2>
> > >
> >   
> > ${project.basedir}/src/main/resources/mapB.map.xml>
> > >
> > >
> >   cgen>
> > >
> >   >
> > >
> > >
> >>
> >  ...>
> > >
> > >
> > Thanks for your great support.>
> > Maria>
> > >
> > On 2021/02/03 10:34:01, Andrus Adamchik  wrote:>
> >>> Maybe that why the mentioned error "The parameters 'map' for goal 
> >>> org.apache.cayenne.plugins:cayenne-maven-plugin:4.2.M2:cgen are missing 
> >>> or invalid" occurs.>>
> >> >
> >> Exactly. The question is why it is missing. Could you post the piece of 
> >> your pom with two executions?>>
> >> >
> >> Andrus >>
> >> >
> >> >
> >>> On Feb 3, 2021, at 10:41 AM, Maria Huber  wrote:>>
>  >
> >>> Hey Andrus,>>
> >>> I added two execution tags within the execution environment. According to 
> >>> maven's '-X' output, the loaded configuration looks like this:>>
>  >
> >>> ">>
> >>> [DEBUG] Goal:  
> >>> org.apache.cayenne.plugins:cayenne-maven-plugin:4.2.M2:cgen 
> >>> (default-cli)>>
> >>> [DEBUG] Style: Regular>>
> >>> [DEBUG] Configuration: >>
> >>> >>
> >>>   >>
> >>>   ${force}>>
> >>> >>
> >>> [DEBUG] 
> >>> ===>>
> >>> ">>
>  >
> >>> So the map information is missing. Maybe that why the mentioned error 
> >>> "The parameters 'map' for goal 
> >>> org.apache.cayenne.plugins:cayenne-maven-plugin:4.2.M2:cgen are missing 
> >>> or invalid" occurs.>>
> >>> Is there any Maven settings to change this import behavior?>>
>  >
> >>> Kind regards, Maria>>
>  >
>  >
>  >
> >>> On 2021/02/02 07:21:48, Andrus Adamchik  wrote:>>
>  Defining two "" tags with different map names should be the 
>  solution to that. And this should work. After all global and 
>  per-execution config merging is a feature of the Maven engine, and 
>  Cayenne does not mess with it. Try running mvn with the "-X" option. It 
>  will print the actual merged configurations for each plugin invocation 
>  and will help to debug the issue.>>>
> > >
>  Andrus>>>
> > >
> > >
> > On Feb 1, 2021, at 11:14 PM, Maria Huber  wrote:>>>
> >>> >
> > Hey Andrus,>>>
> > thanks for the help. Unfortunately this typing error doesn't solve my 
> > problem.>>>
> > I want to define two different map-files and run for both the cgen 
> > command. If possible this should work without running the modeler.>>>
> > Is there any solution to realize this in version 4.2.M2 (except the 
> > execution environment)?>>>
> > The config outside configuration solution allows only to define one 
> > map.>>>
> >>> >
> > Kind regards,>>>
> > Maria>>>
> >>> >
> >>> >
> > On 2021/02/01 05:53:27, Andrus Adamchik  
> > wrote:>>>
> >> Hi Maria,
>  >
> >> This may be just a typo in your POM:
>  >
> >>> ${project.basedir}/src/main/resources/scenario/my.map.xml
>  >
> >> vs
>  >
> >>> ${project.basedir}/src/main/resources/my.map.xml
>  >
>  >
> >> ("scenario" folder is missing in the last case)
>  >
> >> As an aside, since 4.1 CayenneModeler started to save your class 
> >> generation settings in .map.xml in a portable way, so our default 
> >> advice became to use CayenneModeler instead of Maven cgen for class 
> >> generation. (But of course you can keep using Maven if that better 
> >> fits your workflow).
>  >
> >> Andrus
>  >
>  >
> >>> On Jan 

Re: cayenne-maven-plugin and its executions environment

2021-02-03 Thread Andrus Adamchik
You have explicit execution ids (which is correct), while "default-cli" 
mentioned in the previous log, refers to the default execution (not either of 
the executions below). So yours are not called for some reason. 

Try adding "generate-sources" to each execution. 

Andrus


> On Feb 3, 2021, at 3:45 PM, Maria Huber  wrote:
> 
> 
> Hey Andrus,
> this is the relevant piece of code:
> 
> 
>
>
>org.apache.cayenne.plugins
>cayenne-maven-plugin
>${cayenne.version}
> 
>
>  
> cgen1
> 
>   
> ${project.basedir}/src/main/resources/mapA.map.xml
> 
> 
>   cgen
> 
>   
>   
> cgen2
> 
>   
> ${project.basedir}/src/main/resources/mapB.map.xml
> 
> 
>   cgen
> 
>   
> 
> 
>
>  ...
> 
> 
> Thanks for your great support.
> Maria
> 
> On 2021/02/03 10:34:01, Andrus Adamchik  wrote:
>>> Maybe that why the mentioned error "The parameters 'map' for goal 
>>> org.apache.cayenne.plugins:cayenne-maven-plugin:4.2.M2:cgen are missing or 
>>> invalid" occurs.>
>> 
>> Exactly. The question is why it is missing. Could you post the piece of your 
>> pom with two executions?>
>> 
>> Andrus >
>> 
>> 
>>> On Feb 3, 2021, at 10:41 AM, Maria Huber  wrote:>
 
>>> Hey Andrus,>
>>> I added two execution tags within the execution environment. According to 
>>> maven's '-X' output, the loaded configuration looks like this:>
 
>>> ">
>>> [DEBUG] Goal:  
>>> org.apache.cayenne.plugins:cayenne-maven-plugin:4.2.M2:cgen (default-cli)>
>>> [DEBUG] Style: Regular>
>>> [DEBUG] Configuration: >
>>> >
>>>   >
>>>   ${force}>
>>> >
>>> [DEBUG] 
>>> ===>
>>> ">
 
>>> So the map information is missing. Maybe that why the mentioned error "The 
>>> parameters 'map' for goal 
>>> org.apache.cayenne.plugins:cayenne-maven-plugin:4.2.M2:cgen are missing or 
>>> invalid" occurs.>
>>> Is there any Maven settings to change this import behavior?>
 
>>> Kind regards, Maria>
 
 
 
>>> On 2021/02/02 07:21:48, Andrus Adamchik  wrote:>
 Defining two "" tags with different map names should be the 
 solution to that. And this should work. After all global and per-execution 
 config merging is a feature of the Maven engine, and Cayenne does not mess 
 with it. Try running mvn with the "-X" option. It will print the actual 
 merged configurations for each plugin invocation and will help to debug 
 the issue.>>
> 
 Andrus>>
> 
> 
> On Feb 1, 2021, at 11:14 PM, Maria Huber  wrote:>>
>>> 
> Hey Andrus,>>
> thanks for the help. Unfortunately this typing error doesn't solve my 
> problem.>>
> I want to define two different map-files and run for both the cgen 
> command. If possible this should work without running the modeler.>>
> Is there any solution to realize this in version 4.2.M2 (except the 
> execution environment)?>>
> The config outside configuration solution allows only to define one map.>>
>>> 
> Kind regards,>>
> Maria>>
>>> 
>>> 
> On 2021/02/01 05:53:27, Andrus Adamchik  wrote:>>
>> Hi Maria,>>>
 
>> This may be just a typo in your POM:>>>
 
>>> ${project.basedir}/src/main/resources/scenario/my.map.xml>>>
 
>> vs>>>
 
>>> ${project.basedir}/src/main/resources/my.map.xml>>>
 
 
>> ("scenario" folder is missing in the last case)>>>
 
>> As an aside, since 4.1 CayenneModeler started to save your class 
>> generation settings in .map.xml in a portable way, so our default advice 
>> became to use CayenneModeler instead of Maven cgen for class generation. 
>> (But of course you can keep using Maven if that better fits your 
>> workflow).>>>
 
>> Andrus>>>
 
 
>>> On Jan 31, 2021, at 7:36 PM, Maria Huber  wrote:>>>
>> 
>>> Hey,>>>
>>> after spending quite some time, I still can't get the 
>>> cayenne-maven-plugin (4.4.M2) running as described in the latest 
>>> "Cayenne-Guide".>>>
>>> The problem is related to the execution environment.>>>
>>> This setting works just fine:>>>
>> 
>>> >>>
>>>org.apache.cayenne.plugins>>>
>>>cayenne-maven-plugin>>>
>>>${cayenne.version}>>>
>>>>>>
>>>
>>> ${project.basedir}/src/main/resources/scenario/my.map.xml>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>cgen>>>
>>>>>>
>>>>>>
>>>>>>
>>> >>>
>> 
>>> But if I 

Re: cayenne-maven-plugin and its executions environment

2021-02-03 Thread Maria Huber


Hey Andrus,
this is the relevant piece of code:




org.apache.cayenne.plugins
cayenne-maven-plugin
${cayenne.version}


  
 cgen1
 
   ${project.basedir}/src/main/resources/mapA.map.xml
 
 
   cgen
 
   
   
 cgen2
 
   ${project.basedir}/src/main/resources/mapB.map.xml
 
 
   cgen
 
   
 
 

 ...


Thanks for your great support.
Maria

On 2021/02/03 10:34:01, Andrus Adamchik  wrote:
> > Maybe that why the mentioned error "The parameters 'map' for goal 
> > org.apache.cayenne.plugins:cayenne-maven-plugin:4.2.M2:cgen are missing or 
> > invalid" occurs.>
>
> Exactly. The question is why it is missing. Could you post the piece of your 
> pom with two executions?>
>
> Andrus >
>
>
> > On Feb 3, 2021, at 10:41 AM, Maria Huber  wrote:>
> > >
> > Hey Andrus,>
> > I added two execution tags within the execution environment. According to 
> > maven's '-X' output, the loaded configuration looks like this:>
> > >
> > ">
> > [DEBUG] Goal:  
> > org.apache.cayenne.plugins:cayenne-maven-plugin:4.2.M2:cgen (default-cli)>
> > [DEBUG] Style: Regular>
> > [DEBUG] Configuration: >
> > >
> >  >
> >  ${force}>
> > >
> > [DEBUG] 
> > ===>
> > ">
> > >
> > So the map information is missing. Maybe that why the mentioned error "The 
> > parameters 'map' for goal 
> > org.apache.cayenne.plugins:cayenne-maven-plugin:4.2.M2:cgen are missing or 
> > invalid" occurs.>
> > Is there any Maven settings to change this import behavior?>
> > >
> > Kind regards, Maria>
> > >
> > >
> > >
> > On 2021/02/02 07:21:48, Andrus Adamchik  wrote:>
> >> Defining two "" tags with different map names should be the 
> >> solution to that. And this should work. After all global and per-execution 
> >> config merging is a feature of the Maven engine, and Cayenne does not mess 
> >> with it. Try running mvn with the "-X" option. It will print the actual 
> >> merged configurations for each plugin invocation and will help to debug 
> >> the issue.>>
> >> >
> >> Andrus>>
> >> >
> >> >
> >>> On Feb 1, 2021, at 11:14 PM, Maria Huber  wrote:>>
>  >
> >>> Hey Andrus,>>
> >>> thanks for the help. Unfortunately this typing error doesn't solve my 
> >>> problem.>>
> >>> I want to define two different map-files and run for both the cgen 
> >>> command. If possible this should work without running the modeler.>>
> >>> Is there any solution to realize this in version 4.2.M2 (except the 
> >>> execution environment)?>>
> >>> The config outside configuration solution allows only to define one map.>>
>  >
> >>> Kind regards,>>
> >>> Maria>>
>  >
>  >
> >>> On 2021/02/01 05:53:27, Andrus Adamchik  wrote:>>
>  Hi Maria,>>>
> > >
>  This may be just a typo in your POM:>>>
> > >
> > ${project.basedir}/src/main/resources/scenario/my.map.xml>>>
> > >
>  vs>>>
> > >
> > ${project.basedir}/src/main/resources/my.map.xml>>>
> > >
> > >
>  ("scenario" folder is missing in the last case)>>>
> > >
>  As an aside, since 4.1 CayenneModeler started to save your class 
>  generation settings in .map.xml in a portable way, so our default advice 
>  became to use CayenneModeler instead of Maven cgen for class generation. 
>  (But of course you can keep using Maven if that better fits your 
>  workflow).>>>
> > >
>  Andrus>>>
> > >
> > >
> > On Jan 31, 2021, at 7:36 PM, Maria Huber  wrote:>>>
> >>> >
> > Hey,>>>
> > after spending quite some time, I still can't get the 
> > cayenne-maven-plugin (4.4.M2) running as described in the latest 
> > "Cayenne-Guide".>>>
> > The problem is related to the execution environment.>>>
> > This setting works just fine:>>>
> >>> >
> > >>>
> >   org.apache.cayenne.plugins>>>
> >   cayenne-maven-plugin>>>
> >   ${cayenne.version}>>>
> >   >>>
> >   
> >${project.basedir}/src/main/resources/scenario/my.map.xml>>>
> >   >>>
> >   >>>
> >   >>>
> >   >>>
> >   cgen>>>
> >   >>>
> >   >>>
> >   >>>
> > >>>
> >>> >
> > But if I put the configuration inside the execution tag (as described 
> > in the Cayenne Guide), Maven can't find the map property.>>>
> >>> >
> > >>>
> >   org.apache.cayenne.plugins>>>
> >   cayenne-maven-plugin>>>
> >   ${cayenne.version}>>>
> >   >>>
> >   >>>
> >   execution1>>>
> >   >>>
> >   
> 

Re: cayenne-maven-plugin and its executions environment

2021-02-03 Thread Andrus Adamchik
> Maybe that why the mentioned error "The parameters 'map' for goal 
> org.apache.cayenne.plugins:cayenne-maven-plugin:4.2.M2:cgen are missing or 
> invalid" occurs.

Exactly. The question is why it is missing. Could you post the piece of your 
pom with two executions?

Andrus 


> On Feb 3, 2021, at 10:41 AM, Maria Huber  wrote:
> 
> Hey Andrus,
> I added two execution tags within the execution environment. According to 
> maven's '-X' output, the loaded configuration looks like this:
> 
> "
> [DEBUG] Goal:  
> org.apache.cayenne.plugins:cayenne-maven-plugin:4.2.M2:cgen (default-cli)
> [DEBUG] Style: Regular
> [DEBUG] Configuration: 
> 
>  
>  ${force}
> 
> [DEBUG] 
> ===
> "
> 
> So the map information is missing. Maybe that why the mentioned error "The 
> parameters 'map' for goal 
> org.apache.cayenne.plugins:cayenne-maven-plugin:4.2.M2:cgen are missing or 
> invalid" occurs.
> Is there any Maven settings to change this import behavior?
> 
> Kind regards, Maria
> 
> 
> 
> On 2021/02/02 07:21:48, Andrus Adamchik  wrote:
>> Defining two "" tags with different map names should be the 
>> solution to that. And this should work. After all global and per-execution 
>> config merging is a feature of the Maven engine, and Cayenne does not mess 
>> with it. Try running mvn with the "-X" option. It will print the actual 
>> merged configurations for each plugin invocation and will help to debug the 
>> issue.>
>> 
>> Andrus>
>> 
>> 
>>> On Feb 1, 2021, at 11:14 PM, Maria Huber  wrote:>
 
>>> Hey Andrus,>
>>> thanks for the help. Unfortunately this typing error doesn't solve my 
>>> problem.>
>>> I want to define two different map-files and run for both the cgen command. 
>>> If possible this should work without running the modeler.>
>>> Is there any solution to realize this in version 4.2.M2 (except the 
>>> execution environment)?>
>>> The config outside configuration solution allows only to define one map.>
 
>>> Kind regards,>
>>> Maria>
 
 
>>> On 2021/02/01 05:53:27, Andrus Adamchik  wrote:>
 Hi Maria,>>
> 
 This may be just a typo in your POM:>>
> 
> ${project.basedir}/src/main/resources/scenario/my.map.xml>>
> 
 vs>>
> 
> ${project.basedir}/src/main/resources/my.map.xml>>
> 
> 
 ("scenario" folder is missing in the last case)>>
> 
 As an aside, since 4.1 CayenneModeler started to save your class 
 generation settings in .map.xml in a portable way, so our default advice 
 became to use CayenneModeler instead of Maven cgen for class generation. 
 (But of course you can keep using Maven if that better fits your 
 workflow).>>
> 
 Andrus>>
> 
> 
> On Jan 31, 2021, at 7:36 PM, Maria Huber  wrote:>>
>>> 
> Hey,>>
> after spending quite some time, I still can't get the 
> cayenne-maven-plugin (4.4.M2) running as described in the latest 
> "Cayenne-Guide".>>
> The problem is related to the execution environment.>>
> This setting works just fine:>>
>>> 
> >>
>   org.apache.cayenne.plugins>>
>   cayenne-maven-plugin>>
>   ${cayenne.version}>>
>   >>
>   
> ${project.basedir}/src/main/resources/scenario/my.map.xml>>
>   >>
>   >>
>   >>
>   >>
>   cgen>>
>   >>
>   >>
>   >>
> >>
>>> 
> But if I put the configuration inside the execution tag (as described in 
> the Cayenne Guide), Maven can't find the map property.>>
>>> 
> >>
>   org.apache.cayenne.plugins>>
>   cayenne-maven-plugin>>
>   ${cayenne.version}>>
>   >>
>   >>
>   execution1>>
>   >>
>   
> ${project.basedir}/src/main/resources/my.map.xml>>
>   >>
>   >>
>   cgen>>
>   >>
>   >>
>   >>
> >>
>>> 
> This is the error message:>>
> "Failed to execute goal 
> org.apache.cayenne.plugins:cayenne-maven-plugin:4.2.M2:cgen (default-cli) 
> on project my-cayenne: The parameters 'map' for goal 
> org.apache.cayenne.plugins:cayenne-maven-plugin:4.2.M2:cgen are missing 
> or invalid">>
>>> 
> According to Stackoverflow, Maven handles the config-tag like this:>>
> 1. If the  is outside the  , it is the 
> configuration for the plugin to be used no matter what the life-cycle 
> phase is.>>
> 2. If the  is inside the , it is the 
> configuration to be used in certain life-cycle phase.>>
>>> 
> What could be the reason for this strange behavior?>>
>>> 
> Kind regards>>
>>> 
>>> 
>>> 
>>> 
>>> 
> 
> 
 
>> 
>> 
>