You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Cameron Hudson (JIRA)" <ji...@apache.org> on 2019/01/25 18:04:00 UTC

[jira] [Updated] (MNG-6576) Invalid package names are not rejected during archetype generation.

     [ https://issues.apache.org/jira/browse/MNG-6576?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Cameron Hudson updated MNG-6576:
--------------------------------
    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 and present the prompt again.

  was:
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}}


> Invalid package names are not rejected during archetype generation.
> -------------------------------------------------------------------
>
>                 Key: MNG-6576
>                 URL: https://issues.apache.org/jira/browse/MNG-6576
>             Project: Maven
>          Issue Type: Bug
>          Components: Command Line
>    Affects Versions: 3.6.0
>         Environment: MacOS 10.14.2 (Mojave)
>            Reporter: Cameron Hudson
>            Priority: Minor
>              Labels: archehtype, generate, package
>
> 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 and present the prompt again.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)