I’ve problem with Maven. I tried to create archetype, but I don’t now how to put source file to directory ${groupId}/${artifactId}. If I try to create project from this archetype, file is stored implicitly in ${groupId} directory. It seems Maven supposes, that group ID is a package name. But I’m using ${groupId}/${artifactId} as package name so I need have the source file stored in ${groupId}/${artifactId} directory. I have seen solution: to put the file into __artifactId__ directory. Double underscore should determine a variable. However it doesn’t take any effect. Variable seems to be empty, but in package name inside source file is used succesfully.
Have enybody idea, which trick shall have been done when using double underscore in file name?
When you create a archetype of your project like so:
mvn archetype:create-from-project -DinteractiveSet the package – in an explicit form to the root of the project.
Then you create a project of this archetype enter your root package ${groupId}.$ {artifactId} in explicit form. example:
mvn archetype: generate-DarchetypeGroupId = com.test
-DarchetypeArtifactId = my_archetype
-DgroupId = com.test
-DartifactId = app
-Dpackage = com.test.app
-Dversion = 1.0-SNAPHOT
In this case, $ {groupId} = com.test, $ {artifactId} = app and target package = com.test.app