Wednesday 3 June 2009

Maven remote archetype catalogs through proxy

Some days ago created a new maven archetype. Everything went good till i had to deploy it on our maven (Nexus) repository.
First i had to install an archetype plugin. Since i had older Nexus installation, i had to update it to 1.3.x to get that plugin working (later i came across some e-mail treads where developers agreed to create that plugin 1.2.x-compatible... later... :( ).
Finally i could see archetype-catalog.xml through my browser. But when i added it to eclipse as remote file, it gave me WARN messages saying "Error reading archetype catalog http://my.domain.com/service/local/nexus-archetype-plugin/public/archetype-catalog.xml Error transferring file". Now what?!?
It turns out that there's a bug http://jira.codehaus.org/browse/ARCHETYPE-202 - can't fetch remote archetype catalogs through proxy. And no fix versions. yet... Is this the cause?

Now i'm using workaround:
  1. downloadi XML file and save it as /home/me/.m2/archetype-catalog.xml
  2. add it to m2eclipse archetypes as local catalog
  3. repeat after catalog changes :(
Better ideas?

"mvn archetype:generate -DarchetypeCatalog=http://my.domain.com/service/local/nexus-archetype-plugin/public/archetype-catalog.xml"
But why is it working though command line?

There's still much to learn...

1 comment:

  1. My guess is that the Eclipse plugin works fine with proxies EXCEPT for archetype retrieval... Would have to do a search in all of the eclipse and workspace settings files, but this looks like there should be a copy of the default "settings.xml" file somewhere...or downright not bothering to read the settings.xml when downloading the archetypes from a catalog

    ReplyDelete