Archetype now in SVN and Released in repo as 1.0!

2 views
Skip to first unread message

Charlie Collins

unread,
Sep 16, 2008, 9:13:07 AM9/16/08
to gwt-maven
So it took a while, but we have an "official" archetype now ;).
(There have been a a few other very useful ones contributed by users,
but never one in our source control that we release in our repo - now
we finally have one.)

SRC: http://gwt-maven.googlecode.com/svn/trunk/maven-googlewebtoolkit2-archetype/

RELEASE/REPO: http://gwt-maven.googlecode.com/svn/trunk/mavenrepo/com/totsp/gwt/maven-googlewebtoolkit2-archetype/

USAGE:
http://gwt-maven.googlecode.com/svn/trunk/maven-googlewebtoolkit2-archetype/README.txt


"GWT-Maven Archetype Info/Usage
===============================

Creates a bare bones GWT app with all the GWT-Maven
setup and structure in place (a template).


1. Installing the archetype
---------------------------

You have several choices on how to install the archetype, you
can just add the GWT-Maven repository to an active profile
and then use the archetype (it's in the GWT-Maven repo),
or you can download the file and install it in your local repository.

Example add the GWT-Maven repository to a profile in your ~/.m2/
settings.xml file:

<settings>
...
<profiles>
...
<profile>
<id>gwt-maven-repo-profile</id>
<repositories>
<repository>
<id>gwt-maven</id>
<url>http://gwt-maven.googlecode.com/svn/trunk/mavenrepo/</
url>
</repository>
</repositories>
</profile>
...
</profiles>
...
<activeProfiles>
...
<activeProfile>gwt-maven-repo-profile</activeProfile>
...
</activeProfiles>
...
</settings>


Example download the file and install it:

Download the file from:
http://gwt-maven.googlecode.com/svn/trunk/mavenrepo/com/totsp/gwt/maven-googlewebtoolkit2-archetype/VERSION/maven-googlewebtoolkit2-archetype-VERSION.jar

mvn install:install-file \
-DgroupId=com.totsp.gwt \
-DartifactId=maven-googlewebtoolkit2-archetype \
-Dversion=VERSION \
-Dpackaging=maven-archetype
-Dfile=PATH_TO_JAR_YOU_DOWNLOADED/maven-googlewebtoolkit2-archetype-
VERSION.jar


2. Using the archetype
-------------------------

mvn archetype:create \
-DarchetypeGroupId=com.totsp.gwt \
-DarchetypeArtifactId=maven-googlewebtoolkit2-archetype \
-DarchetypeVersion=1.0 \
-DgroupId=myGroupId \
-DartifactId=myArtifactId
"


I will get the README info added to the regular docs in the next
release.

John Kroubalkian

unread,
Sep 16, 2008, 8:20:47 PM9/16/08
to gwt-...@googlegroups.com
Brilliant!  Great work!

Charlie Collins

unread,
Sep 17, 2008, 6:25:42 AM9/17/08
to gwt-maven
Thanks.

Just as a follow up, I also updated the docs yesterday after this
thread. It's basically the same info as the archetype README, but,
it's now in the real docs too.

http://gwt-maven.googlecode.com/svn/docs/maven-googlewebtoolkit2-plugin/archetype.html


On Sep 16, 8:20 pm, "John Kroubalkian" <java...@gmail.com> wrote:
> Brilliant!  Great work!
>
> On Tue, Sep 16, 2008 at 6:13 AM, Charlie Collins
> <charlie.coll...@gmail.com>wrote:
>
>
>
> > So it took a while, but we have an "official" archetype now ;).
> > (There have been a a few other very useful ones contributed by users,
> > but never one in our source control that we release in our repo - now
> > we finally have one.)
>
> > SRC:
> >http://gwt-maven.googlecode.com/svn/trunk/maven-googlewebtoolkit2-arc...
>
> > RELEASE/REPO:
> >http://gwt-maven.googlecode.com/svn/trunk/mavenrepo/com/totsp/gwt/mav...
>
> > USAGE:
>
> >http://gwt-maven.googlecode.com/svn/trunk/maven-googlewebtoolkit2-arc...
> >http://gwt-maven.googlecode.com/svn/trunk/mavenrepo/com/totsp/gwt/mav...

Jeff Bowman

unread,
Sep 26, 2008, 6:17:30 PM9/26/08
to gwt-maven
1) I have tried to use the archetype but am failing. Regardless of
having an active profile, it seems to always look in http://repo1.maven.org.
I have provided a transcript at http://www.bowmansarrow.us which shows
me trying to install it from the jar (mvn install:install-file as
specified in the README). If you could point out where I'm just not
getting it I'd appreciate it.

2) I have been putting the public folder and the gwt.xml file in src/
main/resources (ie src/main/resources/<package>/public/Application.
(html|css) and src/main/resources/<package>/Application.gwt.xml) which
is where I thought non-java code was going, but I notice (via jar -
tf ...) the archetype puts those things in src/main/java. Am I doing
it wrong?

Finally, as noobish as I seem to be, I'm interested in helping out
with the archetype if you want it or would find it useful.

Thanks for an awesome tool!

Charlie Collins

unread,
Sep 27, 2008, 7:41:57 AM9/27/08
to gwt-maven
Sorry it's giving you so much trouble. I have used it on several
platforms and it seems to work. I am using Maven 2.0.9, just out of
curiosity what version of Maven are you using? "mvn -version"

Also, reading through your transcript I did notice one small
discrepancy, not sure if it matters, but it's worth looking into:

the mvn install:install-file command seems to work just fine for you -
and you followed the instructions perfectly -
"jeff@CanisNubilus:~/tmp$ mvn install:install-file -
DgroupId=com.totsp.gwt -DartifactId=maven-googlewebtoolkit2-archetype -
Dversion=1.0 -Dpackaging=maven-archetype -Dfile=maven-
googlewebtoolkit2-archetype-1.0.jar"

but, Maven itself is giving a slightly different instruction after it
can't find the artifact in the later commands:
"mvn install:install-file -DgroupId=com.totsp.gwt -DartifactId=maven-
googlewebtoolkit2-archetype -Dversion=1.0 -Dpackaging=jar -Dfile=/path/
to/file"

Note there that Maven is saying to use packaging JAR and I said (in
the directions) to use packaging MAVEN-ARCHETYPE. Try the install
command again with packaging JAR and see if that works?

I will look into this more though, and add an issue to the tracker to
delete my repos and so on and try BOTH ways (profile with repo, and or
local install).

------

Also, as to where the GWT non Java files go, yes, you can put them in
src/main/resources and that is arguably a better place to put them
(that is where I put them in my projects). The archetype though is
trying to keep things as simple as possible, and because GWT is sort
of special in regards to those "resources" sometimes people run into
other issues if they aren't in the src tree. Good catch on your part
to notice that, but the files can go in either place.




On Sep 26, 6:17 pm, Jeff Bowman <jeff.wol...@gmail.com> wrote:
> 1) I have tried to use the archetype but am failing. Regardless of
> having an active profile, it seems to always look inhttp://repo1.maven.org.
> I have provided a transcript athttp://www.bowmansarrow.uswhich shows

Charlie Collins

unread,
Sep 27, 2008, 7:55:45 AM9/27/08
to gwt-maven
Ah dammit! This is indeed my bad in the documentation. And on this
one I thought I checked and checked and checked again, sorry, I missed
it.

The packaging for an archetype should be JAR - and not MAVEN-
ARCHETYPE.

I don't recall now where I got that packaging type, but it WAS in the
archetype instructions or was generated for me by the archetype:create
command or something. Since that packaging is what the archetype
actually IS (http://gwt-maven.googlecode.com/svn/trunk/maven-
googlewebtoolkit2-archetype/pom.xml) that's what I put in the
instructions. But it turns out that screws things up.

Watching this as it goes:

charliecollins$ mvn install:install-file -DgroupId=com.totsp.gwt -
DartifactId=maven-googlewebtoolkit2-archetype -Dversion=1.0 -
Dpackaging=maven-archetype -Dfile=./maven-googlewebtoolkit2-
archetype-1.0.jar
[INFO] [install:install-file]
[INFO] Installing /opt/projects/./maven-googlewebtoolkit2-
archetype-1.0.jar to /Users/charliecollins/.m2/repository/com/totsp/
gwt/maven-googlewebtoolkit2-archetype/1.0/maven-googlewebtoolkit2-
archetype-1.0.maven-archetype


