stefanseifert opened a new issue, #980:
URL: https://github.com/apache/maven-archetype/issues/980

   ### Affected version
   
   3.4.1
   
   ### Bug description
   
   we have a `archetype-post-generate.groovy` that needs to run another maven 
call from within a script to do some extra work after the project was generated 
from the archetype. we need to make sure, that this "nested" maven call used 
the same maven settings XML file that the user has provided when running maven 
initially.
   
   this works in the groovy script buy using a statement like this to get a 
references to the provides user settings file:
   ```
   def mavenSettings = 
request.mavenSession?.request?.userSettingsFile?.absolutePath
   ```
   because a reference to MavenSession is provided in 
https://github.com/apache/maven-archetype/blob/12168e3ba30028457da9cb69af172745919372d9/archetype-common/src/main/java/org/apache/maven/archetype/ArchetypeGenerationRequest.java#L108-L110
   
   however, when generating a maven project not via the `generate` goal, but 
via running an integration test via the `integration-test` goal, the maven 
setting in `ArchetypeGenerationRequest` is null, because it's not passed over 
here:
   
https://github.com/apache/maven-archetype/blob/12168e3ba30028457da9cb69af172745919372d9/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/IntegrationTestMojo.java#L495-L505
   
   in my pov it doesn't make sense to provide less context properties in ITs 
compared to the actual run of a plugin. i will provide a PR that passed over 
the maven sesssion also for the IT runs.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to