Development: 7.0 build.xml traget: widgetset fails

I am trying to create a Vaadin 7.0 development environment. The instructions say to build the widgets using Run As Ant Script. I have learned that the probable target for this is “widgetset”. When I run this, I get dozens of compiler errors:


Buildfile: C:\Projects\Vaadin 7.0\build\build.xml
check-ivy-installed:
common.ivy-download:
ivy-configure:
[ivy:configure]
 :: Ivy 2.2.0 - 20100923230623 :: http://ant.apache.org/ivy/ ::
[ivy:configure]
 :: loading settings :: file = C:\Projects\Vaadin 7.0\.\build\ivy\ivysettings.xml
init-taskdefs:
     [echo]
 Loading Ant tasks
[ivy:resolve]
 :: resolving dependencies :: com.vaadin#vaadin;working@PC30SBH
[ivy:resolve]
 	confs: [taskdefs]

[ivy:resolve]
 	found ant-contrib#ant-contrib;1.0b3 in public
[ivy:resolve]
 	found org.apache.maven#maven-ant-tasks;2.0.10 in public
[ivy:resolve]
 	found emma#emma_ant;2.0.5312 in public
[ivy:resolve]
 	found emma#emma;2.0.5312-patched in gwt-redist
[ivy:resolve]
 :: resolution report :: resolve 189ms :: artifacts dl 11ms
	---------------------------------------------------------------------
	|                  |            modules            ||   artifacts   |
	|       conf       | number| search|dwnlded|evicted|| number|dwnlded|
	---------------------------------------------------------------------
	|     taskdefs     |   4   |   0   |   0   |   0   ||   4   |   0   |
	---------------------------------------------------------------------
common.init-deps:
init-deps:
[ivy:resolve]
 :: resolving dependencies :: com.vaadin#vaadin;working@PC30SBH
[ivy:resolve]
 	confs: [ss.compile, cs.compile, ss.test.compile]

[ivy:resolve]
 	found javax.validation#validation-api;1.0.0.GA in public
[ivy:resolve]
 	found javax.servlet#servlet-api;2.5 in public
[ivy:resolve]
 	found com.liferay.portal#portal-service;6.0.2 in public
[ivy:resolve]
 	found javax.portlet#portlet-api;2.0 in public
[ivy:resolve]
 	found com.google.appengine#appengine-api-1.0-sdk;1.2.1 in public
[ivy:resolve]
 	found junit#junit;4.5 in public
[ivy:resolve]
 	found org.easymock#easymock;3.0 in public
[ivy:resolve]
 	found cglib#cglib-nodep;2.2 in public
[ivy:resolve]
 	found org.objenesis#objenesis;1.2 in public
[ivy:resolve]
 	found org.hsqldb#hsqldb;2.2.6 in public
[ivy:resolve]
 	found org.mortbay.jetty#jetty;6.1.26 in public
[ivy:resolve]
 	found org.mortbay.jetty#jetty-util;6.1.26 in public
[ivy:resolve]
 	found commons-lang#commons-lang;2.6 in public
[ivy:resolve]
 	found commons-io#commons-io;2.3 in public
[ivy:resolve]
 	found commons-codec#commons-codec;1.6 in public
[ivy:resolve]
 	found emma#emma_ant;2.0.5312 in public
[ivy:resolve]
 	found emma#emma;2.0.5312-patched in gwt-redist
[ivy:resolve]
 	found org.slf4j#slf4j-log4j12;1.6.1 in public
[ivy:resolve]
 	found org.slf4j#slf4j-api;1.6.1 in public
[ivy:resolve]
 	found log4j#log4j;1.2.16 in public
[ivy:resolve]
 	found org.hibernate#hibernate-validator;4.2.0.Final in public
[ivy:resolve]
 :: resolution report :: resolve 528ms :: artifacts dl 49ms
	---------------------------------------------------------------------
	|                  |            modules            ||   artifacts   |
	|       conf       | number| search|dwnlded|evicted|| number|dwnlded|
	---------------------------------------------------------------------
	|    ss.compile    |   5   |   0   |   0   |   0   ||   6   |   0   |
	|    cs.compile    |   1   |   0   |   0   |   0   ||   2   |   0   |
	|  ss.test.compile |   21  |   0   |   0   |   0   ||   22  |   0   |
	---------------------------------------------------------------------
