I am looking to create a maven groovy project using some sort of maven archetype. Typically in Java project the directories generated are:
src/main/javasrc/main/resourcessrc/test/javasrc/test/resourcesIs there a maven archetype that can generate a convention project by similar conventions, perhaps that has src/main/groovy and src/test/groovy? Something that IDEs such as IntelliJ may auto-detect as a groovy project.
Have you tried with one of the available here? https://mvnrepository.com/artifact/org.codehaus.groovy.maven.archetypes
For instance by running:
mvn archetype:generate -DarchetypeGroupId=org.codehaus.groovy.maven.archetypes -DarchetypeArtifactId=gmaven-archetype-basic -DarchetypeVersion=1.0
after running mvn archetype:generate add the lines below to the pom.xml file to set java version to 8 or higher.
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.java.version>8</project.java.version>
<project.javabin.version>8</project.javabin.version>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
You can also see the following post: https://www.baeldung.com/groovy-java-applications.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With