Re: Maven 2.0.9 - internal repository - archetype plugin version

2009-01-19 Thread Ross B


Hi Michael,
 
Many thanks for your reply - You were correct about the metadata. I've since 
managed to convince my organisation to give me an environment that has internet 
access and which can support a repository manager (Nexus). I'm now using the 
cached version of the repository created by Nexus and then using it again to 
serve this cache in the corporate network as a hosted repository and it seems 
to work great.
 
Thanks for your assistance and my apologies to the list for the double post.
 
Kind Regards,
 
Ross.
 

 
I may be talking out a hole but check this out...The release version along 
with version range information comes from metadata... if you createdyour 
internal repository in a way other than using the deploy plugin then you won't 
have metadata.If you are copying your local repository aka the artifact cache 
then you don't have 'maven-metadata.xml'in the correct place. you have cache 
copies of the metadata named central-maven-metadata.xml...if you only used 
central to build your local cache then you could just rename 
centra-maven-metadata...or you could just use a repository manager given you 
seem to have the requirement for it.hope that helps..
_
Cut through the jargon: find a PC for your needs.
http://clk.atdmt.com/UKM/go/130777504/direct/01/

Maven 2.0.9 - internal repository - archetype plugin version help

2009-01-18 Thread Ross B

 
Hello,

 
I'm having difficulties getting the maven-archetype-plug-in to work with an 
internal repository. The problem seems to be that it cannot locate the RELEASE 
version of this plugin when given an internal repository. I've copied the error 
I get to the end of this email together with my settings.xml file. I have tried 
various configurations and workarounds. I have maven configured to 
mirrorOf*/mirrorOf which points to my internal repo and I have tried 
combining this with a profile that uses this mirror for a pluginRepository to 
no avail. The only workaround which works for me is to specify the fully 
qualified archetype command which locks down the version of both the archetype 
plugin and the archetype rather than using the metadata to determine the 
RELEASE versions:
 
e.g.
 
mvn org.apache.maven.plugins:maven-archetype-plugin:2.0-alpha-4:create 
-DartifactId=new-proj -DgroupId=org.mycompany -DpackageId=org.mycompany 
-DarchetypeVersion=1.0
 
This is executed in a directory that does not have a pom.xml file. I can get 
the list of available archetypes from the generate goal if I execute mvn 
archetype:generate in a directory that has a pom.xml, which defines the plugin 
and its version as a build dependency, but then it bombs out when I select an 
archetype because it cannot find the RELEASE version of that archetype (even 
though it exists in the internal repo).
 
Now, as far as I can see, the metadata in my internal repository matches the 
metadata in central so I'm struggling to see what's going wrong. I should note 
that my internal repository is generated by running the archetype and other 
plugins in an environment with access to central and then I copy the local repo 
from .m2 into another folder which acts as an internal repository. Does this 
method not provide appropriate metadata, or is Maven for some reason always 
going to Central to determine the release version of this plugin?  I should 
note that I have also tried the -DremoteRepositories=file://local-repo-dir 
flag but this doesn't seem to have much effect.
 
This behavior is consistent in Maven 2.0.9/Archetype plugin 2.0-alpha-4 and 
Maven 2.1.0-M1. I have read various FAQs and bug reports about this being fixed 
but I'm still having difficulties so I'd be grateful for some suggestions or a 
working configuration.
 
Here's the config I've tried thus far:
 