build.properties:
init-nonpackage:
     [echo]
 We are using lib/core/gwt/gwt-dev.jar.
     [echo]
 Widget sets output dir: WebContent/VAADIN/widgetsets
init:
     [echo]
 Base Version: 7.0.0
     [echo]
 Full Version: 7.0.0.dev-20120712
     [echo]
 Vaadin package is: com/vaadin
     [echo]
 We are using gwt version 2.5.0.
     [echo]
 Prepared to build vaadin version 7.0.0.dev-20120712 packages
preprocess-src:
    [mkdir]
 Created dir: C:\Projects\Vaadin 7.0\build\result\src
    [mkdir]
 Created dir: C:\Projects\Vaadin 7.0\build\result\src\core
    [mkdir]
 Created dir: C:\Projects\Vaadin 7.0\build\result\src\testbench
    [mkdir]
 Created dir: C:\Projects\Vaadin 7.0\build\result\src\junit
     [echo]
 Copying src directory and processing copied files.
     [echo]
 Replacing <version> tag with build version for java/html/css/xml files.
     [copy]
 Copying 672 files to C:\Projects\Vaadin 7.0\build\result\src\core
     [copy]
 Copying 1310 files to C:\Projects\Vaadin 7.0\build\result\src\testbench
     [copy]
 Copying 145 files to C:\Projects\Vaadin 7.0\build\result\src\junit
     [echo]
 Copying non java/html/css/xml files such as images.
     [copy]
 Copying 41 files to C:\Projects\Vaadin 7.0\build\result\src\core
     [copy]
 Copying 25 files to C:\Projects\Vaadin 7.0\build\result\src\testbench
