You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Sammaiah Nagapuri <Sa...@hcl.in> on 2009/08/14 12:09:58 UTC

beginner problem

Hi thanks for giving the prompt reply for my first question.

Here my another problem is If I run the normal command like 'mvn archetype:create' I am getting the following console output which is showing unable to create the project. See the following one.
I am running this command in offline mode as I don't have the internet connection.

F:\Ravi\sam>mvn archetype:create -DgroupId=org.sonatype.mavenbook.ch03 -DartifactId=simple -DpackageName=org.sonatype.mavenbook --offline
[INFO]
NOTE: Maven is executing in offline mode. Any artifacts not already in your local
repository will be inaccessible.

[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'archetype'.
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] The plugin 'org.apache.maven.plugins:maven-archetype-plugin' does not exist or no valid version could be found
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Fri Aug 14 14:57:41 GMT+05:30 2009
[INFO] Final Memory: 1M/2M
[INFO] ------------------------------------------------------------------------
F:\Ravi\sam>


Where as if I run this command differently while giving the settings.xml as an argument it is perfectly creating. What is the problem? Is there any other way to give this setting file as an argument like setting in classpath? But I have already mentioned in path but it is not resolving.

F:\Ravi\sam>mvn -Dorg.apache.maven.global-settings=.m2/settings.xml archetype:create -DgroupId=org.sonatype.mavenbook.ch03 -DartifactId=simple -Dpacka
geName=org.sonatype.mavenbook

