Re: Maven, woapplication-archetype not found when using the local catalog
Re: Maven, woapplication-archetype not found when using the local catalog
- Subject: Re: Maven, woapplication-archetype not found when using the local catalog
- From: Lachlan Deck <email@hidden>
- Date: Mon, 8 Dec 2008 14:39:37 +1100
On 08/12/2008, at 11:42 AM, William Hatch wrote:
On Dec 7, 2008, at 4:38 PM, Lachlan Deck wrote:
On 07/12/2008, at 5:46 AM, William Hatch wrote:
More playing around with getting this to fly; using latest WOLips,
Eclipse 3.4 and I hope (not sure which version of WO you get when
installing with maven) WO 5.4.3.
You can check on the versions installed by:
$ ls ~/.m2/repository/com/webobjects/JavaWebObjects
I've got:
5.4.2 _SNAPSHOT
5.4.3
5.4.3_SNAPSHOT
and six other maven-metadata*.xml files
okay - so you've installed the nightlies from apple also.
You'll see a list of folders (one per version) for that framework
each of which contain the relevant jar etc.
I've been able to successfully install the WO snapshots
Do you mean the nightlies from Apple? How did you install?
Just be careful if you copied the apple nightlies over the top of
your current repo install of WO as it'll bork your catalog xml file
(in the above dir for example).
I just ran the wobootstrap:install mojo as documented here: http://wiki.objectstyle.org/confluence/display/WOL/maven-wobootstrap-plugin
I should have been more clear; I don't think this actually gives
the nightly snapshots from apple,
No it doesn't. wobootstrap:install grabs *released* versions of the
frameworks from /Library/WebObjects/lib, by default. The nightlies
you've downloaded from apple were probably copied in via the Finder or
otherwise.
but rather installs your local libraries into the local repos,
correct?
Yes. You can use woboostrap:deploy too.
Thanks for pointing out the distinction.
So by installing Apple's by copy/paste or similar you'll want to re-
install the released versions to ensure the xml files in those dirs
are referencing all the versions actually available.
Or just don't include the nightlies at all until Apple (or woproject)
provides a tool for importing them properly using maven.
and build and install wonder into my local repository using maven,
but when trying to use the woapplication-archetype as defined in
my local archetype-catalog in ~/.m2/ to create a new project by
doing the following:
mvn -e archetype:generate -DarchetypeCatalog=local
and then selecting "1" when presented with this prompt:
Choose archetype: 1: local -> woapplication-archetype (WebObjects
Application Archetype) 2: local -> woframework-archetype
(WebObjects Framework Archetype) Choose a number: (1/2): 1
as documented on the wiki here: http://wiki.objectstyle.org/confluence/display/WOL/woapplication-archetype
I"m getting: org.apache.maven.BuildFailureException: The desired
archetype does not exist
(org.objectstyle.woproject.maven2:woapplication-archetype:2.0.16)
it appears to be trying to grab this from here:
Downloading: http://repo1.maven.org/maven2/org/objectstyle/woproject/maven2/woapplication-archetype/2.0.16/woapplication-archetype-2.0.16.jar
and it's not there.
Here's my archetype-catalog.xml:
<?xml version="1.0" encoding="UTF-8"?><archetype-catalog>
<archetypes>
<archetype>
<groupId>org.objectstyle.woproject.maven2</groupId>
<artifactId>woapplication-archetype</artifactId>
<version>2.0.16</version>
<description>WebObjects Application Archetype</description>
</archetype>
<archetype>
<groupId>org.objectstyle.woproject.maven2</groupId>
<artifactId>woframework-archetype</artifactId>
<version>2.0.16</version>
<description>WebObjects Framework Archetype</description>
</archetype>
</archetypes>
</archetype-catalog>
Do I need to define a different repository someplace, use a
different version number, or... ?
You've got the settings.xml file in ~/.m2 right? i.e., the one
found here:
http://wiki.objectstyle.org/confluence/display/WOL/Quick+Start
Yup, exactly as is appears with the downloaded file, which as an
aside, does not download properly if you simply click the link; I
had to explicitly "Save downloaded file as..." to get it to work;
here's what mine looks like:
<settings 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/xsd/settings-1.0.0.xsd">
<pluginGroups>
<pluginGroup>org.objectstyle.woproject.maven2</pluginGroup>
</pluginGroups>
<profiles>
<profile>
<id>default</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<pluginRepositories>
<pluginRepository>
<id>mdimension.releases</id>
<name>MDimension Releases Repository</name>
<url>
http://webobjects.mdimension.com/maven2/releases
</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>mdimension.snapshots</id>
<name>MDimension Snapshots Repository</name>
<url>
http://webobjects.mdimension.com/maven2/snapshots
</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
</settings>
I'm not able to wrap my head around the answer from reading the
book or googling, so any help is appreciated. Any best practices
about conventional places to define repositories for this sort of
artifact would be helpful.
See the Quick+Start guide.
Yeah, I think the problem is either the archetype that's described
in my archetype-catalog.xml file is not available where maven is
looking, which would seems like it should be at the mdimension
repos, OR, somehow, the repository location is not properly
associated with the described archetype. And that's what I'm really
trying to figure out ultimately. Well, that and how to solve it;-)
Should it go in my local settings.xml,
yes. Any plugins that are not in maven's main repository that you
depend on for creating projects you should define the repositories
for in your local settings.xml file in ~/.m2. This will
additionally assist maven when it comes to building your project.
OK, so revisiting the original question, the problem I seem to be
having is that maven is trying to locate the archetype from the
central maven repository such that when I do this:
mvn -e archetype:generate -DarchetypeCatalog=local
and then selecting "1" when presented with this prompt:
Choose archetype: 1: local -> woapplication-archetype (WebObjects
Application Archetype) 2: local -> woframework-archetype
(WebObjects Framework Archetype) Choose a number: (1/2): 1
it ultimately fails with this:
Can you try the following:
mvn archetype:generate -DarchetypeArtifactId=woapplication-archetype -
DarchetypeGroupId=org.objectstyle.woproject.maven2 -
DarchetypeVersion=2.0.16 -DarchetypeRepository=http://webobjects.mdimension.com/maven2/releases
And then after having done so, repeat what you did above.
org.apache.maven.BuildFailureException: The desired archetype does
not exist (org.objectstyle.woproject.maven2:woapplication-
archetype:2.0.16)
it appears to be trying to grab this from here:
Downloading: http://repo1.maven.org/maven2/org/objectstyle/woproject/maven2/woapplication-archetype/2.0.16/woapplication-archetype-2.0.16.jar
and it's not there.
It seems to me it's trying to add the actual archetype to the local
repository,
Correct. You've not got it installed (yet).
and not being able to find it as it's looking in the wrong place. Am
I completely wrong here?
Thanks Lachlan, I'm sure I'm getting pretty close, just need to
clear up these last few details.
No worries... we'll get there.
with regards,
--
Lachlan Deck
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden