Stepper with maven

I’ve unsuccessfully tried to add this add-on to an existing Vaading project using maven.
Does this add-on have the correct structure to be added in such a way?

There are many threads in the forum regarding maven add-on/widgetset problems. Is there a step-by-step procedure I can follow?

Here is how to use add-ons with maven in 10 steps. The steps below are untested, so please reply to the thread if I missed something.

  1. download add-on jar

  2. Using command line go to the directory where the jar file is located

  3. Assuming that you just wanna store the dependency on your local repository you can run something like

mvn install:install-file -Dfile=nameOfAddOn-1.0.jar -DgroupId=org.your.group -DartifactId=someArtifactId -Dpackaging=jar -Dversion=1.0
  1. Somewhere under src/main/java directory in your project add a GWT module descriptor file
    For example make a package called org.your.group.gwt and then in there make a SomethingWidgetSet.gwt.xml

In this file add something like the following

<module>
 <!--
 This file is automatically updated based on new dependencies by the
 goal "vaadin:update-widgetset".

 Running the goals "gwt:clean gwt:compile" may be required to compile
 the widgetset until http://jira.codehaus.org/browse/MGWT-148 is
 resolved. 
 -->

 <!--
 This is needed because of a bug in gwt-maven-plugin 1.2
 (http://jira.codehaus.org/browse/MGWT-147):
 modules without entry points are never compiled.
 -->
 <entry-point class="com.vaadin.terminal.gwt.client.DefaultWidgetSet" />

 <!-- Inherit DefaultWidgetSet -->
 <inherits name="com.vaadin.terminal.gwt.DefaultWidgetSet" /> 

 <!-- WidgetSet default theme --> 
 <!-- <stylesheet src="colorpicker/styles.css"/> -->

</module>
  1. In the web.xml file for your project, something like the following should be present (this might not be strictly necessary, but doesn’t hurt either)
 <servlet>
 <servlet-name>Vaadin Application Servlet</servlet-name>
 <servlet-class>com.vaadin.terminal.gwt.server.ApplicationServlet</servlet-class>
 <init-param>
 <param-name>widgetset</param-name>
 <param-value>org.your.group.gwt.SomethingWidgetSet</param-value>
 </init-param>
 </servlet>
  1. If you made your project with the vaadin-archetype-sample, your pom file is more or less ready.
    If you made your project with vaadin-archetype-clean then you have to uncomment the commented code.

It is probably a good idea to change vaadin dependency to 6.3 (it defaults to 6.2 at time of writing)
and gwt-user to 2.0.3 (it defaults to 1.7.1 at time of writing).

  1. Also add a dependency to the addOn that we mavenized in step 3
    Something like
<dependency>
 <groupId>org.your.group</groupId>
 <artifactId>someArtifactId</artifactId>
 <version>1.0</version>
 </dependency>
  1. Now if you run a mvn clean vaadin:update-widgetset or even a mvn clean install
    it should detect your addOn/widgetset and compile it.

If you see something like

[ERROR]
 Apr 27, 2010 7:01:03 PM com.vaadin.terminal.gwt.widgetsetutils.ClassPathExplorer getAvailableWidgetSets
[ERROR]
 INFO: Widgetsets found from classpath:
[ERROR]
 org.vaadin.henrik.refresher.RefresherApplicationWidgetset in jar:file:/.m2/repository/vaadin/addon/refresher/1.0/refresher-1.0.jar!/
[ERROR]
 org.your.group.gwt.SomethingWidgetSet in file:/workspace/myproject/src/main/java
[ERROR]
 com.vaadin.terminal.gwt.DefaultWidgetSet in jar:file:/.m2/repository/com/vaadin/vaadin/6.3.0/vaadin-6.3.0.jar!/

It is not actually an error. Just maven getting confused when it is doing info statements

  1. Refresh your SomethingWidgetSet file and notice that there is a new line of text at the bottom referring to the addOn

  2. You should now be able to use the addOn in your java code

I did not test this procedure, but overall it looks correct to me.

Note that steps 4-6 are only needed the first time, not when adding other add-ons to a project after the first. Furthermore, steps 4-5 are already done in the vaadin-archetype-sample, although redoing them (perhaps just copying files) to change the name of the widgetset might be useful.

So when adding a second add-on to a project, the steps are something like:

a) download the add-on and run mvn install:install-file to install the add-on to your local repository
b) add a dependency to the add-on
c) mvn clean vaadin:update-widgetset
d) refresh the project and use the add-on

Hi,

A new version (1.2.0) of the archetypes are out and they now default to Vaadin 6.3.1 and GWT 2.0.3.
I used the following process to verify that add-ons work with Maven and the new archetype:

  1. [quote]
    mvn archetype:generate -DarchetypeGroupId=com.vaadin -DarchetypeArtifactId=vaadin-archetype-widget -DarchetypeVersion=1.2.0 -DgroupId=mygroup -DartifactId=tst -Dversion=1.0
    [/quote]

  2. Download add-on e.g., playingcards-0.3.2.jar

  3. [quote]
    mvn install:install-file -Dfile=playingcards-0.3.2.jar -DgroupId=org.vaadin.artur -DartifactId=playingcards -Dpackaging=jar -Dversion=0.3.2
    [/quote]

  4. Add a dependency to the add-on to pom.xml:

<dependency>
	<groupId>org.vaadin.artur</groupId>
	<artifactId>playingcards</artifactId>
	<version>0.3.2</version>
</dependency>
  1. Add test code to see it works. Edit the application.java and add:
Card c = new Card(Suite.CLUBS,12);
	window.addComponent(c);
  1. [quote]
    mvn vaadin:update-widgetset install
    [/quote]

Sure hope we get Maven support for the Directory one day so you would get away with just adding the dependency to the pom.xml.

I can confirm that these steps worked for me and solved the problem I was having with trying to get an Add-On working. I was able to get this playingcards add on working and then was also able to get the VaadinVisualizations addon working as well in the same test project - which I had previously been struggling to get working.

One odd thing was that the first time I built this project I only did mvn install and got an error (which I didn’t save sorry), but once I did mvn vaadin:update-widgetset install everything started to work properly. The other part to this that I can’t explain is that when I tried to replicate the earlier problem by doing mvn clean install it didn’t fail. So I’m not sure what’s happening here but thought it might be worth mentioning that mvn vaadin:update-widgetset install is a good thing to try if you are having problems.

I updated to Vaadin 6.4.0 and ran into problems with the WidgetSet.

I saw in the vaadin-archetype-sample that gwt-maven-plugin version has been changed from 1.2 to 1.3 and that the is no longer needed in the .gwt.xml file

You can see my gwt.xml file in my earlier post.
Is it correct that it now should only have the following:

<module>
	<inherits name="com.vaadin.terminal.gwt.DefaultWidgetSet" />
    <inherits name="org.vaadin.risto.stepper.widgetset.StepperWidgetset" />
</module>

Or am I mean to use a syntax as indicated on the 6.4.0 release notes

<replace-with class="com.example.MyExtendedWidgetSet">
        <when-type-is class="com.vaadin.terminal.gwt.client.WidgetSet" />
    </replace-with>

Could you please elaborate on how to use that syntax, or otherwise make it work?

What problems - or is it just that the instructions are not clear?

Some errors during widgetset compilation? Your widgets not getting included in the widgetset?

This looks correct to me as the content of a widgetset. As you said, the entry point line should be removed (it was redundant already earlier, only needed as a workaround for a Maven GWT plugin bug) and you should use the 1.3-SNAPSHOT version of the Maven GWT plugin.

This is only for very special cases where you do need to override functionality in the widgetset class.
If you don’t know why you would need to do that, you probably don’t need to do it.

Thanks for swift reply (as usual).

I’ve come a bit further…

When I run mvn clean install it compiles fine.
The problem is when using the maven-jetty plugin while pointing to the 1.3-SNAPSHOT version.

<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>1.3-SNAPSHOT</version>

When you then call jetty:run

It fails with the following error:

Failed to execute goal org.mortbay.jetty:maven-jetty-plugin:6.1.24:run (default-cli) on project myProject: Unable to parse configuration of mojo org.mortbay.jetty:maven-jetty-plugin:6.1.24:run for parameter baseResource: Setter org.mortbay.resource.ResourceCollection.setResourcesAsCSV( java.lang.Class ) threw exception when called with parameter 'src/main/webapp,/home/benny/heliosWorkspace/myProject/target/myProject-1-SNAPSHOT': java.lang.IllegalArgumentException: file:/home/benny/heliosWorkspace/myProject/target/myProject-1-SNAPSHOT is not an existing directory. InvocationTargetException

I understand this is more a maven problem than a vaadin problem, but perhaps you’ve seen it before

It seems like it is the 1.3-SNAPSHOT version of gwt-maven-plugin that does not compile the widgetset, and that is why I get that error I mentioned before (since the path …myProject/target/myProject-1-SNAPSHOT is never made).

When using 1.2-SNAPSHOT the output is:

.
.
.
 --- maven-resources-plugin:2.4.1:resources (default-resources) @ myProject ---
[INFO]
 Using 'UTF-8' encoding to copy filtered resources.
[INFO]
 skip non existing resourceDirectory /home/bhj/heliosWorkspace/myProject/src/main/resources
[INFO]
 
[INFO]
 --- gwt-maven-plugin:1.2-SNAPSHOT:resources (default) @ myProject ---
[INFO]
 auto discovered modules [broadway.myProject.gwt.myProjectWidgetSet]

[INFO]
 1 source files copied from GWT module broadway.myProject.gwt.myProjectWidgetSet
[INFO]
 
[INFO]
 --- maven-compiler-plugin:2.0.2:compile (default-compile) @ myProject ---
[INFO]
 Nothing to compile - all classes are up to date
[INFO]
 
[INFO]
 --- gwt-maven-plugin:1.2-SNAPSHOT:compile (default) @ myProject ---
[INFO]
 using GWT jars from project dependencies : 2.0.3
[INFO]
 auto discovered modules [broadway.myProject.gwt.myProjectWidgetSet]

[INFO]
 establishing classpath list (scope = compile)
[INFO]
 Compiling module broadway.myProject.gwt.myProjectWidgetSet
[INFO]
    Scanning for additional dependencies: jar:file:/home/bhj/.m2/repository/com/vaadin/vaadin/6.3.4/vaadin-6.3.4.jar!/com/vaadin/terminal/gwt/client/DefaultWidgetSet.java
