Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to work with maven

 
yatin shinde
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
I am just started to learn maven. i download binaries and install properly.
Now using maven documentation i am tring to create 1st maven project
AS mention in document i type foll. command on command prompt
mvn archetype:create -DarchetypeGroupId=org.apache.maven.archetypes -DgroupId=com.mycompany.app -DartifactId=my-app

but Nothing happel It gives me foll. ERROR
maven.archetypes -DgroupId=com.mycompany.app -DartifactId=my-app
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'archetype'.
[INFO] artifact org.apache.maven.plugins:maven-archetype-plugin: checking for up
dates from central
[WARNING] repository metadata for: 'artifact org.apache.maven.plugins:maven-arch
etype-plugin' could not be retrieved from repository: central due to an error: E
rror transferring file
[INFO] Repository 'central' will be blacklisted
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] The plugin 'org.apache.maven.plugins:maven-archetype-plugin' does not exi
st or no valid version could be found
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 15 seconds
[INFO] Finished at: Wed Mar 12 14:23:36 GMT+05:30 2008
[INFO] Final Memory: 1M/254M
[INFO] ------------------------------------------------------------------------

I am search on net it tell me that i am working across firewall that why i'll get that ERROR i am tyring to configure proxi in setting.xml butstll it not work

Anybody know how to solve this problem. Please help me......:-(
 
Srikanth Nittala
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It appears that Maven is unable to bring the required files/jars from its remote repository which is obviously on the internet. I am almost positive that you have a firewall thats blocking this file transfer. So go to the ${User.home}/.m2 directory and create a settings.xml file with the following entry in it: You will have to fill in the appropriate values for your proxy settings.

<settings>
<proxies>
<proxy>
<active>true</active>
<protocol>http</protocol>
<host>proxy.mycompany.com</host>
<port>8080</port>
<username>your-username</username>
<password>your-password</password>
</proxy>
</proxies>
</settings>
 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why is that we need to connect to repositories when using Maven?

This looks like a limitation that we need an internet connection to use Maven. Does'nt it?
[ May 05, 2008: Message edited by: Jothi Shankar Kumar Sankararaj ]
 
Tim Holloway
Saloon Keeper
Posts: 18367
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't HAVE to be connected to the Internet, but it seriously helps.

One of Maven's major selling points is that it's designed for very large projects that are being worked on concurrently by a lot of people who may or may not be closely working with each other and who want to avoid re-inventing existing Java functions.

As sort of a side-effect, you can transfer a Maven project from one user to another using a fairly small amount of data and the proper build environment will then automatically be filled in when the next user runs Maven. As an example, I just emailed a 125K ZIP file to someone last night. When a Maven build is run against it, the final results are over 30MB and the program should have completely built itself without any user modifications or manual setup.

Maven is designed with the idea that much of the value of a project comes from libraries such as the Spring Framework jars. These libraries can come from a multititude of locations, and appear in multiple versions, but by establishing Maven Repositories, the task of keeping them all co-ordinated is simplified. There's only one place to go to find them all and there's only a limited number of fixed releases, so you don't have to worry about stealth changes to critical external functions interfering with your work.

However, they do realize that it's not always convenient to hit the Internet for everything. One way to reduce traffic is to set up a Maven Repository mirror. The mirror can be differentially maintained using rsync. Another thing that reduces traffic is that maven will automatically set up a local cache of items your projects are using so they only have to be downloaded once to your machine (or network share).

If you already have everything you need, you can speed up the build process slightly by running Maven with the "-o" (offline) switch. It doesn't make a major difference, but when you are sure you won't be needing to downloading any more packages, it's a slight improvement.
 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good information. Thanks!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic