Running a Maven/GWT project

296 views
Skip to first unread message

Magnus

unread,
Nov 12, 2012, 11:58:00 AM11/12/12
to google-we...@googlegroups.com
Hi,


I want to run a Maven project: The example "atmosphere-gwt-chat" for the Atmosphere framework:

I am totally new to Maven and I just want to get a working example in order to find out how it works.
So I downloaded the POM file into a new directory and started maven in this directory. But it reports errors (see below).

What is going on there?
Where does Maven store the downloaded files?

Thanks
Magnus

-----

$ mvn gwt:run
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.206s
[INFO] Finished at: Mon Nov 12 17:41:13 CET 2012
[INFO] Final Memory: 5M/240M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:gwt-maven-plugin:2.5.0:run (default-cli): Goal requires a project to execute but there is no POM in this directory (/home/wagner/dvl/spl/Atmosphere/t). Please verify you invoked Maven from the correct directory. -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:

Juan Pablo Gardella

unread,
Nov 12, 2012, 12:01:04 PM11/12/12
to google-we...@googlegroups.com
Hi,

The error says: there is no POM in this directory (/home/wagner/dvl/spl/Atmosphere/t)

Juan



2012/11/12 Magnus <alpine...@googlemail.com>

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/aG_F-v1QbccJ.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

Magnus

unread,
Nov 12, 2012, 12:26:21 PM11/12/12
to google-we...@googlegroups.com


Am Montag, 12. November 2012 18:02:26 UTC+1 schrieb Juan Pablo Gardella:
The error says: there is no POM in this directory (/home/wagner/dvl/spl/Atmosphere/t)

But this is wrong:
-rw-r--r-- 1 wagner wagner 4871 Nov 12 17:37 atmosphere-gwt-chat-1.0.4.pom

(downloaded from the atmosphere site above)

Magnus

Juan Pablo Gardella

unread,
Nov 12, 2012, 12:33:22 PM11/12/12
to google-we...@googlegroups.com
You have to run mvn in a directory where you have pom.xml file to build the project.


2012/11/12 Magnus <alpine...@googlemail.com>

Magnus

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.

Magnus

unread,
Nov 12, 2012, 1:04:42 PM11/12/12
to google-we...@googlegroups.com

Am Montag, 12. November 2012 18:34:33 UTC+1 schrieb Juan Pablo Gardella:
You have to run mvn in a directory where you have pom.xml file to build the project.

Do you mean that I have to run mvn without arguments or that the pom file in the directory must have the name "pom.xml"?

How should it be done in the concrete atmosphere-gwt-chat example?

Magnus

Magnus

unread,
Nov 12, 2012, 1:13:32 PM11/12/12
to google-we...@googlegroups.com
Ok, I renamed the *.pom file into "pom.xml" and ran "mvn" without arguments.
It downloaded about 1 million jar files, and ended up with this message:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4:05.227s
[INFO] Finished at: Mon Nov 12 19:07:36 CET 2012
[INFO] Final Memory: 10M/217M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:gwt-maven-plugin:2.4.0:compile (default) on project atmosphere-gwt-chat: GWT Module org.atmosphere.samples.GWTDemo not found in project sources or resources. -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:

What to do next?

(Remember, I just downloaded the pom file from the source above, nothing more.)

Magnus

Hilco Wijbenga

unread,
Nov 12, 2012, 1:42:25 PM11/12/12
to google-we...@googlegroups.com
No doubt you'll need the source code as well. I have to admit the way
they've set things up is rather confusing. It would probably be much
easier if you simply cloned the entire project
(https://github.com/Atmosphere/atmosphere).

Jens

unread,
Nov 12, 2012, 2:03:49 PM11/12/12
to google-we...@googlegroups.com
To run the example:

2.) go into gwt/samples/gwt-chat
3.) run DevMode via mvn gwt:run

https://github.com/Atmosphere/atmosphere does not contain the gwt-chat example.

-- J.


Magnus

unread,
Nov 12, 2012, 8:54:08 PM11/12/12
to google-we...@googlegroups.com
Hello,

