Uploaded image for project: 'Maven Archetype'
  1. Maven Archetype
  2. ARCHETYPE-559

Invalid package names are not rejected during archetype generation.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • None
    • MacOS 10.14.2 (Mojave)

    Description

      Steps to replicate:

      $ mvn archetype:generate

      I then entered

      • 1313 for the quickstart archetype.
      • 8 for quickstart archetype version 1.4.
      • info.cameronhudson.18655 for the groupId
      • lab1 for the artifactId
      • 1.0 for the snapshot version
      • public-recommendation-service for the package name
      • Y for confirmation

      This successfully creates a project, even though the package name is invalid.

      Attempting to run mvn clean install results in misleading compilation errors:

      [ERROR] COMPILATION ERROR :
      [INFO] -------------------------------------------------------------
      [ERROR] /Users/cameronhudson/Repositories/CMU/18-655_Lab_1_Public_Recommendation_Service/lab1/src/main/java/public-recommendation-service/App.java:[1,8] <identifier> expected
      [ERROR] /Users/cameronhudson/Repositories/CMU/18-655_Lab_1_Public_Recommendation_Service/lab1/src/main/java/public-recommendation-service/App.java:[1,15] class, interface, or enum expected
      [INFO] 2 errors
      

       

      Expected behavior:

      Inform the user that the package name is invalid (ideally, explaining why it's invalid) and present the prompt again.

      Attachments

        Activity

          People

            Unassigned Unassigned
            CameronHudson8 Cameron Hudson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: