This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Ant, Maven and Other Build Tools and the fly likes Maven and POM file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Maven and POM file" Watch "Maven and POM file" New topic
Author

Maven and POM file

Varnam Aayiram
Ranch Hand

Joined: Dec 23, 2008
Posts: 88
Hi guys,

I have some issues with Maven. Here is what I did:

1. Placed the apache-maven-3.0.3 folder in C:\dev

2. Created a JAVA_HOME System Variable
- variable value = C:\Program Files\Java\jdk1.6.0_25


3. Created an M2_HOME System Variable
- variable value = C:\dev\apache-maven-3.0.3

4. Added %JAVA_HOME%\bin;%M2_HOME%\bin; to System Path

5. I ran the following in the command prompt:
- C:\Documents and Settings\MyName> mvn clean

6. I get a 'Build Failure' message that basically says I have no POM in this directory.


True enough I have no POM file in the 'C:\Documents and Settings\MyName>' directory, but does anyone actually have a POM file in this directory? Also I checked out the '.m2' folder created in the following location: 'C:\Documents and Settings\MyName\.m2\repository' it's empty. Am I doing something wrong? Hope someone can advise. Thanks.

regards
glisando



Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29287
    
140

Where is your POM file located? It needs to be somewhere. (or checked out from a repository)


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Varnam Aayiram
Ranch Hand

Joined: Dec 23, 2008
Posts: 88
Hi Jeanne Boyarsky ,

I did a search on my C drive and found 7 POM files. Their locations are as follow:

1. C:\Program Files\NetBeans 7.0\java\modules\ext\maven

2. C:\Documents and Settings\MyName\.jenkins\war\META-INF\maven\org.jenkins-ci.main\jenkins-war

3. C:\Documents and Settings\MyName\.jenkins\plugins\cvs\META-INF\maven\org.jvnet.hudson.plugins\cvs

4. C:\Documents and Settings\MyName\.jenkins\plugins\maven-plugin\META-INF\maven\org.jenkins-ci.main\maven-plugin

5. C:\Documents and Settings\MyName\.jenkins\plugins\ssh-slaves\META-INF\maven\org.jvnet.hudson.plugins\ssh-slaves

6. C:\Documents and Settings\MyName\.jenkins\plugins\subversion\META-INF\maven\org.jvnet.hudson.plugins\subversion

7. C:\Program Files\glassfish-3.1\glassfish\lib\install\applications\__admingui\META-INF\maven\org.glassfish.admingui\war

What should I do? Am I to move one of them to the desktop, won't I be breaking anything if I do that? Hope somone can advise. Thanks.

regards
glisando
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9243
    
    1

Varnam Aayiram wrote:Hi guys,

I have some issues with Maven. Here is what I did:

1. Placed the apache-maven-3.0.3 folder in C:\dev

2. Created a JAVA_HOME System Variable
- variable value = C:\Program Files\Java\jdk1.6.0_25


3. Created an M2_HOME System Variable
- variable value = C:\dev\apache-maven-3.0.3

4. Added %JAVA_HOME%\bin;%M2_HOME%\bin; to System Path

5. I ran the following in the command prompt:
- C:\Documents and Settings\MyName> mvn clean

6. I get a 'Build Failure' message that basically says I have no POM in this directory.


True enough I have no POM file in the 'C:\Documents and Settings\MyName>' directory, but does anyone actually have a POM file in this directory? Also I checked out the '.m2' folder created in the following location: 'C:\Documents and Settings\MyName\.m2\repository' it's empty. Am I doing something wrong? Hope someone can advise. Thanks.

regards
glisando





What do you expect Maven to do when you run mvn clean at C:\Documents and Settings\MyNam? Do you have a Maven project at this location? If not, then Maven is doing the right thing by letting you know that there is no project at this location or rather no pom in this location.


SCJP 1.4, SCWCD 1.4 - Hints for you, SCBCD Hints - Demnachst, SCDJWS - Auch Demnachst
Did a rm -R / to find out that I lost my entire Linux installation!
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5779
    
    7

Sounds like you need to read the getting started guide:
http://maven.apache.org/guides/getting-started/index.html

After that, the complete reference guide will come in handy:
http://www.sonatype.com/people/2010/11/maven-the-complete-reference/


JBoss In Action
Tinh T. Dinh
Greenhorn

Joined: Jun 09, 2011
Posts: 1

Peter Johnson wrote:Sounds like you need to read the getting started guide:
http://maven.apache.org/guides/getting-started/index.html

After that, the complete reference guide will come in handy:
http://www.sonatype.com/people/2010/11/maven-the-complete-reference/


Add another more very good tutorial site with full topic for beginners need quick start:
http://www.mkyong.com/tutorials/maven-tutorials/
And <optional> try m2eclipse on Eclipse IDE for beginners painful to create pom file <- be careful, maybe confuse ->:
http://m2eclipse.sonatype.org/
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Maven and POM file
 
Similar Threads
Eclipse 3.2 not be able to see MAVEN plug in at all
Maven Setup
Maven Plugin for Eclipse Helios
Trouble with running Maven Tomcat plugin through Eclipse
Calling maven from ProcessBuilder