Hi Ben Caradoc,

Now I am running with 'mvn compile -e' as well as with 'mvn compile -e' command 
from the project where the pom file exists.

From the stacktrace I come to know two important things like

1. the problem with pom as it is showing like '[INFO] Error building POM (may 
not be this project's POM)'.
2. problem with version as it is showing like ' Not a v4.0.0 POM. for project 
org.apache.maven.plugins:maven-resources-plugin at C:\Documents and 
Settings\sammaiah.nagapuri\.m2\repository\org
\apache\maven\plugins\maven-resources-plugin\2.3\maven-resources-plugin-2.3.pom'

The error message is 

C:\Documents and Settings\sammaiah.nagapuri\simple-weather>mvn -o compile -e
+ Error stacktraces are turned on.
[INFO]
NOTE: Maven is executing in offline mode. Any artifacts not already in your 
local
repository will be inaccessible.

[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building simple-weather
[INFO]    task-segment: [compile]
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).


Project ID: org.apache.maven.plugins:maven-resources-plugin
POM Location: C:\Documents and 
Settings\sammaiah.nagapuri\.m2\repository\org\apache\maven\plugins\maven-resources-plugin\2.3\maven-resources-plugin-2.3
.pom

Reason: Not a v4.0.0 POM. for project 
org.apache.maven.plugins:maven-resources-plugin at C:\Documents and 
Settings\sammaiah.nagapuri\.m2\repository\org
\apache\maven\plugins\maven-resources-plugin\2.3\maven-resources-plugin-2.3.pom


[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Unable to build project 
for plugin 'org.apache.maven.plugins:maven-resources-plugin': Not a v4.
0.0 POM. for project org.apache.maven.plugins:maven-resources-plugin at 
C:\Documents and Settings\sammaiah.nagapuri\.m2\repository\org\apache\maven\plu
gins\maven-resources-plugin\2.3\maven-resources-plugin-2.3.pom
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.verifyPlugin(DefaultLifecycleExecutor.java:1534)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.getMojoDescriptor(DefaultLifecycleExecutor.java:1786)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.bindLifecycleForPackaging(DefaultLifecycleExecutor.java:1274)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.constructLifecycleMappings(DefaultLifecycleExecutor.java:1238)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:518)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:356)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.InvalidPluginException: Unable to build 
project for plugin 'org.apache.maven.plugins:maven-resources-plugin': Not a
v4.0.0 POM. for project org.apache.maven.plugins:maven-resources-plugin at 
C:\Documents and Settings\sammaiah.nagapuri\.m2\repository\org\apache\maven\
plugins\maven-resources-plugin\2.3\maven-resources-plugin-2.3.pom
        at 
org.apache.maven.plugin.DefaultPluginManager.checkRequiredMavenVersion(DefaultPluginManager.java:286)
        at 
org.apache.maven.plugin.DefaultPluginManager.verifyVersionedPlugin(DefaultPluginManager.java:198)
        at 
org.apache.maven.plugin.DefaultPluginManager.verifyPlugin(DefaultPluginManager.java:177)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.verifyPlugin(DefaultLifecycleExecutor.java:1517)
        ... 18 more
Caused by: org.apache.maven.project.InvalidProjectModelException: Not a v4.0.0 
POM. for project org.apache.maven.plugins:maven-resources-plugin at C:\D
ocuments and 
Settings\sammaiah.nagapuri\.m2\repository\org\apache\maven\plugins\maven-resources-plugin\2.3\maven-resources-plugin-2.3.pom
        at 
org.apache.maven.project.DefaultMavenProjectBuilder.readModel(DefaultMavenProjectBuilder.java:1609)
        at 
org.apache.maven.project.DefaultMavenProjectBuilder.readModel(DefaultMavenProjectBuilder.java:1581)
        at 
org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:562)
        at 
org.apache.maven.project.DefaultMavenProjectBuilder.buildFromRepository(DefaultMavenProjectBuilder.java:251)
        at 
org.apache.maven.plugin.DefaultPluginManager.checkRequiredMavenVersion(DefaultPluginManager.java:270)
        ... 21 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Wed Aug 19 14:06:34 GMT+05:30 2009
[INFO] Final Memory: 1M/2M
[INFO] ------------------------------------------------------------------------
C:\Documents and Settings\sammaiah.nagapuri\simple-weather>


Coming to my pom file is 
--------------------------

<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.ch04</groupId>
  <artifactId>simple-weather</artifactId>
  <packaging>jar</packaging>
  <version>1.0</version>
  <name>simple-weather</name>
  <url>http://maven.apache.org</url>
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
</project>

Just give me some suggestion.



Thanks & Regards
Sammaiah Nagapuri
"Inaction breeds doubt and fear. Action breeds confidence and courage. If you 
want to conquer fear, do not sit home and think about it. Go out and get busy."


-----Original Message-----
From: Ben Caradoc-Davies [mailto:[email protected]] 
Sent: Wednesday, August 19, 2009 12:31 PM
To: Maven Users List
Subject: Re: basic doubts

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]


DISCLAIMER:
-----------------------------------------------------------------------------------------------------------------------

The contents of this e-mail and any attachment(s) are confidential and intended 
for the named recipient(s) only. 
It shall not attach any liability on the originator or HCL or its affiliates. 
Any views or opinions presented in 
this email are solely those of the author and may not necessarily reflect the 
opinions of HCL or its affiliates. 
Any form of reproduction, dissemination, copying, disclosure, modification, 
distribution and / or publication of 
this message without the prior written consent of the author of this e-mail is 
strictly prohibited. If you have 
received this email in error please delete it and notify the sender 
immediately. Before opening any mail and 
attachments please check them for viruses and defect.

-----------------------------------------------------------------------------------------------------------------------

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

Reply via email to