Versions Compared

Key

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

NOTE:  A new and improved method, still in draft form, is outlined at this forum post.   Start Start there, as it should become the preferred method for using Maven with SmartGWT.  Check Check back here soon for more complete documentation.

...

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

...

The step of downloading a build from SmartClient.com 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

...

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

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>


...

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

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

Do the same for the 3.1 snapshot build released on the same day.

Code Block

mvn install -Psmartgwt-mainline -Ddate=2011-12-02

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

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-mainline -Dsnapshots=false -Ddate=2011-12-02

...

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>

...