[INFO]
       Computing all possible rebind results for 'com.vaadin.terminal.gwt.client.WidgetMap'
[INFO]
          Rebinding com.vaadin.terminal.gwt.client.WidgetMap
[INFO]
             Invoking com.google.gwt.dev.javac.StandardGeneratorContext@88d1f2
[INFO]
                Detecting Vaadin components in classpath to generate WidgetMapImpl.java ...
[INFO]
                Widget set will contain implementations for following components: 
[INFO]
                	com.vaadin.ui.AbsoluteLayout
[INFO]
                	com.vaadin.ui.Accordion
[INFO]
                	com.vaadin.ui.Button
[INFO]
                	com.vaadin.ui.CheckBox
[INFO]
                	com.vaadin.ui.ComboBox
.
.
.

When using 1.3-SNAPSHOT the output is:

.
.
.
 [INFO]
 --- maven-resources-plugin:2.4.1:resources (default-resources) @ myProject ---
[INFO]
 Using 'UTF-8' encoding to copy filtered resources.
[INFO]
 skip non existing resourceDirectory /home/bhj/heliosWorkspace/myProject/src/main/resources
[INFO]
 
[INFO]
 --- gwt-maven-plugin:1.3-SNAPSHOT:resources (default) @ myProject ---
[INFO]
 auto discovered modules [broadway.myProject.gwt.myProjectWidgetSet]

[INFO]
 1 source files copied from GWT module broadway.myProject.gwt.myProjectWidgetSet
[INFO]
 
[INFO]
 --- maven-compiler-plugin:2.0.2:compile (default-compile) @ myProject ---
[INFO]
 Nothing to compile - all classes are up to date
[INFO]
 
[INFO]
 --- vaadin-maven-plugin:1.0.0:update-widgetset (default) @ myProject ---
[INFO]
 auto discovered modules [broadway.myProject.gwt.myProjectWidgetSet]

[INFO]
 Updating widgetset broadway.myProject.gwt.myProjectWidgetSet
[INFO]
 establishing classpath list (scope = compile)
[ERROR]
 Jul 15, 2010 3:28:51 PM com.vaadin.terminal.gwt.widgetsetutils.ClassPathExplorer getAvailableWidgetSets
[ERROR]
 INFO: Widgetsets found from classpath:
[ERROR]
 	org.vaadin.henrik.refresher.RefresherApplicationWidgetset in jar:file:/home/bhj/.m2/repository/vaadin/addon/refresher/1.0/refresher-1.0.jar!/
[ERROR]
 	broadway.myProject.gwt.myProjectWidgetSet in file:/home/bhj/heliosWorkspace/myProject/src/main/java
[ERROR]
 	com.vaadin.terminal.gwt.DefaultWidgetSet in jar:file:/home/bhj/.m2/repository/com/vaadin/vaadin/6.4.0/vaadin-6.4.0.jar!/
[ERROR]
 	org.vaadin.risto.stepper.widgetset.StepperWidgetset in jar:file:/home/bhj/.m2/repository/vaadin/addon/stepper/0.3/stepper-0.3.jar!/
[ERROR]
 
[INFO]
 
[INFO]
 --- maven-resources-plugin:2.4.1:testResources (default-testResources) @ myProject ---
[INFO]
 Using 'UTF-8' encoding to copy filtered resources.
[INFO]
 skip non existing resourceDirectory /home/bhj/heliosWorkspace/myProject/src/test/resources
[INFO]
 
[INFO]
 --- maven-compiler-plugin:2.0.2:testCompile (default-testCompile) @ myProject ---
[INFO]
 Nothing to compile - all classes are up to date
[INFO]
 
[INFO]
 --- maven-jetty-plugin:6.1.24:run (default-cli) @ myProject ---
[INFO]
 ------------------------------------------------------------------------
[INFO]
 BUILD FAILURE
.
.
.

Notice that in the latter output, the widgetset is found, but not compiled. And It prints vaadin-maven-plugin:1.0.0:update-widgetset instead of gwt-maven-plugin:1.2-SNAPSHOT:compile

I cannot use version 1.2-SNAPSHOT with vaadin 6.4.0 either. It fails with the following output:

.
.
.
[INFO]
 --- gwt-maven-plugin:1.2-SNAPSHOT:compile (default) @ playbill ---
[INFO]
 using GWT jars from project dependencies : 2.0.3
[INFO]
 auto discovered modules [broadway.playbill.gwt.PlaybillWidgetSet]

[INFO]
 establishing classpath list (scope = compile)
[INFO]
 Compiling module broadway.playbill.gwt.PlaybillWidgetSet
[INFO]
    Finding entry point classes
[INFO]
       [ERROR]
 Unable to find type 'com.vaadin.terminal.gwt.client.DefaultWidgetSet'
[INFO]
          [ERROR]
 Hint: Check that the type name 'com.vaadin.terminal.gwt.client.DefaultWidgetSet' is really what you meant
[INFO]
          [ERROR]
 Hint: Check that your classpath includes all required source roots
.
.
[ERROR]
 Failed to execute goal org.codehaus.mojo:gwt-maven-plugin:1.2-SNAPSHOT:compile (default) on project playbill: Command
.
.
.
.

Could it be that when you used 1.2, it left the timestamps of the compiled widgetset such that 1.3 thinks nothing has changed. If so, you could try
mvn clean
, or maybe touching the widgetset.gwt.xml file or manually removing the compiled widgetset.