compile-core:
     [echo]
 Compiling src (server-side)
    [mkdir]
 Created dir: C:\Projects\Vaadin 7.0\build\result\classes\core
    [javac]
 Compiling 659 source files to C:\Projects\Vaadin 7.0\build\result\classes\core
    [javac]
 C:\Projects\Vaadin 7.0\build\result\src\core\com\google\gwt\dom\client\VaadinDOMImplSafari.java:24: cannot find symbol
    [javac]
 symbol: class DOMImplSafari
    [javac]
 class VaadinDOMImplSafari extends DOMImplSafari {
    [javac]
                                   ^
    [javac]
 C:\Projects\Vaadin 7.0\build\result\src\core\com\google\gwt\dom\client\VaadinDOMImplSafari.java:26: cannot find symbol
    [javac]
 symbol  : class Element
    [javac]
 location: class com.google.gwt.dom.client.VaadinDOMImplSafari
    [javac]
     public int getAbsoluteLeft(Element elem) {
    [javac]
                                ^
    [javac]
 C:\Projects\Vaadin 7.0\build\result\src\core\com\google\gwt\dom\client\VaadinDOMImplSafari.java:33: cannot find symbol
    [javac]
 symbol  : class Element
    [javac]
 location: class com.google.gwt.dom.client.VaadinDOMImplSafari
    [javac]
     public int getAbsoluteTop(Element elem) {
    [javac]
                               ^
    [javac]
 C:\Projects\Vaadin 7.0\build\result\src\core\com\vaadin\terminal\gwt\client\JavaScriptConnectorHelper.java:26: package com.google.gwt.core.client does not exist
    [javac]
 import com.google.gwt.core.client.JavaScriptObject;
    [javac]
                                  ^

…there are dozens of other errors and then a failed build. Any ideas for how to fix this?

I believe you missed step 3 on the
Starting Vaadin 7 development
page (step 4 is optional). The latest (from Vaadin 7 alpha 3) Vaadin trunk requires that you make checkouts of two directories (“trunk” and “tools”) of GWT 2.5 branch in addition to Vaadin.

If you do not check them out in parallel to the Vaadin checkout directory, you also need to set some properties (gwt.root must point to the GWT “trunk” directory) and environment variables (GWT_TOOLS must point to the GWT “tools” directory"). I typed the variable names from memory so check in the beginning of the corresponding build files them if they do not work…

This setup will get simplified in the future when GWT moves to Git.

EDIT:
If you did check them out, run “ant compile-gwt” in the Vaadin trunk directory and then try again - that might be missing from the instructions, and some of the build targets do it automatically but the widgetsets target might not.

If you are not going to edit any GWT classes, you can try to take the simpler path of downloading GWT 2.5 RC JARs to your gwt.lib.dir (see Vaadin build/build.xml). A colleague of mine is using this approach - some top-level build targets might not work this way but e.g. compiling the widgetset proabably should.

My workspace for Eclipse is c:\Projects and there is a c:\Projects\trunk and c:|Projects\tools checked out. I think this is what step three is telling me. Do you agree? How do you change the property “gwt.root”?

That looks correct if your Vaadin project is directly in your workspace.

You can give gwt.root=c:/projects/trunk as a parameter to Ant by adding -Dgwt.root=… if running Ant from the command line. If running Ant in Eclipse, set it on the Properties tab of an Ant build (first uncheck the “Use global properties…”) or globally set it in Preferences… → Ant → Runtime → Properties .

Same thing, still getting compile errors. Any other thoughts?


Buildfile: C:\Projects\Vaadin 7.0\build\build.xml
check-ivy-installed:
common.ivy-download:
ivy-configure:
[ivy:configure]
 :: Ivy 2.2.0 - 20100923230623 :: http://ant.apache.org/ivy/ ::
[ivy:configure]
 :: loading settings :: file = C:\Projects\Vaadin 7.0\.\build\ivy\ivysettings.xml
init-taskdefs:
     [echo]
 Loading Ant tasks
[ivy:resolve]
 :: resolving dependencies :: com.vaadin#vaadin;working@PC30SBH
[ivy:resolve]
 	confs: [taskdefs]

[ivy:resolve]
 	found ant-contrib#ant-contrib;1.0b3 in public
[ivy:resolve]
 	found org.apache.maven#maven-ant-tasks;2.0.10 in public
[ivy:resolve]
 	found emma#emma_ant;2.0.5312 in public
[ivy:resolve]
 	found emma#emma;2.0.5312-patched in gwt-redist
[ivy:resolve]
 :: resolution report :: resolve 164ms :: artifacts dl 9ms
	---------------------------------------------------------------------
	|                  |            modules            ||   artifacts   |
	|       conf       | number| search|dwnlded|evicted|| number|dwnlded|
	---------------------------------------------------------------------
	|     taskdefs     |   4   |   0   |   0   |   0   ||   4   |   0   |
	---------------------------------------------------------------------
common.init-deps:
init-deps:
[ivy:resolve]
 :: resolving dependencies :: com.vaadin#vaadin;working@PC30SBH
[ivy:resolve]
 	confs: [ss.compile, cs.compile, ss.test.compile]

[ivy:resolve]
 	found javax.validation#validation-api;1.0.0.GA in public
[ivy:resolve]
 	found javax.servlet#servlet-api;2.5 in public
[ivy:resolve]
 	found com.liferay.portal#portal-service;6.0.2 in public
[ivy:resolve]
 	found javax.portlet#portlet-api;2.0 in public
[ivy:resolve]
 	found com.google.appengine#appengine-api-1.0-sdk;1.2.1 in public
[ivy:resolve]
 	found junit#junit;4.5 in public
[ivy:resolve]
 	found org.easymock#easymock;3.0 in public
[ivy:resolve]
 	found cglib#cglib-nodep;2.2 in public
[ivy:resolve]
 	found org.objenesis#objenesis;1.2 in public
[ivy:resolve]
 	found org.hsqldb#hsqldb;2.2.6 in public
[ivy:resolve]
 	found org.mortbay.jetty#jetty;6.1.26 in public
[ivy:resolve]
 	found org.mortbay.jetty#jetty-util;6.1.26 in public
[ivy:resolve]
 	found commons-lang#commons-lang;2.6 in public
[ivy:resolve]
 	found commons-io#commons-io;2.3 in public
[ivy:resolve]
 	found commons-codec#commons-codec;1.6 in public
[ivy:resolve]
 	found emma#emma_ant;2.0.5312 in public
[ivy:resolve]
 	found emma#emma;2.0.5312-patched in gwt-redist
[ivy:resolve]
 	found org.slf4j#slf4j-log4j12;1.6.1 in public
[ivy:resolve]
 	found org.slf4j#slf4j-api;1.6.1 in public
[ivy:resolve]
 	found log4j#log4j;1.2.16 in public
[ivy:resolve]
 	found org.hibernate#hibernate-validator;4.2.0.Final in public
[ivy:resolve]
 :: resolution report :: resolve 492ms :: artifacts dl 57ms
	---------------------------------------------------------------------
	|                  |            modules            ||   artifacts   |
	|       conf       | number| search|dwnlded|evicted|| number|dwnlded|
	---------------------------------------------------------------------
	|    ss.compile    |   5   |   0   |   0   |   0   ||   6   |   0   |
	|    cs.compile    |   1   |   0   |   0   |   0   ||   2   |   0   |
	|  ss.test.compile |   21  |   0   |   0   |   0   ||   22  |   0   |
	---------------------------------------------------------------------
build.properties:
init-nonpackage:
     [echo]
 We are using lib/core/gwt/gwt-dev.jar.
     [echo]
 Widget sets output dir: WebContent/VAADIN/widgetsets
init:
     [echo]
 Base Version: 7.0.0
     [echo]
 Full Version: 7.0.0.dev-20120716
     [echo]
 Vaadin package is: com/vaadin
     [echo]
 We are using gwt version 2.5.0.
     [echo]
 Prepared to build vaadin version 7.0.0.dev-20120716 packages
preprocess-src:
     [echo]
 Copying src directory and processing copied files.
     [echo]
 Replacing <version> tag with build version for java/html/css/xml files.
     [copy]
 Copying 672 files to C:\Projects\Vaadin 7.0\build\result\src\core
     [echo]
 Copying non java/html/css/xml files such as images.
compile-core:
     [echo]
 Compiling src (server-side)
    [javac]
 Compiling 659 source files to C:\Projects\Vaadin 7.0\build\result\classes\core
    [javac]
 C:\Projects\Vaadin 7.0\build\result\src\core\com\google\gwt\dom\client\VaadinDOMImplSafari.java:24: cannot find symbol
    [javac]
 symbol: class DOMImplSafari
    [javac]
 class VaadinDOMImplSafari extends DOMImplSafari {
    [javac]
                                   ^
    [javac]
 C:\Projects\Vaadin 7.0\build\result\src\core\com\google\gwt\dom\client\VaadinDOMImplSafari.java:26: cannot find symbol
    [javac]
 symbol  : class Element
    [javac]
 location: class com.google.gwt.dom.client.VaadinDOMImplSafari
    [javac]
     public int getAbsoluteLeft(Element elem) {
    [javac]
                                ^
    [javac]
 C:\Projects\Vaadin 7.0\build\result\src\core\com\google\gwt\dom\client\VaadinDOMImplSafari.java:33: cannot find symbol
    [javac]
 symbol  : class Element
    [javac]
 location: class com.google.gwt.dom.client.VaadinDOMImplSafari
    [javac]
     public int getAbsoluteTop(Element elem) {
    [javac]
                               ^

I’d really like to start contributing to the Vaadin open source project but I’m having trouble getting me environment set up. Can anyone help me?

Try to run the target compile-gwt in Vaadin build/build.xml (with the correct gwt.root set). Then check whether ${gwt.root}/build/lib/gwt-user.jar and gwt-dev.jar exist and have reasonable looking content (their sizes should be some tens of MB).

If they are ok, try to add some "echo"s in Vaadin build.xml to show ${gwt.user.jar} etc. to see if they point to the correct location. Maybe also run ant with the argument “-v” or even “-debug” to see better what is happening and what property values it is using.

Ignore the output of the init-nonpackage target - it uses an obsolete property that is not used elsewhere and should be removed from there and the properties file.

The error messages do tell that the GWT JARs or classes are missing from compilation classpath, but does not give much more information.

Hello,

i would like to create a patch for a ticket which is quite easy to solve. (Vaadin 7.1)
That’s why i cloned the vaadin sources from github following the readme.

Now i seem to have stumbled into the same problem as mentioned here:

When trying to run the ide.xml as Ant Script it says in the console that it cant find the module ant-contrib und that it is impossible to resolve the dependency.

That’s why i tried to run compile-gwt from the build.xml but in vaadin/build there is no build.xml and i wasn’t able to find the target somewhere else (using eclipse).
My build folder also does not have a buld/lib folder inside it.

I have GWT_ROOT set to the gwt folder in General → WorkSpace → Linked Resource
and JAVA_HOME and GWT_TOOLS set in Java → Build Path → Classpath Variables

Does someone have an idea on how to fix my setup?

Best Regards,
M R

…The gwt-tools folder is in the same directory as the gwt and vaadin one is which is the Users/MyUser/.git directory.
I set GWT_TOOLS using the Projects… Browser so there shouldn’t be a syntax error (I also double-checked it several times).
I can even see the jar lying inside gwt-tools/antlib

Here are also a few of the errors i’m getting in case they help:[code]
[ivy:resolve]
[ivy:resolve]
== resolving dependencies com.vaadin#vaadin;working@MyComputer->ant-contrib#ant-contrib;1.0b3 [taskdefs->master]

[ivy:resolve]
tried http://repo1.maven.org/maven2/ant-contrib/ant-contrib/1.0b3/ant-contrib-1.0b3.pom
[ivy:resolve]
ERROR: Server access Error: Connection refused: connect url=http://repo1.maven.org/maven2/ant-contrib/ant-contrib/1.0b3/ant-contrib-1.0b3.pom

:: problems summary ::
[ivy:resolve]
:::: WARNINGS
[ivy:resolve]
module not found: ant-contrib#ant-contrib;1.0b3
[ivy:resolve]
==== public: tried
[ivy:resolve]
http://repo1.maven.org/maven2/ant-contrib/ant-contrib/1.0b3/ant-contrib-1.0b3.pom

[ivy:resolve]

[ivy:resolve]
:::: ERRORS
[ivy:resolve]
Server access Error: Connection refused: connect url=http://repo1.maven.org/maven2/ant-contrib/ant-contrib/1.0b3/ant-contrib-1.0b3.pom
[ivy:resolve]
Server access Error: Connection refused: connect url=http://repo1.maven.org/maven2/ant-contrib/ant-contrib/1.0b3/ant-contrib-1.0b3.jar

BUILD FAILED
D:\Users\MyUser\git\vaadin\build\ide.xml:4: The following error occurred while executing this line:
D:\Users\MyUser\git\vaadin\gwt-files.xml:4: The following error occurred while executing this line:
D:\Users\MyUser\git\vaadin\common.xml:17: impossible to resolve dependencies:
resolve failed - see output for details

Caused by: resolve failed - see output for details
at org.apache.ivy.ant.IvyResolve.doExecute(IvyResolve.java:333)

[/code]
Also in the common.xml in the line where the ant-contrib is defined i get a warning saying: Reference taskdefs.classpath not found.

The JAR and POM are at the indicated location in Maven Central - could it be that your firewall/proxy blocks direct access to it? Does your company/network require the use of a proxy server for accessing Maven artifacts?

Yes i’m behind a proxy and i did add the settings to Eclipse Preferences → General → Network Connections
and also the maven settings.xml.
Is there another place where i have to configure it?

In this case it is Ivy (or IvyDE in Eclipse) that is trying to fetch ant-contrib.


This thread on StackOverflow
might help for command line Ivy, not sure about IvyDE. Once the JAR is in Ivy cache (IvyDE might or might not use a separate cache directory), this should not be an issue anymore.

Just before you posted i managed to compile my widgetset by adding the setproxy tag inside the ide.xml.
I already tried to set the ANT_OPTS Environmental variable but i guess i made it wrong. When i run into problems with the setproxy tag i will surely retry this.

Is it allowed/Will i run into problems when i change some of these xmls by adding setproxy tags? I mean will it be a problem when creating a patch later on?

The normal workflow if you want to commit to the framework project itself is to create a branch for each change and push the change to review for the correct branch (a signed contributor agreement is needed - see
the new Contributing Code page
for that and more information. When creating the changeset, you choose what goes in it, just exclude the file(s) edited for local use only.

If you are creating a patch for your own use only, I would also recommend doing a patch from a commit in a separate local branch so that its contents are well-defined.