Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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. &nbsp;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:

  1. 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.

...

  1. I

...

  1. did

...

  1. the

...

  1. best

...

  1. I

...

  1. could

...

  1. with

...

  1. dependencies,

...

  1. which

...

  1. are

...

  1. based

...

  1. on

...

  1. what

...

  1. you'd

...

  1. find

...

  1. in the client docs.  It wouldn't

...

  1. surprise

...

  1. me

...

  1. at

...

  1. all

...

  1. to

...

  1. hear

...

  1. that

...

  1. they

...

  1. still

...

  1. have

...

  1. problems,

...

  1. so

...

  1. speak

...

  1. up

...

  1. if

...

  1. you

...

  1. find

...

  1. something

...

  1. wrong

...

  1. with

...

  1. them.

...

  1. It's

...

  1. also

...

  1. worth

...

  1. mentioning

...

  1. that

...

  1. I

...

  1. took

...

  1. some

...

  1. liberties

...

  1. with

...

  1. packaging.

...

  1.  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}