Maven 1.x Application Generation Plugin

Genapp to prompt for project root

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Trivial Trivial
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 2.3
  • Component/s: None
  • Labels:
    None
  • Environment:
    All
  • Number of attachments :
    0

Description

Currently, the genapp plugin assumes that ${basedir} is to be the top-level of the project being 'gen'ed. The user doesn't realize that the plugin is going to write a bunch of files/directories to the current directory until after running it.

It would be nice if we could prompt for a location. I have tested that with simple code modifications to plugin.jelly & plugin.properties

plugin.jelly:
Step 1
Replace all occurences of ${basedir} with ${projectRoot}.

Step 2
Add the following lines at line 92

<!-- Get the project root -->
<j:set var="projectRoot" value="${maven.genapp.projectRoot}"/>
<j:if test="${empty(projectRoot)}">
<i:ask question="${maven.genapp.prompt.projectRoot}"
answer="projectRoot"
default="${basedir}/${maven.genapp.template.name}"/>
</j:if>

plugin.properties:
Added the property setting

maven.genapp.prompt.projectRoot=Please specify the project root directory:

I can provide the modified files – and related changes to properties.xml – if you wish.

Activity

Hide
Felipe Leme added a comment -

Closed.
Note though that I used the maven.genapp.basedir.prompt and maven.genapp.basedir as properties (sorry, I had used those properties while fixing MPGENAPP-24).

Show
Felipe Leme added a comment - Closed. Note though that I used the maven.genapp.basedir.prompt and maven.genapp.basedir as properties (sorry, I had used those properties while fixing MPGENAPP-24).

People

Vote (2)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved:

Time Tracking

Estimated:
3h
Original Estimate - 3 hours
Remaining:
3h
Remaining Estimate - 3 hours
Logged:
Not Specified
Time Spent - Not Specified