...
Background
So far,
...
I've
...
really
...
enjoyed
...
using
...
SmartGWT
...
with
...
the
...
server
...
framework.
...
But with no official support from Isomorphic, getting my projects setup for Maven has to this point taken far more time than I would have liked. Until such time as builds other than the LGPL version are available on the SmartGWT maven repository (if all you need is LGPL, then you can find that here), I guess we're on our own.
I'd been able to find other attempts at 'mavenizing' the SmartGWT builds, but in short, none of them quite worked for me. For completeness, I'm specifically referring to
Mavenizing SmartGWT and the nightly builds
and
Mavenization of a SmartGWT EE project
In the end, I spent considerable time building my own solution using Maven itself. It didn't turn out at all like I thought it would when I started, but it does seem to work the way I'd planned: The result is that I can download and install (or deploy to my corporate nexus repo) any available build (nightly or release) with a command like the following:
Code Block |
---|
mvn clean install -Dversion=2.5 -Dedition=eval -Dbuild=release -Disc.username=MY_USERNAME -Disc.password=MY_PASSWORD
{code}
{color:#000000}{*}Setup{*}{color}
Do yourself a favor and set up a .settings profile with property values applicable to your environment. I have a Power Edition license with both messaging and analytics optional modules, so mine looks something like:
{code} |
Setup
Do yourself a favor and set up a .settings profile with property values applicable to your environment. I have a Power Edition license with both messaging and analytics optional modules, so mine looks something like:
Code Block |
---|
<profile>
<id>smartgwt</id>
<properties>
<version>3.0</version>
<edition>power</edition>
<build>nightly</build>
<messaging>true</messaging>
<analytics>true</analytics>
<isc.username>MY_USERNAME</isc.username>
<isc.password>MY_PASSWORD</isc.password>
<repo.id>NEXUS_ID</repo.id>
<repo.url>http://NEXUS_HOST/content/repositories/thirdparty/</repo.url>
</properties>
</profile>
{code}
|
Eliminate
...
the
...
messaging
...
and
...
analytics
...
properties
...
if
...
you
...
don't
...
need
...
those
...
modules.
...
Eliminate the repo properties if you don't
...
intend
...
to
...
deploy
...
to
...
your
...
own
...
maven
...
repository
...
(you
...
really
...
should
...
though
...
IMO).
...
Usage
Download and deploy the 2.5
...
Power
...
Edition
...
release
...
build
...
to
...
my
...
corporate
...
nexus
...
repo
...
by
...
overriding
...
some
...
of
...
my
...
settings
...
from
...
the
...
command
...
line:
...
Code Block |
---|
mvn clean deploy -Psmartgwt -Dversion=2.5 -Dbuild=release
{code}
|
Install
...
the
...
latest
...
nightly
...
build
...
on
...
my
...
workstation
...
for
...
evaluation
...
in
...
my
...
private
...
workspace
...
(e.g.,
...
when
...
I
...
want
...
to
...
check
...
whether
...
or
...
not
...
some
...
bug
...
has
...
been
...
resolved)
...
before
...
I
...
deploy
...
to
...
nexus:
...
Code Block |
---|
mvn clean install -Psmartgwt -Ddate=2011-12-02
{code}
|
Deploy
...
the
...
12/2
...
build
...
when
...
I'm
...
happy
...
with
...
it.
...
We won't
...
download
...
the
...
main
...
(big)
...
bundle
...
again
...
if
...
we
...
already
...
have
...
one
...
locally,
...
so
...
I
...
can
...
skip
...
the
...
clean
...
goal
...
if
...
I
...
want
...
and
...
things
...
will
...
go
...
considerably
...
faster
...
Code Block |
---|
mvn deploy -Psmartgwt -Ddate=2011-12-02
{code}
{color:#000000}{*}Notes{*}{color}
One of the cool things about Maven is that the POMs sort of speak for themselves, but I'll point out a few things:
# The POMs at each project's root are used for the mavenization itself. Unless you're interested in how that works (and trust me, you shouldn't be), the POM you care about is at |
Notes
One of the cool things about Maven is that the POMs sort of speak for themselves, but I'll point out a few things:
- The POMs at each project's root are used for the mavenization itself. Unless you're interested in how that works (and trust me, you shouldn't be), the POM you care about is at src/main/resources.
...
- I
...
- did
...
- the
...
- best
...
- I
...
- could
...
- with
...
- dependencies,
...
- which
...
- are
...
- based
...
- on
...
- what
...
- you'd
...
- find
...
- in the client docs. It wouldn't
...
- surprise
...
- me
...
- at
...
- all
...
- to
...
- hear
...
- that
...
- they
...
- still
...
- have
...
- problems,
...
- so
...
- speak
...
- up
...
- if
...
- you
...
- find
...
- something
...
- wrong
...
- with
...
- them.
...
- It's
...
- also
...
- worth
...
- mentioning
...
- that
...
- I
...
- took
...
- some
...
- liberties
...
- with
...
- packaging.
...
- I think it makes pretty good sense, but could no doubt be made to see the error of my ways. Again, speak up with a comment here or on this forum post.
Example
Again, take a look at the resulting artifacts to decide what you need for your own project. For reference, I have a project that declares SmartGWT dependencies like so:
Code Block |
---|
<dependency>
<groupId>com.isomorphic</groupId>
<artifactId>smartgwt-power</artifactId>
<version>${smartgwt.version}</version>
</dependency>
<dependency>
<groupId>com.isomorphic</groupId>
<artifactId>isomorphic-network</artifactId>
<version>${smartgwt.version}</version>
</dependency>
<dependency>
<groupId>com.isomorphic</groupId>
<artifactId>smartgwt-skins</artifactId>
<version>${smartgwt.version}</version>
</dependency>
{code} |