I put this problem on hold for a while, but tried again now with Vaadin 6.4.1, still without luck.

It works like a charm when running
mvn install
or
clean vaadin:update-widgetset install jetty:run
… etc

as long as you have the install goal, it compiles the widgetsets.
But when the install goal is used, the hot-deploy in the maven-jetty-plugin (scanIntervalSeconds) doesn’t work. So it becomes rather tedious to write UI code.

When using Vaadin 6.3.4 (or earlier) and gwt-maven-plugin version 1.2-SNAPSHOT I just did a jetty:run and code+widgetsets were compiled and put in the target directory, where the maven-jetty-plugin picks it up.

Vaadin 6.4 and newer seems to be require gwt-maven-plugin 1.3-SNAPSHOT.
But version 1.3-SNAPSHOT must work slightly differently, because it does not compile and produce a war file in the target directory when doing jetty:run. And hence, the maven-jetty-plugin failes with an IllegalArgumentException: file:/blah/somedir/target/projectName-1-SNAPSHOT is not an existing directory.

The question:
Why is Vaadin 6.4+ not compatible with gwt-maven-plugin version 1.2-SNAPSHOT which was working fine? (At least with the entry-point in the gwt.xml file)
Or even better, if you can figure out why gwt-maven-plugin 1.3-SNAPSHOT doesn’t build the war file unless you run the install goal, that would be fantastic.

This is more of a Maven issue than a Vaadin issue, but the Vaadin archetypes could be updated at some point if there are better ways to do things.

Does it work if you use
mvn vaadin:update-widgetset package jetty:run
or
mvn vaadin:update-widgetset gwt:compile package jetty:run

You can also tell the jetty plugin to monitor additional directories with the scanTargets and scanTargetPatterns parameters etc. - see the plugin documentation.

The plugin version 1.2 also had some other problems, e.g. not recompiling the widgetset if only the GWT module file had changed. On the other hand, 1.3-SNAPSHOT (and probably also 1.2) does seem to be too aggressive in recompiling the widgetset in Vaadin projects when only server-side code changes - this needs to be investigated in more detail.

In Vaadin 6.4, the entry point (which was deprecated already a long time ago in Vaadin widgetsets) is no longer supported the way it used to be.

Thanks for detailed reply and good suggestions.

Using the ‘package’ goal makes it work, but hot-deploy does not. When I have time I will investigate further, and post the working solution here.

Got it!

  1. It is no longer possible to simply run jetty:run. You must do gwt:compile jetty:run

  2. In the vaadin-sample archetype there is an error in the gwt-maven-plugin configuration. The tag and its contents should not be enclosed in . When it is there, the is simply ignored, and vaadin cannot find the widgetsets.

So it should look something like this

<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>gwt-maven-plugin</artifactId>
				<version>1.3-SNAPSHOT</version>
				<configuration>
					<!-- if you don't specify any modules, the plugin will find them -->
					<modules>
						<module>path.to.my.gwt.WidgetSet</module>
					</modules>
					<webappDirectory>${project.build.directory}/${project.build.finalName}/VAADIN/widgetsets</webappDirectory>
					<!-- On Mac running Snow Leopard, add "-d32" -->
					<!-- This causes error messages (but build works) in phase "package":
						two processes would use the same debug port -->
					<!--extraJvmArgs>-Xmx512M -Xss1024k -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8998</extraJvmArgs -->
					<extraJvmArgs>-Xmx512M -Xss1024k</extraJvmArgs>
					<runTarget>playbill</runTarget>
					<hostedWebapp>${project.build.directory}/${project.build.finalName}</hostedWebapp>
					<noServer>true</noServer>
					<port>8080</port>
					<soyc>false</soyc>
				</configuration>
				<executions>
					<execution>
						<goals>
							<goal>resources</goal>
							<goal>compile</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

Do that, run the above command and voila. Widgetsets and hotdeploy works.

Thanks for pointing this out.

This should be fixed in the archetype versions 1.3.2 to be released later today or tomorrow, could you also give them a spin once they are out.

Hi,

I’m running into a problem getting my project build under linux with version 6.4.4 of vaadin jar, using gwt version 2.0.4.

I have a utility project with package structure:
[font=Courier New]


   src/main/java
     |
     |--com.tnt.vaadin.widgetset
     |     |
     |     |--Refresher.java
     |     |--RefresherApplicationWidgetSet.gwt.xml
     |
     |--com.tnt.vaadin.widgetset.client.ui
     |     |
     |     |--VRefresher.java

[/font]