I downloaded the whole branch at https://github.com/Atmosphere/atmosphere-extensions and changed into the directory atmosphere-extensions-master/gwt/samples/gwt-chat.
Then I executed "mvn" and "mvn gwt:run", but both commands resulted in a Java (!) error (full output attached):

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project atmosphere-gwt-chat: Compilation failure: Compilation failure:
[ERROR] /home/wagner/dvl/spl/Atmosphere/atmosphere-extensions-master/gwt/samples/gwt-chat/src/main/java/org/atmosphere/samples/client/GWTDemo.java:[183,12] org.atmosphere.samples.client.GWTDemo.MyCometListener is not abstract and does not override abstract method onAfterRefresh() in org.atmosphere.gwt.client.AtmosphereListener
[ERROR] /home/wagner/dvl/spl/Atmosphere/atmosphere-extensions-master/gwt/samples/gwt-chat/src/main/java/org/atmosphere/samples/client/GWTDemo.java:[227,8] method does not override or implement a method from a supertype
[ERROR] -> [Help 1]

Shouldn't the example-code be correct or is it again a build problem? #-)

Magnus
maven.txt

Juan Pablo Gardella

unread,
Nov 13, 2012, 4:07:35 AM11/13/12
to google-we...@googlegroups.com
Are you using java 6 to build the project? If not, try with java 6.


2012/11/12 Magnus <alpine...@googlemail.com>

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.

Jens

unread,
Nov 13, 2012, 4:24:36 AM11/13/12
to google-we...@googlegroups.com
Tried it yesterday and had the same error. Maybe Maven pulls in a library thats not really compatible with the demo so I have done 

mvn install

in /atmosphere-extensions/gwt/

to install all the atmosphere gwt snapshots into my local repository and then re-run mvn gwt:run in the gwt-chat directory. Works for me.

As mvn gwt:run starts GWT DevMode with embedded Jetty you won't have WebSockets as the bundled Jetty does not support them. So the library will fall back to another push mechanism. For WebSockets you would need to deploy it to a newer Jetty or a different container.

-- J.
Message has been deleted
Message has been deleted

Magnus

unread,
Nov 14, 2012, 12:09:27 PM11/14/12
to google-we...@googlegroups.com
Hi,

this worked, thanks!

Now I have to isolate the project from maven.
(I want a working atmosphere example without maven, because I won't use maven.)

I created a new GWT project, fetched all the sources from the example and all the jars and added the jars to the eclipse project.
Then, I added the following line found in GWTDemo.gwt.xml in the sample to my TestApp.gwt.xml file:

  <inherits name="org.atmosphere.gwt.Client"/>

After that, when starting the application within eclipse, I receive a lot of NoClassDefFoundErrors (see attachment).
At this point, I am stuck and I appreciate any help!

When I get the example running in my environment (without maven) I think I can use it for my purposes.

Thanks!
Magnus

gwt-chat.txt

Jens

unread,
Nov 14, 2012, 12:29:25 PM11/14/12
to google-we...@googlegroups.com
Looks like you have to use GWT 2.5.

-- J.

Magnus

unread,
Nov 14, 2012, 10:58:55 PM11/14/12
to google-we...@googlegroups.com
Looks like you have to use GWT 2.5.

Ok.

I always used GWT with the eclipse integration, i. e. giving a URL as a "working site" (which is specific to the eclipse version), the GWT files are automatically downloaded and integrated into eclipse "somehow".

I actually don't know the "state" of GWT 2.5, but there must be a reason why the eclipse-integrated version of GWT is not 2.5. (What's the reason?)

Does this mean that I have to stop using the eclipse integration for GWT?

Magnus 

Jens

unread,
Nov 15, 2012, 4:20:07 AM11/15/12
to google-we...@googlegroups.com
Simply check for updates in Eclipse. You should see updates for Google Eclipse Plugin and GWT SDK. GWT 2.5 has officially been released.

-- J.
Reply all
Reply to author
Forward
0 new messages