0

I'm trying to create a custom maven archetype for my development team. While I'm successful for the most part, the question I'm unable to find an answer is, can we control the name of the project that's created through command line Maven? I believe Maven uses ${archetypeId} variable to create the project name. However, I get two user inputs ${project_name} and ${dept_name} and want my project name to be formed ${dept_name}-${project_name}. So I display a text for artifactId when creating a new project, like GENERATED BASED ON USER INPUT FOR PROJECT NAME AND DEPT NAME to stop users from entering a value for ${artifactId} requiredProperty.

I do not want the developers to enter artifactId but also create the project as a concatenated value of dept_name and project_name and use this as the value for artifactId instead of the hardcoded value of "artifactid" which is a literal string? I put a literal string just to avoid the developers from entering anything for artifactId. Can someone pls help with my situation here?

Thanks!

1 Answer 1

0

You can try to add something like this in the pom:

 <build>
    <directory>target</directory>
    <outputDirectory>target/classes</outputDirectory>
    <finalName>${artifactId}-${version}</finalName>
 </build>

Kiril

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.