I’m using the following configuration within the pom file of this project (this is not a web project, but a utility jar, so the project.build.directory is actually target):
[font=Courier New]


  <build>
    <plugins>
      <!-- Compiles your custom GWT components with the GWT compiler -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>gwt-maven-plugin</artifactId>
        <version>1.3-SNAPSHOT</version>
        <configuration>
          <!-- if you don't specify any modules, the plugin will find them -->
           <modules>
             <module>com.tnt.vaadin.widgetset.RefresherApplicationWidgetSet</module>
           </modules>
           <webappDirectory>${project.build.directory}/classes/VAADIN/widgetsets</webappDirectory>
          <extraJvmArgs>-Xmx512M -Xss1024k</extraJvmArgs>
          <runTarget>clean</runTarget>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>resources</goal>
              <goal>compile</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <!-- Updates Vaadin widgetset definitions based on project dependencies. -->
      <plugin>
        <groupId>com.vaadin</groupId>
        <artifactId>vaadin-maven-plugin</artifactId>
        <version>1.0.1</version>
        <executions>
          <execution>
            <configuration>
              <!-- If you don't specify any modules, the plugin will find them. -->
                <modules>
                  <module>com.tnt.vaadin.widgetset.RefresherApplicationWidgetSet</module> 
                </modules>
            </configuration>
            <goals>
              <goal>update-widgetset</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <dependencies>
    <dependency>
      <groupId>com.vaadin</groupId>
      <artifactId>vaadin</artifactId>
      <version>6.4.4</version>
    </dependency>
    <dependency>
      <groupId>org.vaadin.henrik</groupId>
      <artifactId>refresher</artifactId>
      <version>1.0.0</version>
    </dependency>
    <dependency>
      <groupId>com.google.gwt</groupId>
      <artifactId>gwt-user</artifactId>
      <version>2.0.4</version>
    </dependency>
  </dependencies>

[/font]

Building the project using ‘mvn clean install’ works fine when running under Windows: the generated files are compiled to target/classes/VAADIN/widgetsets and they are also packaged in the final jar file being build.

However, when I run the build on our linux build server (which does an ‘mvn deploy’), the compilation of the widget fails with a message:

GWT Module src.main.java.com.tnt.vaadin.widgetset.RefresherApplicationWidgetSet not found in project sources or resources

When I go back to Vaadin jar 6.3.4 and gwt version 2.0.3, it both compiles under windows and linux.

Any idea why this is going wrong under linux using Vaadin jar version higher than 6.3.4? It seems that Vaadin jar adds the src/main/java source folder in front of the package, which I think it should not do.
Is there a work around to get this working under linux?

Kind regards,
Manfred

I assume “mvn clean vaadin:update-widgetset gwt:compile” on the linux server does not help.

For GWT compilation to work, the source folder has to be on the classpath. The Vaadin Maven plugin can create a widgetset if it does not exist, but creates it in the first directory on the classpath - if the widgetset already exists, the order of the classpath does not matter for it.

Why this directory is added as a part of the package path is not clear to me, and might have something to do with having the root of the project on the classpath before the source directory - but how to control this, and why it stopped working? The changes in WidgetSetBuilder, at least, are quite small between these versions, and you seem to be using the same version of the Vaadin Maven plugin.

At what phase does this problem occur? Updating the widgetset or compiling it?
If it is related to the widgetset update, you could try moving the configuration section outside of the executions section. You could also try to isolate this by changing only the Vaadin version or only the GWT version, and checking what breaks this.

So it seems the plugin is working OK.
I haven’t been able to debug the WidgetSetBuilder or any of the other classes withing the Vaadin.jar yet because the plugin excutes it in a separate process.

The root of the project doesn’t seem to be on the classpath.

It looks like it is failing in the compilation phase.
The output of maven is as follows:

[tomcat@NLGHOL04 374e58a11dfb42db]
$ mvnDebug clean install -Denforcer.skip=true -Dmaven.test.skip=true
Preparing to Execute Maven in Debug Mode
Listening for transport dt_socket at address: 8000
[INFO]
 Scanning for projects...
[INFO]
 ------------------------------------------------------------------------
[INFO]
 Building Technical Component: Vaadin Framework
[INFO]
    task-segment: [clean, install]

[INFO]
 ------------------------------------------------------------------------
[INFO]
 [clean:clean {execution: default-clean}]

[INFO]
 Deleting directory /usr/local/TeamCity/buildAgent2/work/374e58a11dfb42db/target
[INFO]
 Deleting directory /usr/local/TeamCity/buildAgent2/work/374e58a11dfb42db/target/classes
[INFO]
 Deleting directory /usr/local/TeamCity/buildAgent2/work/374e58a11dfb42db/target/test-classes
[INFO]
 Deleting directory /usr/local/TeamCity/buildAgent2/work/374e58a11dfb42db/target/site
[INFO]
 [enforcer:enforce {execution: default}]

[INFO]
 Skipping Rule Enforcement.
[INFO]
 [build-helper:add-source {execution: add-source}]

[INFO]
 Source directory: /usr/local/TeamCity/buildAgent2/work/374e58a11dfb42db/src/main/generated added.
[INFO]
 [utils:executePlugin {execution: ejb-versionif-execution}]

[INFO]
 Executing goal updateVersion within execution updateVersionIF for plugin Plugin [com.tnt.maven.plugins:maven-versionif-plugin]

[INFO]
 [versionif:updateVersion {execution: updateVersionIF}]

[INFO]
 [resources:resources {execution: default-resources}]

[INFO]
 Using default encoding to copy filtered resources.
[INFO]
 [gwt:resources {execution: default}]

[INFO]
 auto discovered modules [com.tnt.vaadin.widgetset.RefresherApplicationWidgetSet]

[INFO]
 1 source files copied from GWT module com.tnt.vaadin.widgetset.RefresherApplicationWidgetSet
[INFO]
 [compiler:compile {execution: default-compile}]

[INFO]
 Compiling 32 source files to /usr/local/TeamCity/buildAgent2/work/374e58a11dfb42db/target/classes
[INFO]
 [utils:executePlugin {execution: aspectJ-weaving-execution}]

[INFO]
 [vaadin:update-widgetset {execution: default}]

[INFO]
 auto discovered modules [com.tnt.vaadin.widgetset.RefresherApplicationWidgetSet]

[INFO]
 Updating widgetset com.tnt.vaadin.widgetset.RefresherApplicationWidgetSet
[INFO]
 establishing classpath list (scope = compile)
[ERROR]
 Sep 24, 2010 10:11:11 AM [b]
com.vaadin.terminal.gwt.widgetsetutils.ClassPathExplorer getAvailableWidgetSets
[/b][ERROR]
 INFO: Widgetsets found from classpath:
[ERROR]
         com.vaadin.terminal.gwt.DefaultWidgetSet in jar:file:/home/tomcat/.m2/repository/com/vaadin/vaadin/6.4.4/vaadin-6.4.4.jar!/
[ERROR]
         org.vaadin.henrik.refresher.RefresherApplicationWidgetset in jar:file:/home/tomcat/.m2/repository/org/vaadin/henrik/refresher/1.0.0/refresher-1.0.0.jar!/
[ERROR]
         [b]
src.main.java.
[/b]com.tnt.vaadin.widgetset.RefresherApplicationWidgetSet in file:/usr/local/TeamCity/buildAgent2/work/374e58a11dfb42db
[ERROR]
         target.classes.com.tnt.vaadin.widgetset.RefresherApplicationWidgetSet in file:/usr/local/TeamCity/buildAgent2/work/374e58a11dfb42db
[ERROR]
         com.tnt.vaadin.widgetset.RefresherApplicationWidgetSet in file:/usr/local/TeamCity/buildAgent2/work/374e58a11dfb42db/src/main/java
[ERROR]
         [b]
src.main.resources
[/b].com.tnt.vaadin.widgetset.RefresherApplicationWidgetSet in file:/usr/local/TeamCity/buildAgent2/work/374e58a11dfb42db
[ERROR]

[INFO]
 [resources:testResources {execution: default-testResources}]

[INFO]
 Using default encoding to copy filtered resources.
[INFO]
 [compiler:testCompile {execution: default-testCompile}]

[INFO]
 Not compiling test sources
[INFO]
 [surefire:test {execution: default-test}]

[INFO]
 Tests are skipped.
[INFO]
 [gwt:compile {execution: default}]

[INFO]
 using GWT jars from project dependencies : 2.0.4
[INFO]
 auto discovered modules [com.tnt.vaadin.widgetset.RefresherApplicationWidgetSet]

[INFO]
 establishing classpath list (scope = compile)
[INFO]
 establishing classpath list (scope = compile)
[INFO]
 establishing classpath list (scope = compile)
[INFO]
 establishing classpath list (scope = compile)
[INFO]
 ------------------------------------------------------------------------
[ERROR]
 BUILD ERROR
[INFO]
 ------------------------------------------------------------------------
[INFO]
 GWT Module src.main.java.com.tnt.vaadin.widgetset.RefresherApplicationWidgetSet not found in project sources or resources.
[INFO]
 ------------------------------------------------------------------------
[INFO]
 For more information, run Maven with the -e switch
[INFO]
 ------------------------------------------------------------------------
[INFO]
 Total time: 28 seconds
[INFO]
 Finished at: Fri Sep 24 08:11:15 UTC 2010
[INFO]
 Final Memory: 31M/253M
[INFO]
 ------------------------------------------------------------------------

I’ve moved the configuration outside the execution tags, but that doesn’t help.

I left Vaadin version 6.3.4 and changed GWT version to 2.0.3 and 2.0.4. No problem.
Changing to Vaadin version 6.4.4 fails (both with version 2.0.3 or 2.0.4 of GWT version).

In the updateWidgetSet method in the WidgetSetBuilder class, the following code is executed:

Map<String, URL> availableWidgetSets = ClassPathExplorer.getAvailableWidgetSets();

It seems that the getAvailableWidgetSets has been significantly changed between the two versions. Could something be going wrong here? Maybe in this part it adds src.main.java before the package when it runs under Linux?

Hi,

I think your problem is the classpath entry

"/usr/local/TeamCity/buildAgent2/work/374e58a11dfb42db/${sourceDirectory}"

As you are running the compile using “/bin/sh -c” the shell will try to replace ${sourceDirectory} with the sourceDirectory variable. As it is not defined it will be replaced by an empty string and the result is that you have

/usr/local/TeamCity/buildAgent2/work/374e58a11dfb42db/ on the classpath and the extra directories will therefore also be scanned.

You should also be able to verify this by increasing the log level and looking at the “classpathLocations values:” output logged by ClassPathExplorer. This contains the actual classpath that it uses.

Hi,

Thanks for looking into this.
We received a vaadin-6.4.6.dev20101005.jar with the ClassPathExplorer from the 6.3 branch, and this seemed to work for us. But I think this is just because the order of scanning the class folders is different in this version.

So what we need to do is setup a sourceDirectory variable for our buildplan in TeamCity I guess?
Or is this something we should configure in the pom file for the gwt-maven-plugin or vaadin-maven-plugin? Which one is establishing this classpath.