Note there that it installed a file NAMED "maven-googlewebtoolkit2-
archetype-1.0.maven-archetype" - that is wrong, you don't want that.

After switching it to JAR it installs properly, and you end up with a
jar in your repo, and then the archetype command itself works fine.

I will test some more and update the instructions in the docs.

Charlie Collins

unread,
Sep 27, 2008, 2:06:15 PM9/27/08
to gwt-maven
I have updated the docs to address this, and tested with a clean repo
- the current instructions work fine for me:
http://gwt-maven.googlecode.com/svn/docs/maven-googlewebtoolkit2-plugin/archetype.html.

Please let me know if that fixes it, or not.

thanks

Jeff Bowman

unread,
Sep 29, 2008, 10:04:15 AM9/29/08
to gwt-...@googlegroups.com
That worked for me also.

Thanks!

--
Amateurs work until they get it right...
... Professionals work until they can't get it wrong

joti

unread,
Oct 2, 2008, 2:28:31 PM10/2/08
to gwt-maven
Hello,

it is highly appreciated to see that we now have an out of the box
archetype for GWT projects. :D
Currently i use cypal-Studio (http://code.google.com/p/cypal-studio/ ,
now in its 1.0 and quite stable) with Eclipse to facilitate my GWT-
Development. But until their 2.0 is out they need WTP and Faceted
Project in Eclipse. I wonder if it would bea good idea to add the
needed config stanzas for the Eclipse-Plugin to the archetype since
maybe some more people use Eclipse with GWT and that would make the
archetype easier to use with Eclipse.

Looking forward to feedback.

Cheers,
Joti


On 27 Sep., 20:06, Charlie Collins <charlie.coll...@gmail.com> wrote:
> I have updated the docs to address this, and tested with a clean repo
> - the current instructions work fine for me:http://gwt-maven.googlecode.com/svn/docs/maven-googlewebtoolkit2-plug....

joti

unread,
Oct 2, 2008, 3:07:14 PM10/2/08
to gwt-maven
Hello,

it turned out I got the wrong archetype with m2eclipse from the repo
(I am using Nexus as a Repository proxy and unifier) , it was from
http://mgp.sourceforge.net/ and they seem to provide Nexus indexes for
their repository. Your archetype actually is really well equipped as I
saw when I installed it manually. Yay!

May you could consider providing a Nexus index with your repository?
Information on that can be found here: http://docs.codehaus.org/display/M2ECLIPSE/Nexus+Indexer

That could improve the availability a lot.

Thanks a lot and regards
Joti

Charlie Collins

unread,
Oct 2, 2008, 3:42:43 PM10/2/08
to gwt-maven
I am not at all familiar with the nexus indexer, but will check it
out. Thanks for the suggestions, and let me know if anything doesn't
work for you (I don't use m2eclipse either, but I do want to have
everything work there, seems like a lot of people like that setup).

On Oct 2, 3:07 pm, joti <joti.m...@gmail.com> wrote:
> Hello,
>
> it turned out I got the wrong archetype with m2eclipse from the repo
> (I am using Nexus as a Repository proxy and unifier) , it was fromhttp://mgp.sourceforge.net/and they seem to provide Nexus indexes for

Charlie Collins

unread,
Oct 3, 2008, 7:20:32 AM10/3/08
to gwt-maven
Just to bump this thread in case people search and find it, there is
now a 1.0.1 archetype in the repo too, which uses a minor enhancement
GWT-Maven release by default (2.0-beta24).

On Oct 2, 3:42 pm, Charlie Collins <charlie.coll...@gmail.com> wrote:
> I am not at all familiar with the nexus indexer, but will check it
> out.  Thanks for the suggestions, and let me know if anything doesn't
> work for you (I don't use m2eclipse either, but I do want to have
> everything work there, seems like a lot of people like that setup).
>
> On Oct 2, 3:07 pm, joti <joti.m...@gmail.com> wrote:
>
> > Hello,
>
> > it turned out I got the wrong archetype with m2eclipse from the repo
> > (I am using Nexus as a Repository proxy and unifier) , it was fromhttp://mgp.sourceforge.net/andthey seem to provide Nexus indexes for
Reply all
Reply to author
Forward
0 new messages