Maven2?

Hello there,

Are we going to have soon something available to our pom.xml like:
…
<repository>
<id>smartgwt</id>
<url>http://www.smartclient.com/smartgwt/maven2&lt;/url&gt;
</repository>
…
<dependency>
<groupId>com.smartgwt</groupId>
<artifactId>smartgwt</artifactId>
<version>1.0b1</version>
</dependency>
…
That would be great!

Thanks for your support in using your library.

I meant com.smartclient

<dependency>
<groupId>com.smartclient</groupId>
<artifactId>smartgwt</artifactId>
<version>1.0b1</version>
</dependency>

I’m looking into this. I also need to brush up on my maven skills. I’d like to setup a way for users to be able to pickup the latest build. ie a maven SNAPSHOT build so that developers can pick up the latest dev build as in the next few weeks I expect them to be created frequently to incorporate any missing features and bugs.

Please email me if you are a maven expert and we can discuss how best to set this up. sanjiv dot jivan @gmail.com.

Thanks,
Sanjiv

Hi Sanjiv,

I have a working copy of pom that can build Showcase sample. By the way, I am using GWT-Maven plugin (http://code.google.com/p/gwt-maven/). Here is my pom setup:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
	<!--
		GWT-Maven example POM without google.webtoolkit.home SET (GWT as deps)
	-->
	<modelVersion>4.0.0</modelVersion>
	<groupId>com.mygics.gwt</groupId>
	<artifactId>showcase</artifactId>
	<packaging>war</packaging>
	<version>0.0.1</version>
	<name>Showcase</name>

	<!--  include pluginRepository and repository for GWT-Maven -->
	<pluginRepositories>
		<pluginRepository>
			<id>gwt-maven-plugins</id>
			<url>
				http://gwt-maven.googlecode.com/svn/trunk/mavenrepo/
			</url>
		</pluginRepository>
	</pluginRepositories>
	<repositories>
		<repository>
			<id>gwt-maven</id>
			<url>
				http://gwt-maven.googlecode.com/svn/trunk/mavenrepo/
			</url>
		</repository>
	</repositories>

	<!--  convenience to define GWT version in one place -->
	<properties>
		<gwtVersion>1.5.3</gwtVersion>
	</properties>

	<dependencies>
		<!--  GWT deps (from central repo) -->
		<dependency>
			<groupId>com.google.gwt</groupId>
			<artifactId>gwt-servlet</artifactId>
			<version>${gwtVersion}</version>
			<scope>runtime</scope>
		</dependency>
		<dependency>
			<groupId>com.google.gwt</groupId>
			<artifactId>gwt-user</artifactId>
			<version>${gwtVersion}</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>com.google.gwt</groupId>
			<artifactId>gwt-dev</artifactId>
			<version>${gwtVersion}</version>
			<classifier>${platform}-libs</classifier>
			<type>zip</type>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>com.google.gwt</groupId>
			<artifactId>gwt-dev</artifactId>
			<version>${gwtVersion}</version>
			<classifier>${platform}</classifier>
			<scope>provided</scope>
		</dependency>

		<dependency>
			<groupId>com.smartgwt</groupId>
			<artifactId>smartgwt</artifactId>
			<version>1.0b1</version>
			<scope>compile</scope>
		</dependency>

		<dependency>
			<groupId>log4j</groupId>
			<artifactId>log4j</artifactId>
			<version>1.2.14</version>
			<scope>provided</scope>
		</dependency>

		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.1</version>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<!--  configure the GWT-Maven plugin -->
			<plugin>
				<groupId>com.totsp.gwt</groupId>
				<artifactId>maven-googlewebtoolkit2-plugin</artifactId>
				<version>2.0-beta26</version>
				<configuration>
					<logLevel>INFO</logLevel>
					<compileTargets>
						<value>com.smartgwt.sample.showcase.Showcase</value>
					</compileTargets>
					<runTarget>
						com.smartgwt.sample.showcase.Showcase/Showcase.html
					</runTarget>
					<!--style>DETAILED</style-->
					<noServer>false</noServer>
					<extraJvmArgs>-Xmx1024m</extraJvmArgs>
					<!--i18nConstantsNames>
						<value>
						com.totsp.sample.client.AppConstants
						</value>
						</i18nConstantsNames>
						<i18nMessagesNames>
						<value>
						com.totsp.sample.client.AppMessages
						</value>
						</i18nMessagesNames-->
					<!--
						this parameter is VERY important with automatic mode - has to
						match the version in your declared deps
					-->
					<!--
						if this is set incorrect, or left out and default does not match
						(default is 1.5.3) you will have mysterious errors
					-->
					<gwtVersion>${gwtVersion}</gwtVersion>
				</configuration>
				<executions>
					<execution>
						<goals>
							<goal>mergewebxml</goal>
							<!--goal>i18n</goal-->
							<goal>compile</goal>
							<goal>test</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<!--  Use the dependency plugin to unpack gwt-dev-PLATFORM-libs.zip -->
			<!--
				(this is a replacement for the old "automatic" mode - useful if you
				don't have GWT installed already, or you just want a maven way to
				handle gwt deps)
			-->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
				<executions>
					<execution>
						<id>unpack</id>
						<phase>compile</phase>
						<goals>
							<goal>unpack</goal>
						</goals>
						<configuration>
							<artifactItems>
								<artifactItem>
									<groupId>com.google.gwt</groupId>
									<artifactId>gwt-dev</artifactId>
									<version>${gwtVersion}</version>
									<classifier>
										${platform}-libs
									</classifier>
									<type>zip</type>
									<overWrite>false</overWrite>
									<outputDirectory>
										${settings.localRepository}/com/google/gwt/gwt-dev/${gwtVersion}
									</outputDirectory>
								</artifactItem>
							</artifactItems>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<!--
				If you want to use the target/web.xml file mergewebxml produces,
				tell the war plugin to use it. 
				Also, exclude what you want from the final artifact here. 
			-->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-war-plugin</artifactId>
				<configuration>
					<webXml>target/web.xml</webXml>
					<warSourceExcludes>.gwt-tmp/**</warSourceExcludes>
				</configuration>
			</plugin>
			<!--  tell the compiler we can use 1.5 -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<configuration>
					<source>1.5</source>
					<target>1.5</target>
				</configuration>
			</plugin>
		</plugins>
	</build>

	<!--  profiles (with activation per platform) -->
	<profiles>
		<profile>
			<id>gwt-dev-windows</id>
			<properties>
				<platform>windows</platform>
			</properties>
			<activation>
				<activeByDefault>true</activeByDefault>
				<os>
					<family>windows</family>
				</os>
			</activation>
		</profile>
		<profile>
			<id>gwt-dev-mac</id>
			<properties>
				<platform>mac</platform>
			</properties>
			<activation>
				<activeByDefault>false</activeByDefault>
				<os>
					<family>mac</family>
				</os>
			</activation>
		</profile>
		<profile>
			<id>gwt-dev-linux</id>
			<properties>
				<platform>linux</platform>
			</properties>
			<activation>
				<activeByDefault>false</activeByDefault>
				<os>
					<name>linux</name>
				</os>
			</activation>
		</profile>
	</profiles>
</project>

I have a local repository that host smartgwt.jar, however, you should be able to setup smartgwt.jar on the Maven Central so that every developer can share (if you don’t want to host a maven repository). Maven Central can host both snapshot and release build at same time, the only different is the version id.

Thanks

Sample maven project

I’ve added sample project

svn co https://gwtstarter.svn.sourceforge.net/svnroot/gwtstarter/trunk/smartgwt-starter

change dir to directory with pom.xml

mvn eclipse:eclipse

mvn gwt:gwt

it should download all artifacts (including smartGwt) and start it in hosted mode.

(Step 2. is only needed if you using eclipse)

Thanks,
–MG

Great. Just curious why you decided on sourceforge vs google code. In my experience google code works much better ( no ads, faster etc )

Sanjiv

I was lazy to open another account and used the one I had on SF :slight_smile:

central repo

did smartgwt ever get deployed to the central repo? I cannot use it until it is. Thanks

Which repository are you specifically referring to?

http://repo2.maven.org/maven2/, or mvnrepository.com?

I believe that mvnrepository.com is just an indexer, not a maven repository.

I don’t know if you need it, but I found a guide explaining how to upload to Maven Central Repository http://maven.apache.org/guides/mini/guide-central-repository-upload.html (never did it, though).

You can set up a company repository, download the smartgwt jar, and deploy it to your company’s repository.

If you work alone, simply install the jar in your local repository:
http://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html

If you only use artifacts available in the central repo, you miss out on a LOT of libraries!