3

I am looking to start a project using Vaadin and I want to use Maven as the repository manager, but I am having a lot of trouble starting the Maven project.

I tried creating a project in IntelliJ using the vaadin-archetype-application-example and it doesn't create any directory.

I also tried creating the project with the mvn commands and I found a lot of troubles too. When I create the Maven project this error is shown in the log:

-Dmaven.multiModuleProjectDirectory system propery is not set. Check $M2_HOME environment variable and mvn script match.
[ERROR] Maven execution terminated abnormally (exit code 1)

How can I deploy a Maven project with IntelliJ? I have the Maven plugin installed and the mvn command seems to work just fine.

This is my pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.imtoolazytoadmin</groupId>
<artifactId>ImTooLazyToAdmin-master</artifactId>
<version>1.0-SNAPSHOT</version>

</project>
Gilles
  • 9,269
  • 4
  • 34
  • 53
  • Is it possible that this question is related: [click](http://stackoverflow.com/questions/29137172/maven3-3-1-config-error-in-intellij-idea-14) ? Otherwise this could be your problem (fixed in newer intellij versions) : [https://youtrack.jetbrains.com/issue/IDEA-137783](https://youtrack.jetbrains.com/issue/IDEA-137783) – JDC Nov 05 '15 at 08:49
  • **1)** What IJ & Maven versions are you using? **2)** Have you set the `M2_HOME` environmental variable? **3)** Please post the full log generated when manually running `mvn`. – Morfic Nov 05 '15 at 14:51
  • I'm running IntelliJ 14.0 and Maven 3.3.3. Yes my M2_HOME is correctly set. – Miguel Hernández Nov 05 '15 at 15:27
  • After adding -Dmaven.multiModuleProjectDirectory=project root in VM Option now IntelliJ displays the following log after importing the changes: Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.4:generate (default-cli) on project standalone-pom: The defined artifact is not an archetype – Miguel Hernández Nov 05 '15 at 16:02

1 Answers1

1

Use this command to create your project and then import it to your IDE.

$ mvn archetype:generate \
-DarchetypeGroupId=com.vaadin \
-DarchetypeArtifactId=vaadin-archetype-application \
-DarchetypeVersion=7.5.9 \
-DgroupId=your.company \
-DartifactId=project-name \
-Dversion=1.0 \
-Dpackaging=war

More info about creating Vaadin projects in IntelliJ here.

Víctor Gómez
  • 724
  • 6
  • 23