Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 20 Next »

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:

mvn clean install -Dversion=2.5 -Dedition=eval -Dbuild=release -Disc.username=MY_USERNAME -Disc.password=MY_PASSWORD

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:

mvn install-file -Dfile=maven-http-client-plugin-1.0.0-SNAPSHOT.jar -DpomFile=maven-http-client-plugin-1.0.0-SNAPSHOT.pom

Next, set up a Maven .settings profile with property values applicable to your environment.  The following example shows a nightly build toward the 3.1 release of Power Edition with both the Messaging and Analytics optional modules purchased:

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


<profile>
  <id>smartgwt</id>
  <properties>
    <version>3.1</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_REPO_URL</repo.url>
  </properties>
</profile>

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 2.5 Power Edition release build instead of the 3.1 nightly build as shown in the .settings file above, then deploy it to the central corporate repo (if you have one):

mvn clean deploy -Psmartgwt -Dversion=2.5 -Dbuild=release

This would install the 2011-12-02 nightly of 3.0.1 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:

mvn clean install -Psmartgwt -Dversion=3.0.1 -Ddate=2011-12-02

Deploy the 3.0.1 2011-12-02 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:

mvn deploy -Psmartgwt -Dversion=3.0.1 -Ddate=2011-12-02

Notes

The build figures out where to get your downloads based on version, edition, build, and date properties.  The version numbering scheme you see on the Download page/s might be a bit unfamiliar to you, but mostly you should be able to use the following examples as your guide:

  1. The version property should always take the form major.minor[.revision].  e.g., 2.5 | 3.0 | 3.0.1.
  2. GA releases work just the way you'd expect.  -Dversion=3.0 -Dbuild=release gets you the 3.0 GA build.
  3. Isomorphic nightly builds always take major.minor form.  e.g., there is no nightly build named 3.0.1.  Only 3.0p, which holds the contents of the current release line at a point in time.  Said differently, the URL for progress toward a 3.0.2 patch release will be the same as it was during development of the the 3.0.1 release.  So
    1. If for example the current production release is 3.0 and you want the nightly build from the mainline (the 'bleeding edge' 3.1 feature release), use -Dbuild=nightly -Dversion=3.1 -Ddate=2011-12-02
    2. If what you want instead is a nightly build of the 3.0.1 patch release (bug fixes only), use -Dbuild=nightly, -Dversion=3.0.1, -Ddate=2011-12-02
  4. The date property is applicable to nightly builds only.

The POMs in the downloadable Maven configuration speak for themselves, but to point out a few things:

  1. The POMs at each project's root are used to mavenize the resources from the package downloaded from SmartClient.com.  Unless you're interested in how that works, the POM you care about is at src/main/resources.
  2. The build does assume the use of Maven 3.  You don't need Maven 3 to use the resulting artifact, just to build it.
  3. There currently isn't any good way to attach each artifact's javadoc independently, but the artifacts that have documentation in either the client or server bundles has the full bundle attached.
  4. The dependencies are based on the SmartGWT docs.  If any of the dependencies are wrong, or you have suggestions for improvements to the setup, please comment here or on thisforum post.

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

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

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

  • No labels