maven example issue

Hi,

I am trying to build simple maven web application from the link below

http://viralpatel.net/blogs/generate-dynamic-web-project-maven-eclipse-wtp/


I am getting the error as attached. not sure what i am missing.

I read mavenis very simple to use but i feel hard time in setting up various things and to make simple web application run in eclipse tomcat on my windows laptop.


(i did set up of maven as below
http://howtodoinjava.com/2013/01/02/how-to-install-maven-on-windows-7/

i do not have admin privilege on my laptop so i have to go two levels deep in user settings through control panel...Control Panel\User Accounts\User Accounts then left side 'change my environment variables' to add the MAVEN_HOME)
Can you please advise good links, tutorials to get started easily with maven.
I tried below example also
http://www.mkyong.com/maven/how-to-create-a-java-project-with-maven/

I am getting errors like below

[WARNING] Could not transfer metadata org.apache.maven.plugins/maven-metadata.x
l from/to central (http://repo.maven.apache.org/maven2): Connection to http://r
po.maven.apache.org refused
[WARNING] Could not transfer metadata org.codehaus.mojo/maven-metadata.xml from
to central (http://repo.maven.apache.org/maven2): Connection to http://repo.mav
n.apache.org refused
[WARNING] Failure to transfer org.apache.maven.plugins/maven-metadata.xml from
ttp://repo.maven.apache.org/maven2 was cached in the local repository, resoluti
n will not be reattempted until the update interval of central has elapsed or u
dates are forced. Original error: Could not transfer metadata org.apache.maven.
lugins/maven-metadata.xml from/to central (http://repo.maven.apache.org/maven2)
 Connection to http://repo.maven.apache.org refused
[WARNING] Failure to transfer org.codehaus.mojo/maven-metadata.xml from http://
epo.maven.apache.org/maven2 was cached in the local repository, resolution will
not be reattempted until the update interval of central has elapsed or updates
re forced. Original error: Could not transfer metadata org.codehaus.mojo/maven-
etadata.xml from/to central (http://repo.maven.apache.org/maven2): Connection t
 http://repo.maven.apache.org refused
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6:18.910s
[INFO] Finished at: Tue Sep 24 17:11:46 EDT 2013
[INFO] Final Memory: 3M/121M
[INFO] ------------------------------------------------------------------------
No plugin found for prefix 'archetype' in the current project and in th
 plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the
repositories [local (C:\Users\i070220\.m2\repository), central (http://repo.mav
n.apache.org/maven2)] -> [Help 1]
To see the full stack trace of the errors, re-run Maven with the -e swi
ch.
Re-run Maven using the -X switch to enable full debug logging.
For more information about the errors and possible solutions, please re
d the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoPluginFound
orPrefixException
C:\Users\i070220\mavenTests>


i TRIED SAME EXAMPLE on one other laptop getting below error.
http://www.mkyong.com/maven/how-to-create-a-java-project-with-maven/

C:\mavenTest\NumberGenerator>mvn package
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building NumberGenerator 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ NumberGene
rator ---
[debug] execute contextualize
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources,
i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\mavenTest\NumberGenerator\src\main
\resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ NumberGenerat
or ---
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. b
uild is platform dependent!
[INFO] Compiling 1 source file to C:\mavenTest\NumberGenerator\target\classes
[INFO] -------------------------------------------------------------
COMPILATION ERROR :
[INFO] -------------------------------------------------------------
Unable to locate the Javac Compiler in:
  C:\Program Files\Java\jdk1.7.0_02\..\lib\tools.jar
Please ensure you are using JDK 1.4 or above and
not a JRE (the com.sun.tools.javac.Main class is required).
In most cases you can change the location of your Java
installation by setting the JAVA_HOME environment variable.
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.192s
[INFO] Finished at: Tue Sep 24 23:19:23 EDT 2013
[INFO] Final Memory: 7M/119M
[INFO] ------------------------------------------------------------------------
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.
3.2:compile (default-compile) on project NumberGenerator: Compilation failure
Unable to locate the Javac Compiler in:
C:\Program Files\Java\jdk1.7.0_02\..\lib\tools.jar
Please ensure you are using JDK 1.4 or above and
not a JRE (the com.sun.tools.javac.Main class is required).
In most cases you can change the location of your Java
installation by setting the JAVA_HOME environment variable.
-> [Help 1]
To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
Re-run Maven using the -X switch to enable full debug logging.
For more information about the errors and possible solutions, please rea
d the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureExc
eption
C:\mavenTest\NumberGenerator>



Please advise.


Any links resources ideas highly appreciated. Thanks in advance
ErrorMsg.jpg
LVL 7
gudii9Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

gudii9Author Commented:
I changed pom entry from 2.3.2 to 3.0.4


<version>3.0.4</version>

now getting below error

C:\mavenTest\NumberGenerator>mvn eclipse:eclipse
[INFO] Scanning for projects...
[WARNING] The POM for org.apache.maven.plugins:maven-compiler-plugin:jar:3.0.4 i
s missing, no dependency information available
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:mave
n-compiler-plugin:3.0.4: Plugin org.apache.maven.plugins:maven-compiler-plugin:3
.0.4 or one of its dependencies could not be resolved: Failed to read artifact d
escriptor for org.apache.maven.plugins:maven-compiler-plugin:jar:3.0.4
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building NumberGenerator 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for org.apache.maven.plugins:maven-compiler-plugin:jar:3.0.4 i
s missing, no dependency information available
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:mave
n-compiler-plugin:3.0.4: Plugin org.apache.maven.plugins:maven-compiler-plugin:3
.0.4 or one of its dependencies could not be resolved: Failed to read artifact d
escriptor for org.apache.maven.plugins:maven-compiler-plugin:jar:3.0.4
[INFO]
[INFO] >>> maven-eclipse-plugin:2.9:eclipse (default-cli) @ NumberGenerator >>>
[INFO]
[INFO] <<< maven-eclipse-plugin:2.9:eclipse (default-cli) @ NumberGenerator <<<
[INFO]
[INFO] --- maven-eclipse-plugin:2.9:eclipse (default-cli) @ NumberGenerator ---
[INFO] Using Eclipse Workspace: null
[INFO] Adding default classpath container: org.eclipse.jdt.launching.JRE_CONTAIN
ER
[INFO] File C:\mavenTest\NumberGenerator\.project already exists.
       Additional settings will be preserved, run mvn eclipse:clean if you want
old settings to be removed.
[INFO] Wrote Eclipse project for "NumberGenerator" to C:\mavenTest\NumberGenerat
or.
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.889s
[INFO] Finished at: Tue Sep 24 23:23:12 EDT 2013
[INFO] Final Memory: 11M/150M
[INFO] ------------------------------------------------------------------------
C:\mavenTest\NumberGenerator>mvn package
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building NumberGenerator 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for org.apache.maven.plugins:maven-compiler-plugin:jar:3.0.4 i
s missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.207s
[INFO] Finished at: Tue Sep 24 23:23:23 EDT 2013
[INFO] Final Memory: 6M/119M
[INFO] ------------------------------------------------------------------------
Plugin org.apache.maven.plugins:maven-compiler-plugin:3.0.4 or one of it
s dependencies could not be resolved: Failed to read artifact descriptor for org
.apache.maven.plugins:maven-compiler-plugin:jar:3.0.4: Failure to find org.apach
e.maven.plugins:maven-compiler-plugin:pom:3.0.4 in http://repo.maven.apache.org/
maven2 was cached in the local repository, resolution will not be reattempted un
til the update interval of central has elapsed or updates are forced -> [Help 1]

To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
Re-run Maven using the -X switch to enable full debug logging.
For more information about the errors and possible solutions, please rea
d the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResoluti
onException
C:\mavenTest\NumberGenerator>x`
0
Sharon SethCommented:
I think you would also need to get maven jars for 3.0.4
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java EE

From novice to tech pro — start learning today.