My settings.xml (I get the same failure case when the profile is switched off 
or commented and have tried both direct/indirect urls in the profile repository 
url's):
 
mirror  idmirrorId/id  mirrorOf*/mirrorOf  nameHuman 
Readable Name for this Mirror./name
urlfile://C:/local-repo-dir/url
/mirror
 
profile  idinternal-repo/id  repositoriesrepository   
idcentral-repo/id   urlhttp://dummy-url/url   
!-- urlfile:///C:/local-repo-dir/url --   releases
   enabledtrue/enabled   updatePolicy/   
checksumPolicy/   /releases   snapshots  
enabledtrue/enabled  updatePolicy/  
checksumPolicy/   /snapshots   layout/ 
/repository  /repositoriespluginRepositories   
pluginRepository idcentral-plugin-repo/id  
urlhttp://dummy-url/url   !-- 
urlfile:///C:/local-repo-dir/url --   releases
enabledtrue/enabledupdatePolicy/
checksumPolicy/   /releases   snapshots
enabledtrue/enabledupdatePolicy/
checksumPolicy//snapshots layout/   
/pluginRepository  /pluginRepositories/profile   
 
Here's the error:
 
--
 
[INFO] Scanning for projects...[INFO] Searching repository for plugin with 
prefix: 'archetype'.[DEBUG] Loading plugin prefixes from group: 
org.apache.maven.plugins[INFO] org.apache.maven.plugins: checking for updates 
from central-plugin-repo[DEBUG] repository metadata for: 
'org.apache.maven.plugins' could not be found on repository: 
central-plugin-repo[INFO] org.apache.maven.plugins: checking for updates from 
central[DEBUG] repository metadata for: 'org.apache.maven.plugins' could not be 
found on repository: central[DEBUG] Loading plugin prefixes from group: 
org.codehaus.mojo[INFO] org.codehaus.mojo: checking for updates from 
central-plugin-repo[DEBUG] repository metadata for: 'org.codehaus.mojo' could 
not be found on repository: central-plugin-repo[INFO] org.codehaus.mojo: 
checking for updates from central[DEBUG] repository metadata for: 
'org.codehaus.mojo' could not be found on repository: central[INFO] artifact 
org.apache.maven.plugins:maven-archetype-plugin: checking for updates from 
central-plugin-repo[DEBUG] repository metadata for: 'artifact 
org.apache.maven.plugins:maven-archetype-plugin' could not be found on 
repository: central-plugin-repo[INFO] 

Maven 2.0.9 - local repository - archetype plugin

2009-01-18 Thread Ross B
Hello,

I'm having difficulties getting the maven-archetype-plug-in to work with a 
local repository. The problem seems to be that it cannot locate the RELEASE 
version of this plugin when given a local repository. I've copied the error I 
get to the end of this email together with my settings.xml file. I have tried 
various configurations and workarounds. I have maven configured to 
mirrorOf*/mirrorOf which points to my local repo and I have tried combining 
this with a profile that uses this mirror for a pluginRepository to no avail. 
The only workaround which works for me is to specify the fully qualified 
archetype command which locks down the version of both the archetype plugin and 
the archetype rather than using the metadata to determine the RELEASE versions:

e.g.

mvn org.apache.maven.plugins:maven-archetype-plugin:2.0-alpha-4:create 
-DartifactId=new-proj -DgroupId=org.mycompany -DpackageId=org.mycompany 
-DarchetypeVersion=1.0

This is executed in a directory that does not have a pom.xml file. I can get 
the list of available archetypes from the generate goal if I execute mvn 
archetype:generate in a directory that has a pom.xml, which defines the plugin 
and its version as a build dependency, but then it bombs out when I select an 
archetype because it cannot find the RELEASE version of that archetype (even 
though it exists in the local repo).

Now, as far as I can see, the metadata in my internal repository matches the 
metadata in central so I'm struggling to see what's going wrong. I should note 
that my internal repository is generated by running the archetype and other 
plugins in an environment with access to central and then I copy the local repo 
from .m2 into another folder which acts as an internal repository. Does this 
method not provide appropriate metadata or is Maven for some reason always 
going to Central to determine the release version of this plugin?  I should 
note that I have also tried the -DremoteRepositories=file://local-repo-dir 
flag but this doesn't seem to have much effect.

This behavior is consistent in Maven 2.0.9/Archetype plugin 2.0-alpha-4 and 
Maven 2.1.0-M1. I have read various FAQs and bug reports about this being fixed 
but I'm still having difficulties so I'd be grateful for some suggestions or a 
working configuration.

Here's the config I've tried thus far:

My settings.xml (I get the same failure case when the profile is switched off 
or commented and have tried both direct/indirect urls in the profile repository 
url's):

mirror
  idmirrorId/id
  mirrorOf*/mirrorOf
  nameHuman Readable Name for this Mirror./name  
  urlfile://C:/local-repo-dir/url
/mirror

profile
  idinternal-repo/id
  repositories
repository
   idcentral-repo/id
   urlhttp://dummy-url/url
   !-- urlfile:///C:/local-repo-dir/url --
   releases
   enabledtrue/enabled
   updatePolicy/
   checksumPolicy/
   /releases
   snapshots
  enabledtrue/enabled
  updatePolicy/
  checksumPolicy/
   /snapshots
   layout/
 /repository
  /repositories
  
  pluginRepositories
   pluginRepository
 idcentral-plugin-repo/id
  urlhttp://dummy-url/url
   !-- urlfile:///C:/local-repo-dir/url --
   releases
enabledtrue/enabled
updatePolicy/
checksumPolicy/
   /releases
   snapshots
enabledtrue/enabled
updatePolicy/
checksumPolicy/
/snapshots
 layout/
   /pluginRepository
  /pluginRepositories
/profile   


Here's the error:

--

[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'archetype'.
[DEBUG] Loading plugin prefixes from group: org.apache.maven.plugins
[INFO] org.apache.maven.plugins: checking for updates from central-plugin-repo
[DEBUG] repository metadata for: 'org.apache.maven.plugins' could not be found 
on repository: central-plugin-repo
[INFO] org.apache.maven.plugins: checking for updates from central
[DEBUG] repository metadata for: 'org.apache.maven.plugins' could not be found 
on repository: central
[DEBUG] Loading plugin prefixes from group: org.codehaus.mojo
[INFO] org.codehaus.mojo: checking for updates from central-plugin-repo
[DEBUG] repository metadata for: 'org.codehaus.mojo' could not be found on 
repository: central-plugin-repo
[INFO] org.codehaus.mojo: checking for updates from central
[DEBUG] repository metadata for: 'org.codehaus.mojo' could not be found on 
repository: central
[INFO] artifact org.apache.maven.plugins:maven-archetype-plugin: checking for 
updates from central-plugin-repo
[DEBUG] repository metadata for: 'artifact 
org.apache.maven.plugins:maven-archetype-plugin' could not be found on 
repository: central-plugin-repo
[INFO]