[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'archetype'.
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Default Project
[INFO]    task-segment: [archetype:create] (aggregator-style)
[INFO] ------------------------------------------------------------------------
[INFO] Setting property: classpath.resource.loader.class => 'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'.
[INFO] Setting property: velocimacro.messages.on => 'false'.
[INFO] Setting property: resource.loader => 'classpath'.
[INFO] Setting property: resource.manager.logwhenfound => 'false'.
[INFO] [archetype:create]
[WARNING] This goal is deprecated. Please use mvn archetype:generate instead
[INFO] artifact org.apache.maven.archetypes:maven-archetype-quickstart: checking for updates from central
[INFO] ----------------------------------------------------------------------------
[INFO] Using following parameters for creating OldArchetype: maven-archetype-quickstart:RELEASE
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: groupId, Value: org.sonatype.mavenbook.ch03
[INFO] Parameter: packageName, Value: org.sonatype.mavenbook
[INFO] Parameter: basedir, Value: F:\Ravi\sam
[INFO] Parameter: package, Value: org.sonatype.mavenbook
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: artifactId, Value: simple
[INFO] ********************* End of debug info from resources from generated POM ***********************
[INFO] OldArchetype created in dir: F:\Ravi\sam\simple
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6 seconds
[INFO] Finished at: Fri Aug 14 14:40:57 GMT+05:30 2009
[INFO] Final Memory: 8M/15M
[INFO] ------------------------------------------------------------------------

Where as my .m2/settings.xml file is following one

<settings xmlns="http://maven.apache.org/settings/1.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
  <localRepository>/.m2/repository</localRepository>
  <offline>true</offline>
  <proxies>
            <proxy>
              <active>true</active>
      <protocol>http</protocol>
              <port>3128</port>
      <host>10.123.123.157</host>
            </proxy>
  </proxies>
  <servers>
  </servers>
  <mirrors>
  </mirrors>
  <profiles>
  </profiles>
</settings>

By seeing the above two stacktraces I come to know (The plugin 'org.apache.maven.plugins:maven-archetype-plugin' does not exist or no valid version could be found
) then why it is creating the project in second scenario ?

And one more thing is after successfully creating the project by giving the settings.xml file as an argument I tried to compile the project. Here it is raising some more problems.

F:\Ravi\sam>mvn compile --offline
[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 Maven Default Project
[INFO]    task-segment: [compile]
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

GroupId: org.apache.maven.plugins
ArtifactId: maven-resources-plugin
Version: 2.3

Reason: System is offline.

  org.apache.maven.plugins:maven-resources-plugin:pom:2.3




NOTE: Maven is executing in offline mode. Any artifacts not already in your local
repository will be inaccessible.


[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Fri Aug 14 15:05:43 GMT+05:30 2009
[INFO] Final Memory: 1M/2M
[INFO] ------------------------------------------------------------------------

So by seeing the above message I come to know some plugins are missing.
Is there any other way get that plugin?
Thanks & Regards
Sammaiah Nagapuri

P  We have a responsibility to the environment
Before printing this e-mail or any other document, let's ask ourselves whether we need a hard copy


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.

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

Re: beginner problem

Posted by Aleksey Didik <di...@magenta-technology.ru>.
Hello Sammaiah,

You have started maven in offline mode in first case. And maven wrote about it in log.

====
Reason: System is offline.

...

*NOTE: Maven is executing in offline mode. Any artifacts not already in your local
repository will be inaccessible.*

====

When you start maven firstly, it's download some parts of itself from net. But you have run it in oflline mode. You you have caught errors..

*--offline* - exclude this key from command line
 
and this tag *<offline>true</offline>* from settings.xml.

Be careful, use offline mode only if you are fully sure, that you have all what you need in your local repository, 

Aleksey. 




Sammaiah Nagapuri ?????:
> Hi thanks for giving the prompt reply for my first question.
>
> Here my another problem is If I run the normal command like 'mvn archetype:create' I am getting the following console output which is showing unable to create the project. See the following one.
> I am running this command in offline mode as I don't have the internet connection.
>
> F:\Ravi\sam>mvn archetype:create -DgroupId=org.sonatype.mavenbook.ch03 -DartifactId=simple -DpackageName=org.sonatype.mavenbook --offline
> [INFO]
> NOTE: Maven is executing in offline mode. Any artifacts not already in your local
> repository will be inaccessible.
>
> [INFO] Scanning for projects...
> [INFO] Searching repository for plugin with prefix: 'archetype'.
> [INFO] ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO] ------------------------------------------------------------------------
> [INFO] The plugin 'org.apache.maven.plugins:maven-archetype-plugin' does not exist or no valid version could be found
> [INFO] ------------------------------------------------------------------------
> [INFO] For more information, run Maven with the -e switch
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: < 1 second
> [INFO] Finished at: Fri Aug 14 14:57:41 GMT+05:30 2009
> [INFO] Final Memory: 1M/2M
> [INFO] ------------------------------------------------------------------------
> F:\Ravi\sam>
>
>
> Where as if I run this command differently while giving the settings.xml as an argument it is perfectly creating. What is the problem? Is there any other way to give this setting file as an argument like setting in classpath? But I have already mentioned in path but it is not resolving.
>
> F:\Ravi\sam>mvn -Dorg.apache.maven.global-settings=.m2/settings.xml archetype:create -DgroupId=org.sonatype.mavenbook.ch03 -DartifactId=simple -Dpacka
> geName=org.sonatype.mavenbook
>
> [INFO] Scanning for projects...
> [INFO] Searching repository for plugin with prefix: 'archetype'.
> [INFO] ------------------------------------------------------------------------
> [INFO] Building Maven Default Project
> [INFO]    task-segment: [archetype:create] (aggregator-style)
> [INFO] ------------------------------------------------------------------------
> [INFO] Setting property: classpath.resource.loader.class => 'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'.
> [INFO] Setting property: velocimacro.messages.on => 'false'.
> [INFO] Setting property: resource.loader => 'classpath'.
> [INFO] Setting property: resource.manager.logwhenfound => 'false'.
> [INFO] [archetype:create]
> [WARNING] This goal is deprecated. Please use mvn archetype:generate instead
> [INFO] artifact org.apache.maven.archetypes:maven-archetype-quickstart: checking for updates from central
> [INFO] ----------------------------------------------------------------------------
> [INFO] Using following parameters for creating OldArchetype: maven-archetype-quickstart:RELEASE
> [INFO] ----------------------------------------------------------------------------
> [INFO] Parameter: groupId, Value: org.sonatype.mavenbook.ch03
> [INFO] Parameter: packageName, Value: org.sonatype.mavenbook
> [INFO] Parameter: basedir, Value: F:\Ravi\sam
> [INFO] Parameter: package, Value: org.sonatype.mavenbook
> [INFO] Parameter: version, Value: 1.0-SNAPSHOT
> [INFO] Parameter: artifactId, Value: simple
> [INFO] ********************* End of debug info from resources from generated POM ***********************
> [INFO] OldArchetype created in dir: F:\Ravi\sam\simple
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD SUCCESSFUL
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 6 seconds
> [INFO] Finished at: Fri Aug 14 14:40:57 GMT+05:30 2009
> [INFO] Final Memory: 8M/15M
> [INFO] ------------------------------------------------------------------------
>
> Where as my .m2/settings.xml file is following one
>
> <settings xmlns="http://maven.apache.org/settings/1.0.0"
>           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>           xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
>   <localRepository>/.m2/repository</localRepository>
>   <offline>true</offline>
>   <proxies>
>             <proxy>
>               <active>true</active>
>       <protocol>http</protocol>
>               <port>3128</port>
>       <host>10.123.123.157</host>
>             </proxy>
>   </proxies>
>   <servers>
>   </servers>
>   <mirrors>
>   </mirrors>
>   <profiles>
>   </profiles>
> </settings>
>
> By seeing the above two stacktraces I come to know (The plugin 'org.apache.maven.plugins:maven-archetype-plugin' does not exist or no valid version could be found
> ) then why it is creating the project in second scenario ?
>
> And one more thing is after successfully creating the project by giving the settings.xml file as an argument I tried to compile the project. Here it is raising some more problems.
>
> F:\Ravi\sam>mvn compile --offline
> [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 Maven Default Project
> [INFO]    task-segment: [compile]
> [INFO] ------------------------------------------------------------------------
> [INFO] ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO] ------------------------------------------------------------------------
> [INFO] Failed to resolve artifact.
>
> GroupId: org.apache.maven.plugins
> ArtifactId: maven-resources-plugin
> Version: 2.3
>
> Reason: System is offline.
>
>   org.apache.maven.plugins:maven-resources-plugin:pom:2.3
>
>
>
>
> NOTE: Maven is executing in offline mode. Any artifacts not already in your local
> repository will be inaccessible.
>
>
> [INFO] ------------------------------------------------------------------------
> [INFO] For more information, run Maven with the -e switch
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: < 1 second
> [INFO] Finished at: Fri Aug 14 15:05:43 GMT+05:30 2009
> [INFO] Final Memory: 1M/2M
> [INFO] ------------------------------------------------------------------------
>
> So by seeing the above message I come to know some plugins are missing.
> Is there any other way get that plugin?
> Thanks & Regards
> Sammaiah Nagapuri
>
> P  We have a responsibility to the environment
> Before printing this e-mail or any other document, let's ask ourselves whether we need a hard copy
>
>
> 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.
>
> -----------------------------------------------------------------------------------------------------------------------
>
>