Maven Archetype
  1. Maven Archetype
  2. ARCHETYPE-192

Property replacement for required properties

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-alpha-3
    • Fix Version/s: 2.0-alpha-5
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      0

      Description

      It would be nice if one could define default values for required properties using other required properties.

      For example:

      <requiredProperties>
      <requiredProperty key="myModule" />
      <requiredProperty key="myApp" />
      <requiredProperty key="package">
      <defaultValue>org.foo.bar.$

      {myModule}

      .$

      {myApp}

      </defaultValue>
      </requiredProperty>
      </requiredProperties>

      having resources

      src/main/java
      dao/MyDao.java
      Main.java

      would produce

      org.foo.bar.mymodule.myapp.dao.MyDao.java
      org.foo.bar.mymodule.myapp.Main.java

        Issue Links

          Activity

          Hide
          Benjamin Papez added a comment -

          I have a use case, where I would need to reformat an existing property and use it as default value for another property. If for instance the artifactId is my-templates, I would like to automatically suggest creating a file called MyTemplates.properties. Using _artifactId_.properties now creates my-templates.properties which does not match the Java standard naming conventions. So would it somehow be possible to define a format conversion of the arifactId property and create another property using this Camel Case convention?

          Show
          Benjamin Papez added a comment - I have a use case, where I would need to reformat an existing property and use it as default value for another property. If for instance the artifactId is my-templates, I would like to automatically suggest creating a file called MyTemplates.properties. Using _ artifactId _.properties now creates my-templates.properties which does not match the Java standard naming conventions. So would it somehow be possible to define a format conversion of the arifactId property and create another property using this Camel Case convention?
          Hide
          Raphaël Piéroni added a comment -

          Fixed with revision 713809 and 714078.
          This is only available for hand created archetypes.

          Benjamin, please create another issue for your specific problem.

          Show
          Raphaël Piéroni added a comment - Fixed with revision 713809 and 714078. This is only available for hand created archetypes. Benjamin, please create another issue for your specific problem.
          Hide
          Torben Knerr added a comment -

          When will 2.0-alpha-5 be deployed to repo1.maven.org? I have seen it is already tagged in svn, so I guess it is already released, right?

          Show
          Torben Knerr added a comment - When will 2.0-alpha-5 be deployed to repo1.maven.org? I have seen it is already tagged in svn, so I guess it is already released, right?

            People

            • Assignee:
              Unassigned
              Reporter:
              Will Gomes
            • Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: