Versions Compared

Key

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

...

Background

Currently Isomorphic does not have a Maven repository for Pro+ editions of SmartGWT.  However, this article provides a downloadable Maven configuration that will:

1. download a release or nightly build of a given version and edition of SmartGWT from SmartClient.com, using your SmartClient.com developer account

2. organize the resources in the build into the expected Maven structure, with appropriate POM files declaring dependencies from SmartGWT .jars to third-party libraries

3. deploy the resulting Maven artifacts into a corporate Maven repo or install them into a developer's individual Maven cache on their machine.

An example of doing this is:

Code Block
mvn clean install -Dversion=2.5p -Dedition=eval -Dbuild=release -Disc.username=MY_USERNAME -Disc.password=MY_PASSWORD
{code}
{color:#000000}{*}Setup{*}{color}

The build depends on an [

Setup

The build depends on an http-client

...

plugin that was at one time available on a sonatype repository.  For some reason, that artifact has gone missing.  Until such time as it's restored, you'll unfortunately need to download+another attachment+ and install its contents manually:

Code Block
mvn install:install-file -Dfile=maven-http-client-plugin-1.0.0-SNAPSHOT.jar -DpomFile=maven-http-client-plugin-1.0.0-SNAPSHOT.pom
{code}

Next,

...

set

...

up

...

a

...

Maven

...

.settings

...

profile

...

with

...

property

...

values

...

applicable

...

to

...

your

...

environment.

...

  The

...

following

...

example

...

shows

...

2

...

profiles,

...

both

...

for

...

building

...

Power

...

Edition

...

with

...

both

...

the

...

Messaging

...

and

...

Analytics

...

optional

...

modules

...

purchased:

...

}
Code Block
...
<servers>
  <server>
    <id>NEXUS_ID</id>
    <username>MY_NEXUS_USERNAME</username>
    <password>MY_NEXUS_PASSWORD</password>
  </server>
</servers>

<profile>
  <id>smartgwt-patches</id>
  <properties>
    <version>3.0p</version>
    <edition>power</edition>
    <build>nightly</build>
    <messaging>true</messaging>
    <analytics>true</analytics>
    <isc.username>MY_ISOMORPHIC_ACCOUNT_USERNAME</isc.username>
    <isc.password>MY_ISOMORPHIC_ACCOUNT_PASSWORD</isc.password>
    <repo.id>NEXUS_ID</repo.id>
    <repo.url>MY_NEXUS_RELEASE_URL</repo.url>
  </properties>
</profile>

<profile>
  <id>smartgwt-mainline</id>
  <properties>
    <version>3.1d</version>
    <edition>power</edition>
    <build>nightly</build>
    <snapshots>true</snapshots>    <messaging>true</messaging>
    <analytics>true</analytics>     <isc.username>MY_ISOMORPHIC_ACCOUNT_USERNAME</isc.username>    <isc.password>MY_ISOMORPHIC_ACCOUNT_PASSWORD</isc.password>
    <repo.id>NEXUS_ID</repo.id>
    <repo.url>MY_NEXUS_SNAPSHOTS_URL</repo.url>
  </properties>
</profile>


{code}

Eliminate

...

the

...

<messaging>

...

and

...

<analytics>

...

elements

...

if

...

you

...

didn't

...

purchase

...

those

...

modules.

...

 

The <repo*>

...

elements

...

are

...

for

...

deploying

...

to

...

an

...

internal,

...

organization-specific

...

Maven

...

repo.

...

  Remove

...

these

...

properties

...

if

...

you

...

don't

...

have

...

an

...

internal

...

Maven

...

repo.

...

Usage

You can override these settings on the command line.  For example, this would download and deploy the 3.0 Power Edition release build instead of the 3.0p patch build as shown in the .settings file above, then deploy it to the central corporate repo (if you have one):

Code Block
mvn clean deploy -Psmartgwt-patches -Dversion=3.0 -Dbuild=release
{code}

This

...

would

...

install

...

the

...

3.0

...

patch

...

released

...

on

...

December

...

2,

...

2011

...

on

...

my

...

workstation

...

(i.e.,

...

my

...

local

...

maven

...

cache)

...

 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

...

my

...

corporate

...

repo:

...

}
Code Block
mvn clean install -Psmartgwt-patches -Ddate=2011-12-02
{code}

Do

...

the

...

same

...

for

...

the

...

3.1

...

snapshot

...

build

...

released

...

on

...

the

...

same

...

day.

...

}
Code Block
mvn install -Psmartgwt-mainline -Ddate=2011-12-02
{code}

Deploy

...

the

...

3.1.d20111202-SNAPSHOT

...

build

...

to

...

the

...

central

...

corporate

...

Maven

...

repo

...

once

...

it's

...

been

...

verified.

...

 Since "clean"

...

isn't

...

specified

...

as

...

a

...

goal,

...

this

...

won't

...

download

...

the

...

package

...

from

...

SmartClient.com

...

again

...

since

...

it

...

was

...

already

...

installed

...

locally:

...

}
Code Block
mvn deploy -Psmartgwt-mainline -Ddate=2011-12-02
{code}

Deploy

...

the

...

same

...

3.1.d20111202

...

build,

...

but

...

don't

...

mark

...

it

...

as

...

a

...

snapshot.

...

 This allows you to treat a mainline build as a release build, if you need to.

Code Block
mvn deploy -Psmartgwt-patches -Ddate=2011-12-02
{code}
{color:#000000}{*}Notes{*}{color}

The build figures out where to get your downloads based on version, edition, build, and date properties. &nbsp;It's worth reviewing the [Download Page|http://www.smartclient.com/product/download.jsp]&nbsp;narrative at least once, but for the impatient:
{quote}
When no letter is specified 

Notes

The build figures out where to get your downloads based on version, edition, build, and date properties.  It's worth reviewing the Download Page narrative at least once, but for the impatient:

When no letter is specified (e.g.

...

"3.0"),

...

the

...

build

...

is

...

a

...

release

...

build.

...

The

...

letter

...

"p"

...

in

...

a

...

version

...

(e.g.

...

"3.0p")

...

indicates

...

a

...

patch

...

build,

...

containing

...

post-release

...

fixes

...

only,

...

with

...

no

...

new

...

features

...

added.

...

These

...

builds

...

are

...

a

...

convenience

...

relative

...

to

...

having

...

to

...

install

...

all

...

post-release

...

patches,

...

and

...

should

...

generally

...

be

...

used

...

instead

...

of

...

the

...

actual

...

releases.

...

The

...

letter

...

"d"

...

in

...

a

...

version

...

(e.g.

...

"3.1d")

...

indicates

...

a

...

development

...

build,

...

moving

...

towards

...

the

...

release

...

of

...

the

...

specified

...

version

...

(for

...

example,

...

3.1d

...

is

...

progress

...

towards

...

a

...

future

...

3.1

...

release).

...

The

...

POMs

...

in

...

the

...

downloadable

...

Maven

...

configuration

...

speak

...

for

...

themselves,

...

but

...

to

...

point

...

out

...

a

...

few

...

things:

...

  1. The

...

  1. POMs

...

  1. at

...

  1. each

...

  1. project's

...

  1. root

...

  1. are

...

  1. used

...

  1. to

...

  1. mavenize

...

  1. the

...

  1. resources

...

  1. from

...

  1. the

...

  1. package

...

  1. downloaded

...

  1. from

...

  1. SmartClient.com.

...

  1.  Unless you're

...

  1. interested

...

  1. in

...

  1. how

...

  1. that

...

  1. works,

...

  1. the

...

  1. POM

...

  1. you

...

  1. care

...

  1. about

...

  1. is

...

  1. at

...

  1. src/main/resources.

...

  1. The

...

  1. build

...

  1. does

...

  1. require

...

  1. the

...

  1. use

...

  1. of

...

  1. Maven

...

  1. 3.

...

  1.  You don't

...

  1. need

...

  1. Maven

...

  1. 3

...

  1. to

...

  1. use

...

  1. the

...

  1. resulting

...

  1. artifact,

...

  1. just

...

  1. to

...

  1. build

...

  1. it.

...

  1. There

...

  1. currently

...

  1. isn't

...

  1. any

...

  1. good

...

  1. way

...

  1. to

...

  1. attach

...

  1. each

...

  1. artifact's

...

  1. javadoc

...

  1. independently,

...

  1. but

...

  1. the

...

  1. artifacts

...

  1. that

...

  1. have

...

  1. documentation

...

  1. in

...

  1. either

...

  1. the

...

  1. client

...

  1. or

...

  1. server

...

  1. bundles

...

  1. has

...

  1. the

...

  1. full

...

  1. bundle

...

  1. attached.

...

  1. The

...

  1. dependencies

...

  1. are

...

  1. based

...

  1. on

...

  1. the

...

  1. SmartGWT

...

  1. docs

...

  1. .  If any of the dependencies are wrong, or you have suggestions for improvements to the setup, please comment here or on thisforum post.

If you are having trouble getting the download to work you can bypass the scripts behavior by doing the following.

  1. Rename your downloaded SmartGWT distribution to smartgwt.zip
  2. Copy the smartgwt.zip file into Extracted Maven Configuration\binary-distribution\binary-distribution\target\downloads

...

  1. (create

...

  1. any

...

  1. missing

...

  1. folders

...

  1. as

...

  1. necessary)

...

  1. When

...

  1. using

...

  1. the

...

  1. script,

...

  1. do

...

  1. not

...

  1. specify

...

  1. the

...

  1. "clean"

...

  1. command.

...

Project POM Example

Adding the following dependencies to your project POM would enable the basic server functionality plus SQL support, as well as make additional skins available.   Take a look at the generated artifacts to decide what you need for your own project, or get started with this Maven archetype

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>isomorphic-sql</artifactId>
  <version>${smartgwt.version}</version>
</dependency>
<dependency>
  <groupId>com.isomorphic</groupId>
  <artifactId>smartgwt-skins</artifactId>
  <version>${smartgwt.version}</version>
</dependency>
{code}{*}References*

Other forum threads about different ways of setting up Maven with SmartGWT 

References

Other forum threads about different ways of setting up Maven with SmartGWT Pro/EE.

...

  These

...

are

...

for

...

reference

...

only,

...

as

...

the

...

method

...

described

...

in

...

this

...

article

...

is

...

better

...

and

...

more

...

complete.

...

Mavenizing

...

SmartGWT

...

and

...

the

...

nightly

...

builds

and

Mavenization of a SmartGWT EE project