How to run a Ext GWT (GXT) application with Maven - gwt

I am trying to make a GXT 3.0 starting app with Maven support. I have successfully compiled and run the native GWT application with mvn gwt:compile gwt:run command
Howeven, when I added these dependecies:
<dependency>
<groupId>com.sencha.gxt</groupId>
<artifactId>gxt</artifactId>
<version>${gxt.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sencha.gxt</groupId>
<artifactId>gxt-uibinder</artifactId>
<version>${gxt.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sencha.gxt</groupId>
<artifactId>gxt-chart</artifactId>
<version>${gxt.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sencha.gxt</groupId>
<artifactId>uibinder-bridge</artifactId>
<version>2.4.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
and added this in the gwt.xml (module) file:
<inherits name="com.sencha.gxt.ui.GXT" />
I am getting this error (running the same mvn command as above):
GWT module com.sencha.gxt.ui.GXT not found
And looking from the Java build path of the project in the Maven Dependencies, I can see that the GXT jars have not been downloaded.
Full pom.xml here.

If you want the snapshot, make sure you have the repository tags for it as well, for wherever you are getting that build from. Otherwise use the latest release, 3.0.0-beta3.
If you are building your own local copies, or deploying to an internal repo, then 3.0.0-SNAPSHOT should work - make sure the jar can be found in your repo, and that you aren't running as offline.

Use these dependencies:
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>2.5.0</version>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId>
<version>2.5.0</version>
</dependency>
<dependency>
<groupId>com.sencha.gxt</groupId>
<artifactId>gxt</artifactId>
<version>3.0.1</version>
</dependency>
GXT does not require uibinder-bridge anymore according to Sencha forum.
All GXT uibinder features were incorporated into GWT 2.5.0 release.

GXT 3.0.1 is on maven central
<dependency>
<groupId>com.sencha.gxt</groupId>
<artifactId>gxt</artifactId>
<version>3.0.1</version>
</dependency>

Related

Jersery #FormDataParam and FormDataContentDisposition is not working even after adding maven dependencies

I have added these 3 maven dependency. But when i try to use #FormDataParam and FormDataContentDisposition its showing red mark as it is not found. But I can see that in the multipart lib I am attaching image for reference.
<dependencies>
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-server</artifactId>
<version>2.27</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet</artifactId>
<version>2.27</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-multipart</artifactId>
<version>2.27</version>
</dependency>
</dependencies>
Even after adding dependency in maven it was not working .. Then it showed me suggestion to fix project on the error statement,on clicking that suggestion it asked to add org.glassfish.jersey.media.multipart library to build . Then i simply selected it and ok....It started working

Error running cucumber in eclipse- Could not find or load main class cucumber.api.cli.Main

I'm trying to run a maven project using Oxygen.1 a release. I have the cucumber plugin installed. But when I run the default feature file, I'm getting an error Error: Could not find or load main class cucumber.api.cli.Main
Please help!
I've never used Cucumber, but I guess you need to add it as a dependency to your Maven pom.xml as described in the Cucumber JVM documentation.
The Eclipse plugin adds syntax highlighting, content assists and other IDE related convenience. But you still need to tell the JVM where to find the Cucumber classes and in a Maven project this is defined by the dependencies in pom.xml.
You may rise a feature request at the Cucumber-Eclipse issue tracker to extend the plugin to allow adding the dependency to Maven projects automatically.
Add these dependencies to the pom.xml and the issue gets resolved. I was trying with the latest versions so was facing this problem. When I changed the version then it worked for me.
<dependencies>
<!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-java -->
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<version>2.3.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-junit -->
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit</artifactId>
<version>2.3.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/net.masterthought/cucumber-reporting -->
<dependency>
<groupId>net.masterthought</groupId>
<artifactId>cucumber-reporting</artifactId>
<version>3.14.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/io.cucumber/gherkin -->
<dependency>
<groupId>info.cukes</groupId>
<artifactId>gherkin</artifactId>
<version>2.12.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.14.0</version>
</dependency>
</dependencies>

Adding rampart.mar to classpath via Maven

I have been trying to find a solution for this for several days, but with no avail.
I'm currently in the process of introducing Maven to some of my Java projects. One of them requires Axis2 and Rampart for WS Security.
I added all Axis2 and Rampart dependencies in pom.xml:
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-kernel</artifactId>
<version>1.5.6</version>
</dependency>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-adb</artifactId>
<version>1.5.6</version>
</dependency>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-transport-local</artifactId>
<version>1.5.6</version>
</dependency>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-transport-http</artifactId>
<version>1.5.6</version>
</dependency>
<dependency>
<groupId>org.apache.rampart</groupId>
<artifactId>rampart-core</artifactId>
<version>1.5.2</version>
</dependency>
<dependency>
<groupId>org.apache.rampart</groupId>
<artifactId>rampart-policy</artifactId>
<version>1.5.2</version>
</dependency>
<dependency>
<groupId>org.apache.rampart</groupId>
<artifactId>rampart-trust</artifactId>
<version>1.5.2</version>
</dependency>
<dependency>
<groupId>org.apache.rampart</groupId>
<artifactId>rampart</artifactId>
<version>1.5.2</version>
<type>mar</type>
</dependency>
When I import the project in Eclipse, rampart.mar is not there, and attempting to engage the rampart module on runtime causes a failure.
However, when I use maven-dependency-plugin to copy all dependencies to a specific repository, I see that the rampart mar file is there!
This makes me believe that this is a limitation in the Eclipse m2e plugin. Anyone stumbled upon this one before? I saw several similar questions on Stackoverflow that were left unanswered.

Really painful to run GWTP in Maven

I've been struggling all day to run GWTP with Maven, essentially I created a GWTP gwt application using the Eclipse plugin. And added a simple welcome presenter. Tried it without maven and it works well running from eclipse.
However when I convert it to a maven project (I'm using m2eclipse plugin) everything breaks. So I added the required dependencies and the gwtp dependency:
<dependency>
<groupId>com.google.gwt.inject</groupId>
<artifactId>gin</artifactId>
<version>1.5.0</version>
</dependency>
<!-- MVP component -->
<dependency>
<groupId>com.gwtplatform</groupId>
<artifactId>gwtp-all</artifactId>
<version>${gwtp.version}</version>
</dependency>
However when I try to run it I get this error:
Caused by: java.lang.RuntimeException: Deferred binding failed for 'com.google.gwt.event.shared.EventBus' (did you forget to inherit a required module?)
Any ideas why its quite hard to make GWTP with maven.
I think you might be missing the gwt-user dependency. Here is my maven pom.xml for an GWTP project:
<properties>
<gwtVersion>2.4.0</gwtVersion>
<gwtp.version>0.7</gwtp.version>
</properties>
<dependencies>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>${gwtVersion}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.gwtplatform</groupId>
<artifactId>gwtp-mvp-client</artifactId>
<version>${gwtp.version}</version>
<scope>provided</scope>
</dependency>
<!-- Dispatch component -->
<dependency>
<groupId>com.gwtplatform</groupId>
<artifactId>gwtp-dispatch-client</artifactId>
<version>${gwtp.version}</version>
<scope>provided</scope> <!-- Remove for GWTP 0.5.1 and earlier -->
</dependency>
<!-- Tester component -->
<dependency>
<groupId>com.gwtplatform</groupId>
<artifactId>gwtp-tester</artifactId>
<version>${gwtp.version}</version>
<scope>test</scope>
</dependency>
In case you use the newest gwtp 0.7 be aware that they switched from the depreciated classes in com.google.gwt.event.shared to com.google.web.bindery.event.shared.
See here for more details.

Problem adding commons-configuration to m2eclipse

I want to use the apache commons configuration jars in my Maven project.
When I add it using m2Eclipse it produces this:
<dependency>
<groupId>commons-configuration</groupId>
<artifactId>commons-configuration</artifactId>
<version>20041012.002804</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
This seems fine but it then givers me the error:
Missing artifact resources:resources:jar:1.0:compile
Can anyone help please?
Looks like you need to choose a reliable version. That one seems to be a snapshot build. Here is the excerpt from my project.
<dependency>
<groupId>commons-configuration</groupId>
<artifactId>commons-configuration</artifactId>
<version>1.6</version>
<type>jar</type>
<scope>compile</scope>
</dependency>