Sammaiah Nagapuri wrote:
Hi to all,
I have small doubt. In my office I don't have internet access except outlook 
for web mail. In my room I have the net connection to my laptop. So I 
configured there and here in office maven.
Initially I run the command 'mvn install' in my laptop (which is having net 
connection). So it downloaded some plugins with structure i.e. 
./m2/repository/.. . I copied that total structure to my office system.

That is good solution to the problem.

There I am trying to run 'mvn compile' or 'mvn test'. But here it is trying to 
connect the remote repository.
Why it is connection to remote repository once again even though it downloaded 
already some of the plugins.

Maven's default behaviour is to check to see if any plugins or dependencies are updated.

 1.  How to avoid this?

Use the -o flag to force Maven to run offline. For example:
mvn -o clean install

 2.  What are the other configurations I have to do?

None.

 3.  How to connect my local repository?

It is used automatically. Just make sure that your copied .m2 directory is in the correct place, a subdirectory of your home directory e.g

Windows XP:
C:\Documents and Settings\%USERNAME%\.m2

Linux:
$HOME/.m2

($HOME is your home directory).

 4.  If it is related to settings.xml can anybody send me the basic 
settings.xml which is configured to connect local repository. And mention me 
which settings file as I saw there are two settings files.

Not needed.

 5.  After doing some configurations is it necessary to put the settings.xml in 
classpath?

No. settings.xml lives in the .m2 directory. If Maven needs it, it will find it there. It is not related to the classpath.

 6.  And my last doubt is while we executing 'mvn install' phase whether it 
will download the plugins related to compile and testing etc plugins?

If running in offline mode, any plugin that has not been downloaded will not be available. If you have already run "mvn install" in online mode before copying your repository, then you already have the compile and test phase plugins in your repository. I think they are probably shipped with Maven anyway, so it should not be a problem.

Please don't think these are very simple questions. As a beginner i am unable 
to move forward without getting the answers to these questions?
Advanced thanks.

You are welcome.

--
Ben Caradoc-Davies <[email protected]>
Software Engineer, CSIRO Exploration and Mining
Australian Resources Research Centre
26 Dick Perry Ave, Kensington WA 6151, Australia

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to