Thanks for the quick reply, Shane. For (2),
I use Maven 2.0.5. I have C:\Documents and Settings\Amol\.m2. Earlier, my local repository was at D:\mavenrepository. However, I have moved it to the normal location of ~\.m2\repository to prevent any issues with repository path being hard coded, similar to NMAVEN-51. That did not solve my problem. For (1), Running mvn install from it001 worked fine and the build was successful. Also, I created a simple pom.xml in an empty folder and the archetype command worked too. After fetching the plugin, the command worked in a completely empty folder too. Amol On 6/8/07, Shane Isbell <[EMAIL PROTECTED]> wrote:
Hi Amol, Thanks for being so thorough. The first issue you encountered of not resolving the archetype plugin is a bug in Maven. Unless the plugin exists in the central repo, it does not resolve unless you execute the plugin in a directory which has a pom.xml file. I had a similar problem with the vsisinstaller and addressed this issue: http://incubator.apache.org/nmaven/plugins/maven-vsinstaller-plugin/examples/install-from-remote-repo.html. I'll add some clearer documentation in the other parts of the site dealing with the archetypes. I'd like to separate your problem between 1) using NMaven w/o building and 2) building NMaven. To test (1), clean the local repo, goto the trunk\integration-tests\tests\it0001 directory and then type: mvn install -DinstallGacDependencies=true . Since you are beginning the process in a directory that contains a pom.xml file, you should be able to locate the dependencies in the remote repo. I will look into (2) further. I tried from my machine and did not encounter any problems. Which version of Maven are you using? Does the directory D:\Documents and Settings\Amol\.m2\ exist or is you nmaven-settings file somewhere else? Thanks Shane On 6/8/07, Amol Manjure <[EMAIL PROTECTED]> wrote: > > Shane, > > Here are the results of my testing. > > I already have the NMaven build setup so I deleted the NMaven and > org/apache/maven/dotnet folders from my local repository. I also > removed nmaven-settings.xml. > > As an aside, the NMaven build process does not generate > nmaven-settings.xml on my machine. I have a Windows XP Professional > SP2 box. > > Then, I tried creating a simple project as described. It failed with > the error below. > > <error> > C:\Temp\nmaven-test>mvn archetype:create -DgroupId=myGroupid > -DartifactId=myArtifactId > -DarchetypeArtifactId=maven-archetype-dotnet-simple > -DarchetypeGroupId= > org.apache.maven.dotnet -DarchetypeVersion=0.14-SNAPSHOT > [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] ************************************************************** > [INFO] Starting Jakarta Velocity v1.4 > [INFO] RuntimeInstance initializing. > [INFO] Default Properties File: > org\apache\velocity\runtime\defaults\velocity.properties > [INFO] Default ResourceManager initializing. (class > org.apache.velocity.runtime.resource.ResourceManagerImpl) > [INFO] Resource Loader Instantiated: > org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader > [INFO] ClasspathResourceLoader : initialization starting. > [INFO] ClasspathResourceLoader : initialization complete. > [INFO] ResourceCache : initialized. (class > org.apache.velocity.runtime.resource.ResourceCacheImpl) > [INFO] Default ResourceManager initialization complete. > [INFO] Loaded System Directive: > org.apache.velocity.runtime.directive.Literal > [INFO] Loaded System Directive: > org.apache.velocity.runtime.directive.Macro > [INFO] Loaded System Directive: > org.apache.velocity.runtime.directive.Parse > [INFO] Loaded System Directive: > org.apache.velocity.runtime.directive.Include > [INFO] Loaded System Directive: > org.apache.velocity.runtime.directive.Foreach > [INFO] Created: 20 parsers. > [INFO] Velocimacro : initialization starting. > [INFO] Velocimacro : adding VMs from VM library template : > VM_global_library.vm > [ERROR] ResourceManager : unable to find resource > 'VM_global_library.vm' in any resource loader. > [INFO] Velocimacro : error using VM library template > VM_global_library.vm : > org.apache.velocity.exception.ResourceNotFoundException: Unable to > find resource > 'VM_global_library.vm' > [INFO] Velocimacro : VM library template macro registration complete. > [INFO] Velocimacro : allowInline = true : VMs can be defined inline in > templates > [INFO] Velocimacro : allowInlineToOverride = false : VMs defined > inline may NOT replace previous VM definitions > [INFO] Velocimacro : allowInlineLocal = false : VMs defined inline > will be global in scope if allowed. > [INFO] Velocimacro : initialization complete. > [INFO] Velocity successfully started. > [INFO] [archetype:create] > [INFO] Defaulting package to group ID: myGroupid > [INFO] > ------------------------------------------------------------------------ > [ERROR] BUILD ERROR > [INFO] > ------------------------------------------------------------------------ > [INFO] Failed to resolve artifact. > > GroupId: org.apache.maven.dotnet > ArtifactId: maven-archetype-dotnet-simple > Version: 0.14-SNAPSHOT > > Reason: Unable to download the artifact from any repository > > Try downloading the file manually from the project website. > > Then, install it using the command: > mvn install:install-file -DgroupId=org.apache.maven.dotnet > -DartifactId=maven-archetype-dotnet-simple \ > -Dversion=0.14-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file > > > org.apache.maven.dotnet:maven-archetype-dotnet-simple:jar:0.14-SNAPSHOT > > from the specified remote repositories: > central (http://repo1.maven.org/maven2) > > > [INFO] > ------------------------------------------------------------------------ > [INFO] For more information, run Maven with the -e switch > [INFO] > ------------------------------------------------------------------------ > [INFO] Total time: 2 seconds > [INFO] Finished at: Fri Jun 08 13:05:46 IST 2007 > [INFO] Final Memory: 4M/8M > [INFO] > ------------------------------------------------------------------------ > </error> > > As you can see, the snapshot repository was never tried. I have > changed my settings.xml to refer to it but it did not work. Assuming > that it was some mistake in my settings, I worked around this by > building NMaven on my machine. This create the missing artifact and > command passed. > > However, the next step of mvn install -DinstallGacDependencies=true > failed. > > The error was > <error> > C:\Temp\nmaven-test\myArtifactId>mvn install -DinstallGacDependencies=true > [INFO] Scanning for projects... > [INFO] > ---------------------------------------------------------------------------- > [INFO] Building Unnamed - myGroupid:myArtifactId:library:1.0-SNAPSHOT > [INFO] task-segment: [install] > [INFO] > ---------------------------------------------------------------------------- > [INFO] [compile:initialize] > [INFO] Mojo Execution Time = 0 > [INFO] [resolver:resolve] > Downloading: > http://people.apache.org/repo/m2-snapshot-repository/NMaven/Plugins/NMaven.Plugin.Resx/0.14-SNAPSHOT/NMaven.Plugin.Resx-0.14-SNAPSHOT.exe.config > [WARNING] Unable to get resource > 'NMaven.Plugins:NMaven.Plugin.Resx:exe.config:0.14-SNAPSHOT' from > repository org.apache.people.repo (http://people.apache.org > /repo/m2-snapshot-repository) > Downloading: > http://people.apache.org/repo/m2-snapshot-repository/NMaven/Plugins/NMaven.Plugin.Resx/0.14-SNAPSHOT/NMaven.Plugin.Resx-0.14-SNAPSHOT.exe.config > [WARNING] Unable to get resource > 'NMaven.Plugins:NMaven.Plugin.Resx:exe.config:0.14-SNAPSHOT' from > repository apache.snapshots (http://people.apache.org/repo/ > m2-snapshot-repository) > [INFO] > ------------------------------------------------------------------------ > [ERROR] BUILD ERROR > [INFO] > ------------------------------------------------------------------------ > [INFO] Failed to resolve artifact. > > Missing: > ---------- > 1) NMaven.Plugins:NMaven.Plugin.Resx:exe.config:0.14-SNAPSHOT > > Try downloading the file manually from the project website. > > Then, install it using the command: > mvn install:install-file -DgroupId=NMaven.Plugins > -DartifactId=NMaven.Plugin.Resx \ > -Dversion=0.14-SNAPSHOT -Dpackaging=exe.config-Dfile=/path/to/file > > Path to dependency: > 1) myGroupid:myArtifactId:library:1.0-SNAPSHOT > 2) NMaven.Plugins:NMaven.Plugin.Resx:exe:0.14-SNAPSHOT > 3) NMaven.Plugins:NMaven.Plugin.Resx:exe.config:0.14-SNAPSHOT > > ---------- > 1 required artifact is missing. > > for artifact: > myGroupid:myArtifactId:library:1.0-SNAPSHOT > > from the specified remote repositories: > org.apache.people.repo ( > http://people.apache.org/repo/m2-snapshot-repository) > > > [INFO] > ------------------------------------------------------------------------ > [INFO] For more information, run Maven with the -e switch > [INFO] > ------------------------------------------------------------------------ > [INFO] Total time: 8 seconds > [INFO] Finished at: Fri Jun 08 13:10:58 IST 2007 > [INFO] Final Memory: 8M/15M > [INFO] > ------------------------------------------------------------------------ > > </error> > > Looks like the repository is missing a file. I copied the > NMaven.Plugin.Resx.exe.config to > NMaven.Plugin.Resx-0.14-SNAPSHOT.exe.config and ran mvn install again. > That failed too. > > The error was > <error> > C:\Temp\nmaven-test\myArtifactId>mvn install -DinstallGacDependencies=true > [INFO] Scanning for projects... > [INFO] > ---------------------------------------------------------------------------- > [INFO] Building Unnamed - myGroupid:myArtifactId:library:1.0-SNAPSHOT > [INFO] task-segment: [install] > [INFO] > ---------------------------------------------------------------------------- > [INFO] [compile:initialize] > [INFO] Mojo Execution Time = 15 > [INFO] [resolver:resolve] > [INFO] NMAVEN-1600-001: Found net dependencies: Number = 0 > Assembly successfully added to the cache > [INFO] NMAVEN-1600-004: Installed Assembly into GAC: Assembly = > > D:\mavenrepository\NMaven\Plugin\NMaven.Plugin\0.14-SNAPSHOT\NMaven.Plugin.dll, > Vendor = MICR > OSOFT > Assembly successfully added to the cache > [INFO] NMAVEN-1600-004: Installed Assembly into GAC: Assembly = > > D:\mavenrepository\NMaven\Model\NMaven.Model.Pom\0.14-SNAPSHOT\NMaven.Model.Pom.dll, > Vendor = > MICROSOFT > [INFO] Mojo Execution Time = 828 > [INFO] [NMaven.Plugin.Settings.JavaBinding:generate-settings] > NMAVEN: Start Process = 8/6/2007 1:13:28 PM > "parameterFile=C:\Temp\Plugin25064.xml" > > "assemblyFile=D:\mavenrepository\NMaven\Plugins\NMaven.Plugin.Settings\0.14-SNAPSHOT\NMaven.Plugin.Settings.dll" > "mojo > Name=NMaven.Plugin.Settings.SettingsGeneratorMojo" > > "startProcessAssembly=D:\mavenrepository\NMaven\Plugin\NMaven.Plugin.Loader\0.14-SNAPSHOT\NMaven.Plugin.Loa > der.exe" > NMAVEN: End Process = 8/6/2007 1:13:28 PM > Creating Plugin Domain Manager > ParamFile = C:\Temp\Plugin25064.xml, AssemblyFile = > > D:\mavenrepository\NMaven\Plugins\NMaven.Plugin.Settings\0.14-SNAPSHOT\NMaven.Plugin.Settings.dll, > MojoNam > e = NMaven.Plugin.Settings.SettingsGeneratorMojo > Loading Plugin: > D:\mavenrepository\NMaven\Plugins\NMaven.Plugin.Settings\0.14-SNAPSHOT > Creating Plugin Domain Manager > NMaven.Plugin.ExecutionException: NMAVEN-9011-007: Mono installation > could not be found. > at NMaven.Plugin.Settings.SettingsGeneratorMojo.GetVendorsForMono > (RegistryKey > monoRegistryKey, String defaultMonoCLR) > at NMaven.Plugin.Settings.SettingsGeneratorMojo.Execute() > NMaven.Plugin.ExecutionException: NMAVEN-9011-000: No CSCC_LIB_PATH Found > at NMaven.Plugin.Settings.SettingsGeneratorMojo.GetVendorForGnu(String > libPath) > at NMaven.Plugin.Settings.SettingsGeneratorMojo.Execute() > [ERROR] > [ERROR] Unhandled Exception: System.IO.DirectoryNotFoundException: > Could not find a part of the path 'D:\Documents and > Settings\Amol\.m2\nmaven-settings.xml'. > > [ERROR] at System.IO.__Error.WinIOError(Int32 errorCode, String > maybeFullPath) > [ERROR] at System.IO.FileStream.Init(String path, FileMode mode, > FileAccess access, Int32 rights, Boolean useRights, FileShare share, > Int32 bufferSize, Fil > eOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, > Boolean bFromProxy) > [ERROR] at System.IO.FileStream..ctor(String path, FileMode mode, > FileAccess access, FileShare share, Int32 bufferSize, FileOptions > options) > [ERROR] at System.IO.StreamWriter.CreateFile(String path, Boolean > append) > [ERROR] at System.IO.StreamWriter..ctor(String path, Boolean > append, Encoding encoding, Int32 bufferSize) > [ERROR] at System.IO.StreamWriter..ctor(String path) > [ERROR] at NMaven.Plugin.Settings.SettingsGeneratorMojo.Execute() > [ERROR] at NMaven.Plugin.AbstractMojo.Execute() > [ERROR] at NMaven.Plugin.Loader.PluginLoader.Main(String[] args) > [INFO] > ------------------------------------------------------------------------ > [ERROR] BUILD ERROR > [INFO] > ------------------------------------------------------------------------ > [INFO] NMAVEN-xxx-000 > > Embedded error: NMAVEN-063-000: Execution Path = > D:\mavenrepository\NMaven\Plugin\NMaven.Plugin.Runner\0.14-SNAPSHOT, > Command = [parameterFile=C:\Temp\Plugin2 > 5064.xml, > assemblyFile=D:\mavenrepository\NMaven\Plugins\NMaven.Plugin.Settings\0.14-SNAPSHOT\NMaven.Plugin.Settings.dll, > mojoName=NMaven.Plugin.Settings.Sett > ingsGeneratorMojo, > > startProcessAssembly=D:\mavenrepository\NMaven\Plugin\NMaven.Plugin.Loader\0.14-SNAPSHOT\NMaven.Plugin.Loader.exe] > NMAVEN-040-001: Could not execute: Command = NMaven.Plugin.Runner.exe > parameterFile=C:\Temp\Plugin25064.xml > assemblyFile=D:\mavenrepository\NMaven\Plugins\NMa > ven.Plugin.Settings\0.14-SNAPSHOT\NMaven.Plugin.Settings.dll > mojoName=NMaven.Plugin.Settings.SettingsGeneratorMojo > startProcessAssembly=D:\mavenrepository\NMa > ven\Plugin\NMaven.Plugin.Loader\0.14-SNAPSHOT\NMaven.Plugin.Loader.exe, > Result = 0 > [INFO] > ------------------------------------------------------------------------ > [INFO] For more information, run Maven with the -e switch > [INFO] > ------------------------------------------------------------------------ > [INFO] Total time: 1 minute 16 seconds > [INFO] Finished at: Fri Jun 08 13:14:35 IST 2007 > [INFO] Final Memory: 9M/17M > [INFO] > ------------------------------------------------------------------------ > </error> > > I restored nmaven-settings.xml and the build passed. > > Amol > > On 6/7/07, Shane Isbell <[EMAIL PROTECTED]> wrote: > > Looks as though using snapshots from a remote repo is working. If anyone > > want to test it out, read the following documentation: > > > > > http://incubator.apache.org/nmaven/getting-started.html#Using%20NMaven%20Without%20Building > > > > For Visual Studio Specific Setup: > > http://incubator.apache.org/nmaven/ide/visual-studio.html > > > http://incubator.apache.org/nmaven/plugins/maven-vsinstaller-plugin/usage.html > > > > If you have previously built NMaven, then it is a good idea to clean out > > your local repo first. > > > > Regards, > > Shane > > >
