I am trying to find out maven as soon as possible for my workplace. I found this great book that pretty much explains everything about maven.
I use eclipse to develop java, and I installed the maven eclipse plugin, there is an example in the book above (which may or may not be relevant) 4.2.1. Yahoo! Weather RSS .
The purpose of this example is to show how maven works a little harder by connecting to the yahoo weather rss server and getting relevant data from it.
What I'm fighting with, this line below, I manage to execute it from cmd (I use win-7)
mvn exec:java -Dexec.mainClass=org.sonatype.mavenbook.weather.Main
When I use a text editor and cmd, I first edit the files, and the second - to execute commands with maven. I do everything as in a book, everything works fine, but we work with eclipse, so I would like to learn how to do the same with eclipse.
How to do it from eclipse?
Here is an image of what I'm trying to run:
alt text http://postavi.com/hosted/bc0de2440ba2b5017a92672c721dcca1.gif
So, I go to the next screen:
alt text http://postavi.com/hosted/5c79320f64e850879d49823c4a6e2ecb.gif
I run it and I get this error:
Version: 1.1.1 Mojo: exec brought in via: Direct invocation While building project: Group-Id: org.sonatype.mavenbook.custom Artifact-Id: weather Version: 0.0.1-SNAPSHOT From file: C:\OPR-CS\weather\pom.xml Missing parameters include: executable [INFO] ------------------------------------------------------------------------ [INFO] For more information, run with the -e flag [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILED [INFO] ------------------------------------------------------------------------ [INFO] Total time: < 1 second [INFO] Finished at: Tue Feb 02 14:47:04 CET 2010 [INFO] Final Memory: 1M/7M [INFO] ------------------------------------------------------------------------
I assume that the corresponding parameters did not pass, since it says the error above.
-Dexec.mainClass=org.sonatype.mavenbook.weather.Main
This line is above. Because I do not know how to do this. Here is the pom.xml file, the same as in the book, slightly adjusted here:
<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/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>org.sonatype.mavenbook.custom</groupId> <artifactId>weather</artifactId> <packaging>jar</packaging> <version>0.0.1-SNAPSHOT</version> <name>weather</name> <url>http://maven.apache.org</url> <licenses> <license> <name>Apache 2</name> <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url> <distribution>repo</distribution> <comments>A business-friendly OSS license</comments> </license> </licenses> <organization> <name>ORIGIGI</name> <url>http://www.devs.com</url> </organization> <developers> <developer> <id>emco</id> <name>Myself and I</name> <email> devs@devs.com </email> <url>http://www.devs.com</url> <organization>ORIGIGI</organization> <organizationUrl>http://www.devs.com</organizationUrl> <roles> <role>developer</role> </roles> <timezone>-6</timezone> </developer> </developers> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.14</version> </dependency> <dependency> <groupId>dom4j</groupId> <artifactId>dom4j</artifactId> <version>1.6.1</version> </dependency> <dependency> <groupId>jaxen</groupId> <artifactId>jaxen</artifactId> <version>1.1.1</version> </dependency> <dependency> <groupId>velocity</groupId> <artifactId>velocity</artifactId> <version>1.5</version> </dependency> </dependencies> <build> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.5</source> <target>1.5</target> </configuration> </plugin> </plugins> </build> </project>
Can anyone help me? Thanks you