Derive package name from groupId and artifactId

This commit derives the package name of the application from the
artifact's `groupId` and `artifactId`. Previously sources were put in a
package that mirrors the groupId value.

This goes against the "unique package per application" policy that we
try to enforce. Even if the package name value can be customized
manually, deriving it automatically from the values provided in those
fields will help structure codebases.

With this change, the package name is derived like this:
* groupId `com.example`, artifactId `bookmarks` -> package
`com.example.bookmarks`
* groupId `com.example`, artifactId `user-management` -> package
`com.example.usermanagement`

This commit fixes the package name generation on the server, but also
in the web interfaces when the user updates the form fields.

Fixes gh-421
This commit is contained in:
Brian Clozel
2017-05-05 13:52:28 +02:00
parent 40ba2ea75c
commit bb578d6fdf
27 changed files with 72 additions and 45 deletions

View File

@@ -46,7 +46,7 @@ public class ProjectRequestDocumentFactoryTests extends AbstractInitializrStatTe
assertEquals(null, document.getRequestIp());
assertEquals("com.example", document.getGroupId());
assertEquals("demo", document.getArtifactId());
assertEquals("com.example", document.getPackageName());
assertEquals("com.example.demo", document.getPackageName());
assertEquals("1.2.3.RELEASE", document.getBootVersion());
assertEquals("1.8", document.getJavaVersion());
assertEquals("java", document.getLanguage());