maven-archetype

Is there a way to post-process project generated from archetype?

一世执手 提交于 2020-01-11 05:59:26
问题 Say I have an archetype and I generate a project from it. But I would like to resolve placeholders in a property file of the project I generated on after generation time by passing the value for placeholder through command line. For example having the following command line: mvn archetype:create -DarchetypeGroupId=... -DarchetypeArtifactId=... -DarchetypeVersion=1.0 -DgroupId=... -DartifactId=my-project -Dversion=1.0-SNAPSHOT -Dhello=Hello! say the archetype contains app.properties (as part

Setting dynamic velocity properties for archetype maven projects

馋奶兔 提交于 2020-01-06 05:26:16
问题 I am creating an archetype and want to create a project wide available property containing things like the current date and an all lower case variant of the artifact id. I found the following post on Stackoverflow, that shows how it normally should be possible. I tried adding this to the archetype-metadata.xml like so: ... <requiredProperty key="artifactIdLower"> <defaultValue>${artifactId.toLowerCase()}</defaultValue> </requiredProperty> <requiredProperty key="ldt"> <defaultValue>${package

Create project from maven archetype via Apache Ivy

馋奶兔 提交于 2020-01-06 04:57:09
问题 If you want to create project with a Maven archetype you type mvn archetype:generate -DarchetypeGroupId=... -DarchetypeArtifactId=... \ -DarchetypeVersion=... -DgroupId=... -DartifactId=... \ -Dversion=... How this line would change if you are using Ivy? 回答1: ivy is not a drop in replacement for maven, it's a dependency manager for ant. If you want to use archetypes ivy won't be of any help 回答2: Since Ant + Ivy is all about configuration and flexibility, since this combo doesn't rely on

MAVEN Archetype choosing

懵懂的女人 提交于 2020-01-04 04:35:29
问题 Hi i am just new to maven. My requirement is to build a ear with 2 wars and also create a jar. I tried using some archetypes but few folder structure are missing. My maven folder structure should contain src/main/ java resource webapp test/java test/resource. Which archetype will be a suitable? 回答1: You cannot have it in single project, Since the EAR consists of different modules. So create separate project for war, jar and build. To create war file use maven-archetype-webapp, and for jar use

Eclipse and Maven via command line

杀马特。学长 韩版系。学妹 提交于 2020-01-04 02:54:16
问题 I can create a simple Maven application in the Eclipse IDE (version 3.71) by skipping archetype selection that contains folders ( Edit 2 as well as other folders): src/main/resources src/test/resources These folders are missing if I use the command line. I have been using the maven guide to create a maven project for my eclipse IDE using the command line as specified on the Maven site mvn archetype:generate -DgroupId=guide.ide.eclipse -DartifactId=guide-ide-eclipse How do I mimic Eclipse's

Maven archetype strips comments

佐手、 提交于 2020-01-03 15:18:47
问题 I'm using Maven to generate an archetype. I'm able to get the archetype to generate fine and the project template it generates works as expected. The only problem is in my shell scripts. Anything commented out in the script gets stripped leaving behind only commands. I've searched high and low and all I've been able to find was another user facing a similar issue with java comments. https://stackoverflow.com/questions/18797333/maven-archetype-generation-is-stripping-java-comments That

Maven archetype strips comments

ε祈祈猫儿з 提交于 2020-01-03 15:18:23
问题 I'm using Maven to generate an archetype. I'm able to get the archetype to generate fine and the project template it generates works as expected. The only problem is in my shell scripts. Anything commented out in the script gets stripped leaving behind only commands. I've searched high and low and all I've been able to find was another user facing a similar issue with java comments. https://stackoverflow.com/questions/18797333/maven-archetype-generation-is-stripping-java-comments That

Update list of Maven archetypes in IntelliJ “New Project” > “Maven” tab

扶醉桌前 提交于 2020-01-02 12:46:33
问题 How do I update the list of Maven archetypes listed in "New Project" dialog box in IntelliJ IDEA version 2017.2? 回答1: Manually trigger update of Maven cache IntelliJ 2017.2 is not so "intelli" with Maven. You must manually invoke an update of the Maven cache of repository information listing archetypes. Go to: Preferences > Build, Execution, Deployment > Build Tools > Maven > Repositories . For each of the items you care about in the list of Indexed Maven Repositories , click the row, wait a

How to use my custom archetype with Maven?

浪尽此生 提交于 2020-01-01 08:27:35
问题 I just create my custom archetype project, and I run perfectly the " mvn install " command. In my local repository, my archetype project was added correctly via m2/repository/com/mycomp/archetype-project-name . (but it was not created in the archetype folder : m2/repository/org/apache/maven/archetypes : maybe it's normal) But now I can't use my new custom archetype with the "mvn archetype:generation" command : with good parameters Maven tell me he doesn't find the archetype without parameters

How to use my custom archetype with Maven?

落爺英雄遲暮 提交于 2020-01-01 08:26:09
问题 I just create my custom archetype project, and I run perfectly the " mvn install " command. In my local repository, my archetype project was added correctly via m2/repository/com/mycomp/archetype-project-name . (but it was not created in the archetype folder : m2/repository/org/apache/maven/archetypes : maybe it's normal) But now I can't use my new custom archetype with the "mvn archetype:generation" command : with good parameters Maven tell me he doesn't find the archetype without parameters