Скажите, в IDEA 13 (CE) создать проект на Maven с goals: clean, test, run, install вообще реально? Что для этого надо сделать, я не понимаю. В NetBeans всё просто и очевидно, а тут что за трэш и угар с конфигурациями?
MavenProject/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>MavenProject</groupId>
<artifactId>MavenProject</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
</project>
MavenProject/src/main/java/ru/vsprog/mavenproject/Main.java:
package ru.vsprog.mavenproject;
public class Main {
public static void main(String[] args) {
System.out.println("Hello World");
}
}
Делал как здесь: http://vsprog.ru/258 — окно «Maven Projects» в IDEA не нашёл. В последней версии его нет что ли?
Тот же проект в NetBeans очищается-собирается:
cd /usr/home/igor/IdeaProjects/MavenProject; JAVA_HOME=/usr/local/openjdk7 M2_HOME=/usr/home/igor/bin/apache-maven-3.1.1 /usr/home/igor/bin/apache-maven-3.1.1/bin/mvn clean install
Scanning for projects...
------------------------------------------------------------------------
Building MavenProject 1.0-SNAPSHOT
------------------------------------------------------------------------
--- maven-clean-plugin:2.5:clean (default-clean) @ MavenProject ---
Deleting /usr/home/igor/IdeaProjects/MavenProject/target
--- maven-resources-plugin:2.6:resources (default-resources) @ MavenProject ---
Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
Copying 0 resource
--- maven-compiler-plugin:2.5.1:compile (default-compile) @ MavenProject ---
File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
Compiling 1 source file to /usr/home/igor/IdeaProjects/MavenProject/target/classes
--- maven-resources-plugin:2.6:testResources (default-testResources) @ MavenProject ---
Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
skip non existing resourceDirectory /usr/home/igor/IdeaProjects/MavenProject/src/test/resources
--- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) @ MavenProject ---
Nothing to compile - all classes are up to date
--- maven-surefire-plugin:2.12.4:test (default-test) @ MavenProject ---
No tests to run.
--- maven-jar-plugin:2.4:jar (default-jar) @ MavenProject ---
Building jar: /usr/home/igor/IdeaProjects/MavenProject/target/MavenProject-1.0-SNAPSHOT.jar
--- maven-install-plugin:2.4:install (default-install) @ MavenProject ---
Installing /usr/home/igor/IdeaProjects/MavenProject/target/MavenProject-1.0-SNAPSHOT.jar to /home/igor/.m2/repository/MavenProject/MavenProject/1.0-SNAPSHOT/MavenProject-1.0-SNAPSHOT.jar
Installing /usr/home/igor/IdeaProjects/MavenProject/pom.xml to /home/igor/.m2/repository/MavenProject/MavenProject/1.0-SNAPSHOT/MavenProject-1.0-SNAPSHOT.pom
------------------------------------------------------------------------
BUILD SUCCESS
------------------------------------------------------------------------
Total time: 2.477s
Finished at: Fri Jan 17 22:32:32 VOLT 2014
Final Memory: 14M/122M
------------------------------------------------------------------------
cd /usr/home/igor/IdeaProjects/MavenProject; JAVA_HOME=/usr/local/openjdk7 M2_HOME=/usr/home/igor/bin/apache-maven-3.1.1 /usr/home/igor/bin/apache-maven-3.1.1/bin/mvn "-Dexec.args=-classpath %classpath ru.vsprog.mavenproject.Main" -Dexec.executable=/usr/local/openjdk7/bin/java org.codehaus.mojo:exec-maven-plugin:1.2.1:exec
Running NetBeans Compile On Save execution. Phase execution is skipped and output directories of dependency projects (with Compile on Save turned on) will be used instead of their jar artifacts.
Scanning for projects...
------------------------------------------------------------------------
Building MavenProject 1.0-SNAPSHOT
------------------------------------------------------------------------
--- exec-maven-plugin:1.2.1:exec (default-cli) @ MavenProject ---
Hello World
------------------------------------------------------------------------
BUILD SUCCESS
------------------------------------------------------------------------
Total time: 0.839s
Finished at: Fri Jan 17 22:33:22 VOLT 2014
Final Memory: 5M/86M
------------------------------------------------------------------------