I’ve run the build in debug mode, and it seems that sourceDirectory is resolved to /usr/local/TeamCity/buildAgent2/work/374e58a11dfb42db/src/main/java, which seems OK to me.
But GWT SDK execution classpath contains /usr/local/TeamCity/buildAgent2/work/374e58a11dfb42db/${sourceDirectory}:

[05:57:45]
: [DEBUG]
 Configuring mojo 'com.vaadin:vaadin-maven-plugin:1.0.1:update-widgetset' -->
[05:57:45]
: [DEBUG]
   (f) extraJvmArgs = -Xmx512m
[05:57:45]
: [DEBUG]
   (f) modules = [com.tnt.vaadin.widgetsets.TNTRefresherApplicationWidgetset]

[05:57:45]
: [DEBUG]
   (f) project = MavenProject: com.tnt.tech-tc:Tech-VaadinFramework:1.0.0-SNAPSHOT @ /usr/local/TeamCity/buildAgent2/work/374e58a11dfb42db/pom.xml
[color=#0000FF]
[b]
[05:57:45]
: [DEBUG]
   (f) sourceDirectory = /usr/local/TeamCity/buildAgent2/work/374e58a11dfb42db/src/main/java
[/b]
[/color]
[05:57:45]
: [DEBUG]
 -- end configuration --
[05:57:45]
: [INFO]
 [vaadin:update-widgetset {execution: default}]

[05:57:45]
: [INFO]
 Updating widgetset com.tnt.vaadin.widgetsets.TNTRefresherApplicationWidgetset
[05:57:45]
: [INFO]
 establishing classpath list (scope = compile)
[05:57:45]
: [DEBUG]
 candidate artifacts : 14
[05:57:45]
: [DEBUG]
 GWT SDK execution classpath :
[05:57:45]
: [DEBUG]
    /usr/local/TeamCity/buildAgent2/work/374e58a11dfb42db/src/main/java
[05:57:45]
: [DEBUG]
    /usr/local/TeamCity/buildAgent2/work/374e58a11dfb42db/src/main/generated
[05:57:45]
: [DEBUG]
    /usr/local/TeamCity/buildAgent2/work/374e58a11dfb42db/src/main/resources
[color=#0000FF]
[b]
[05:57:45]
: [DEBUG]
    /usr/local/TeamCity/buildAgent2/work/374e58a11dfb42db/${sourceDirectory}
[/b]
[/color]
[05:57:45]
: [DEBUG]
    /usr/local/TeamCity/buildAgent2/work/374e58a11dfb42db/ejbModule
[05:57:45]
: [DEBUG]
    /usr/local/TeamCity/buildAgent2/work/374e58a11dfb42db/target/classes
[05:57:45]
: [DEBUG]
    /home/tomcat/.m2/repository/com/vaadin/vaadin/6.4.6.dev20101005/vaadin-6.4.6.dev20101005.jar
[05:57:45]
: [DEBUG]
    /home/tomcat/.m2/repository/org/vaadin/henrik/refresher/1.0.0/refresher-1.0.0.jar
[05:57:45]
: [DEBUG]
    /home/tomcat/.m2/repository/com/google/gwt/gwt-user/2.0.4/gwt-user-2.0.4.jar
[05:57:45]
: [DEBUG]
    /home/tomcat/.m2/repository/cglib/cglib/2.2/cglib-2.2.jar
[05:57:45]
: [DEBUG]
    /home/tomcat/.m2/repository/asm/asm/3.1/asm-3.1.jar
[05:57:45]
: [DEBUG]
    /home/tomcat/.m2/repository/com/tnt/tech-tc/Tech-SharedUtils-Dvn/1.0.16-SNAPSHOT/Tech-SharedUtils-Dvn-1.0.16-SNAPSHOT.jar
[05:57:45]
: [DEBUG]
    /home/tomcat/.m2/repository/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar
[05:57:45]
: [DEBUG]
    /home/tomcat/.m2/repository/joda-time/joda-time/1.6/joda-time-1.6.jar
[05:57:45]
: [DEBUG]
    /home/tomcat/.m2/repository/com/tnt/tech-tc/Tech-Hibernate-Dvn/1.1.3/Tech-Hibernate-Dvn-1.1.3.jar
[05:57:45]
: [DEBUG]
    /home/tomcat/.m2/repository/com/tnt/tech-tc/Tech-Util-Dvn/2.01.109/Tech-Util-Dvn-2.01.109.jar
[05:57:45]
: [DEBUG]
    /home/tomcat/.m2/repository/com/tnt/cct/cct-exceptions/1.2.2/cct-exceptions-1.2.2.jar
[05:57:45]
: [DEBUG]
    /home/tomcat/.m2/repository/com/tnt/cct/cct-public/1.2.3/cct-public-1.2.3.jar
[05:57:45]
: [DEBUG]
    /home/tomcat/.m2/repository/com/tnt/cct/cct-private/1.2.3/cct-private-1.2.3.jar
[05:57:45]
: [DEBUG]
    /home/tomcat/.m2/repository/log4j/log4j/1.2.14/log4j-1.2.14.jar
[05:57:45]
: [DEBUG]
 Execute command :
[05:57:45]
: /bin/sh -c /usr/java/jdk1.5.0_14/jre/bin/java -Xmx512m -classpath "/usr/local/TeamCity/buildAgent2/work/374e58a11dfb42db/src/main/java":"/usr/local/TeamCity/buildAgent2/work/374e58a11dfb42db/src/main/generated":"/usr/local/TeamCity/buildAgent2/work/374e58a11dfb42db/src/main/resources":"/usr/local/TeamCity/buildAgent2/work/374e58a11dfb42db/${sourceDirectory}":"/usr/local/TeamCity/buildAgent2/work/374e58a11dfb42db/ejbModule":"/usr/local/TeamCity/buildAgent2/work/374e58a11dfb42db/target/classes":"/home/tomcat/.m2/repository/com/vaadin/vaadin/6.4.6.dev20101005/vaadin-6.4.6.dev20101005.jar":"/home/tomcat/.m2/repository/org/vaadin/henrik/refresher/1.0.0/refresher-1.0.0.jar":"/home/tomcat/.m2/repository/com/google/gwt/gwt-user/2.0.4/gwt-user-2.0.4.jar":"/home/tomcat/.m2/repository/cglib/cglib/2.2/cglib-2.2.jar":"/home/tomcat/.m2/repository/asm/asm/3.1/asm-3.1.jar":"/home/tomcat/.m2/repository/com/tnt/tech-tc/Tech-SharedUtils-Dvn/1.0.16-SNAPSHOT/Tech-SharedUtils-Dvn-1.0.16-SNAPSHOT.jar":"/home/tomcat/.m2/repository/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar":"/home/tomcat/.m2/repository/joda-time/joda-time/1.6/joda-time-1.6.jar":"/home/tomcat/.m2/repository/com/tnt/tech-tc/Tech-Hibernate-Dvn/1.1.3/Tech-Hibernate-Dvn-1.1.3.jar":"/home/tomcat/.m2/repository/com/tnt/tech-tc/Tech-Util-Dvn/2.01.109/Tech-Util-Dvn-2.01.109.jar":"/home/tomcat/.m2/repository/com/tnt/cct/cct-exceptions/1.2.2/cct-exceptions-1.2.2.jar":"/home/tomcat/.m2/repository/com/tnt/cct/cct-public/1.2.3/cct-public-1.2.3.jar":"/home/tomcat/.m2/repository/com/tnt/cct/cct-private/1.2.3/cct-private-1.2.3.jar":"/home/tomcat/.m2/repository/log4j/log4j/1.2.14/log4j-1.2.14.jar" com.vaadin.terminal.gwt.widgetsetutils.WidgetSetBuilder com.tnt.vaadin.widgetsets.TNTRefresherApplicationWidgetset
[05:57:45]
: [INFO]
 ** getAvailableWidgetSets **
[05:57:45]
: [ERROR]
 Oct 13, 2010 7:57:45 AM com.vaadin.terminal.gwt.widgetsetutils.ClassPathExplorer getAvailableWidgetSets
[05:57:45]
: [ERROR]
 INFO: Widgetsets found from classpath:
[05:57:45]
: [ERROR]
 	com.vaadin.terminal.gwt.DefaultWidgetSet in jar:file:/home/tomcat/.m2/repository/com/vaadin/vaadin/6.4.6.dev20101005/vaadin-6.4.6.dev20101005.jar!/
[05:57:45]
: [ERROR]
 	com.tnt.vaadin.widgetsets.TNTRefresherApplicationWidgetset in file:/usr/local/TeamCity/buildAgent2/work/374e58a11dfb42db/target/classes
[05:57:45]
: [ERROR]
 	org.vaadin.henrik.refresher.RefresherApplicationWidgetset in jar:file:/home/tomcat/.m2/repository/org/vaadin/henrik/refresher/1.0.0/refresher-1.0.0.jar!/
[05:57:45]
: [ERROR]
 	src.main.java.com.tnt.vaadin.widgetsets.TNTRefresherApplicationWidgetset in file:/usr/local/TeamCity/buildAgent2/work/374e58a11dfb42db
[05:57:45]
: [ERROR]
 
[05:57:45]
: [DEBUG]
 Configuring mojo 'org.apache.maven.plugins:maven-resources-plugin:2.2:testResources' -->
[05:57:45]
: [DEBUG]
   (f) filters = []
[05:57:45]
: [DEBUG]
   (f) outputDirectory = /usr/local/TeamCity/buildAgent2/work/374e58a11dfb42db/target/test-classes
[05:57:45]
: [DEBUG]
   (f) project = MavenProject: com.tnt.tech-tc:Tech-VaadinFramework:1.0.0-SNAPSHOT @ /usr/local/TeamCity/buildAgent2/work/374e58a11dfb42db/pom.xml
[05:57:45]
: [DEBUG]
   (f) resources = [Resource {targetPath: null, filtering: false, FileSet {directory: /usr/local/TeamCity/buildAgent2/work/374e58a11dfb42db/src/test/resources, PatternSet [includes: {}, excludes: {}]
}}, Resource {targetPath: null, filtering: false, FileSet {directory: /usr/local/TeamCity/buildAgent2/work/374e58a11dfb42db/src/test/java, PatternSet [includes: {}, excludes: {**/*.java}]
}}]
[05:57:45]
: [DEBUG]
 -- end configuration --

Question is though: if we explicitly define in our pom which modules (widgetsets) need to be compiled, why does the plugin still try to scan other directories.

Regards,
Manfred