Maven archetype plugin doesn’t let .resources in archetype-resources through

The bug seems to be still present in the maven-archetype-plugin v3.0.1 . For those who do not want to downgrade the maven-resource-plugin. I managed to establish a more or less ugly workaround. First you rename the archetype-resources/.gitignore to __gitignore__ then inside the archetype-metadata.xml add <requiredProperties> <requiredProperty key=”gitignore”> <defaultValue>.gitignore</defaultValue> </requiredProperty> </requiredProperties> <fileSets> <fileSet> <directory></directory> <includes> <include>__gitignore__</include> … Read more

How to create a project using maven-archetype-plugin? What is artefactId etc?

mvn archetype:generate command is used to create a project from an existing template. There are several archetype’s defined by many developers and project groups. When you run the command, maven does following things: Downloads maven-archetype-plugin’s latest version. Lists all archetype’s that can be used to create a project from. If you defined an archetype while … Read more

Maven archetype for simple Servlet application

There is an archetype for webapp: mvn archetype:generate -DgroupId=com.acme \ -DartifactId=my-webapp \ -Dversion=1.0-SNAPSHOT \ -DarchetypeArtifactId=maven-archetype-webapp \ -DinteractiveMode=false This will generate the following structure: $ tree my-webapp/ my-webapp/ ├── pom.xml └── src └── main ├── resources └── webapp ├── index.jsp └── WEB-INF └── web.xml Where the web.xml is a Servlet 2.3 web.xml: $ cat my-webapp/src/main/webapp/WEB-INF/web.xml <!DOCTYPE … Read more

Why does Maven warn me about encoding?

You haven’t set the encoding default property like this: <project> … <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> … </project> This approach is better than defining encoding manually for every plugin, cause all plugins having default values for encoding for example the maven-resources-plugin: encoding: The character encoding scheme to be applied when filtering resources. Type: java.lang.String Required: No User … Read more