Eclipse for Robot Framework (java version) project: how to run specific tags? - eclipse

My project uses Maven to reference all needed libraries, so I don't even need to manually install robot framework (I just included markusbernhardt's Selenium2Library as a dependency in pom.xml):
<dependencies>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.4.0</version>
</dependency>
<dependency>
<groupId>com.github.markusbernhardt</groupId>
<artifactId>robotframework-selenium2library-java</artifactId>
<version>1.4.0.8</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.robotframework</groupId>
<artifactId>robotframework-maven-plugin</artifactId>
<version>1.4.7</version>
<executions>
<execution>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
I can run my tests as Maven Install or using a Run Configuration for Maven:
However, I don't know how to tell robot framework that I want to run tests tagged with certain tags. I don't run robot framework from a command line as I don't have robot framework installed in my machine, I'm only using it as a maven dependency, so I can't run python -m robot.run --include tag.
I tried adding --include tag as a Parameter in the Run Configuration but it's being ignored.
Is there a way to send this tag parameter to robot within Eclipse?

Just found out how! Leaving info here in case it helps someone else:
It's all in pom.xml:
Add a <properties />first-level element (within <project />) with a property name of your choosing and the tag you want to run, like this:
<properties>
<robot-tag>mytag</robot-tag>
</properties>
Then, in the plugins section, within the robotframework-maven-plugin plugin
element, add this:
<configuration>
<includes>
<include>${robot-tag}</include>
</includes>
</configuration>
That's it. The Run Configuration doesn't need to be changed. And the project can also be ran as Maven Install.
This is what my pom.xml looks like now (stripping out the element and project-specific info like groupID, artifactID, etc):
<properties>
<robot-tag>debug</robot-tag>
</properties>
<dependencies>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.4.0</version>
</dependency>
<dependency>
<groupId>com.github.markusbernhardt</groupId>
<artifactId>robotframework-selenium2library-java</artifactId>
<version>1.4.0.8</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.robotframework</groupId>
<artifactId>robotframework-maven-plugin</artifactId>
<version>1.4.7</version>
<executions>
<execution>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
<configuration>
<includes>
<include>${robot-tag}</include>
</includes>
</configuration>
</plugin>
</plugins>
</build>

Related

JPA Static Metamodel not recognized by IntelliJ

I generated the application with JHipster with Gradle as the build tool.
When I created entity I added filtering support, which generated JPA static metamodel. But IntelliJ doesn't recognize the metamodels.
I have enabled the annotation processor settings on IntelliJ but it doesn't seem to work.
What settings do I have to change for IntelliJ to recognize the JPA static metamodels?
By default, the metamodel classes get generated into the /target/generated-sources/annotations folder. It seems like that folder isn't registered as a source folder.
You can either change that manually in your IDE or if you're using a Maven build, you can do that automatically by adding the following plugin to your build configuration:
<project>
...
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>target/generated-sources/annotations</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
...
</project>
I explained that in more details in one of my Hibernate Tips.
I'm not allowed to comment but I wanted to add to Thorben Janssen's answer.
Besides the plugin config I also had to add this to the dependencies of the project:
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-jpamodelgen</artifactId>
<version>5.4.21.Final</version>
</dependency>
This is what generates the sources in the target/generated-sources/annotations path.
So the pom ended up like this:
<dependencies>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-jpamodelgen</artifactId>
<version>5.4.21.Final</version>
</dependency>
...
</dependencies>
...
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<id>add-source</id>
<goals>
<goal>add-source</goal>
</goals>
<phase>generate-sources</phase>
<configuration>
<sources>
<source>target/generated-sources/annotations</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
...
</build>
To get IntelliJ IDEA to recognize the generated classes, I had to add this line on build.gradle
sourceSets {
main.java.srcDirs += 'build/generated/source/apt/main'
}
Update
Better solution is to modify IntelliJ Plugin
idea {
module {
sourceDirs += file("build/generated/source/apt/main")
generatedSourceDirs += file("build/generated/source/apt/main")
}
}
Intellij's build recognize all processors listed in this file:
META-INF/services/javax.annotation.processing.Processor
.
Case you use Eclipse Link, include this line inside the file:
org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor
Case Hibernate:
org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor
Ensure that you have all dependencys: I will describe using maven just for example:
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.jpa.modelgen.processor</artifactId>
<version>2.7.0</version>
<scope>provided</scope>
</dependency>
OR
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-jpamodelgen</artifactId>
<version>5.2.12.Final</version>
<scope>provided</scope>
</dependency>
For me it wasn't a problem of the configuration files (none of the above mentioned solutions worked), but I simply had to reload all Maven project files.
For this in IntelliJ Idea:
Go to the Maven tab on the right side of the IDE (you might have to make it visible under View -> Tool Windows)
Open the project and compile
On the top left corner of the tab press Reload all Maven Projects
Now, the meta classes (e.g. SampleClass_) should be importable and recognized by IntelliJ

The POM for jar is invalid, transitive dependencies will not be available

I want to provide external dependency to my maven project in eclipse. Therefore, I ave copied the jar file and its POM.xml directly in the local Maven Repository. But somehow Eclipse is complaining that the POM for the jar is invalid.
My pom.xml for jar file in local Repository looks like below:
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.b.t</groupId>
<artifactId>v-parent</artifactId>
<version>3.9.0</version>
</parent>
<scm>
<developerConnection>scm:svn:url/</developerConnection>
</scm>
<artifactId>v-p</artifactId>
<version>1.1.0</version>
<name>p</name>
<build>
<plugins>
<!-- Plugin required to build java classes from XSD using XJC -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>xjc</id>
<goals>
<goal>xjc</goal>
</goals>
</execution>
</executions>
<configuration>
<arguments>-npa</arguments>
<schemaDirectory>${project.basedir}/src/main/resources</schemaDirectory>
<packageName>com.b.t.v.fusion.p.generated</packageName>
<schemaFiles>pConfig.xsd</schemaFiles>
<outputDirectory>${basedir}/target/generated-sources</outputDirectory>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<!-- Plugin required to add the generated sources to the classpath -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${basedir}/target/generated-sources</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
<dependencies>
<dependency>
<groupId>com.b.t</groupId>
<artifactId>v-fusioninterface</artifactId>
</dependency>
<dependency>
<!-- FFT -->
<groupId>com.github.wendykierp</groupId>
<artifactId>JTransforms</artifactId>
<version>3.1</version>
</dependency>
<dependency>
<!-- Reading and writing of MATLAB files -->
<groupId>net.sourceforge.jmatio</groupId>
<artifactId>jmatio</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<profiles>
<profile>
<id>doclint-java8-disable</id>
<activation>
<jdk>[1.8,)</jdk>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<additionalparam>-Xdoclint:none</additionalparam>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
I have already checked similar posts and have done necessary changes in eclipse.ini (specifying JDK's JRE as vmargs n all). My dependency in MAven Project looks like below:
<dependency>
<groupId>com.b.t</groupId>
<artifactId>v-p</artifactId>
<version>1.1.0</version>
</dependency>
Please note that the same jar file with corresponding POM.xml is working well for my colleague in Intellij.
I am using Eclipse Luna just for info. I also have checked in my Eclipse that the Installed JRE is jdk1.8.0_144.
Also I am getting the same error when I use mvn clean install on command prompt.
Could someone please suggest what can I check more ?
You cannot just copy the files into your local repo, you need to install them. There are instructions here: https://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html
In your case is would be something like:
mvn install:install-file -Dfile=<path-to-file> -DpomFile=<path-to-pomfile>

how to solve the dependency missing in eclipse by mvn? [duplicate]

This question already has answers here:
How can I make eclipse make use of packages downloaded by maven?
(2 answers)
Closed 9 years ago.
I get a java servlet project from github, it use mvn to compile ,and use jetty as the servlet container.Since I never used mvn ,so I get much problems/.
question 1:
When I run mvn install , it says "BUILD SUCCESS",but after I import this project into eclipse, many packages imported cannot be resolved by eclipse. Why ?It seems that when I run "mvn install",mvn has downloaded all dependencies for me.
question 2:
How to deploy my project to jetty and then run all jUnit test cases ?
question 3:
when I run "mvn jetty:run",it says:
No plugin found for prefix 'jetty' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (/root/.m2/repository), central (http://repo.maven.apache.org/maven2)] -> [Help 1]
Google says I should add jetty plugins to mvn configuration .But I am confused about the project.Why doesn't the project developers add this to pom.xml?Or, there exist other solutions?
below is the simple project directory.Project name is http-request.
[root#localhost http-request]# ls
lib pom.xml README.md
[root#localhost http-request]# cd lib
[root#localhost lib]# ls
pom.xml src target
pom.xml under http-request:
<?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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.kevinsawicki</groupId>
<artifactId>http-request-parent</artifactId>
<version>1.0</version>
<packaging>pom</packaging>
<modules>
<module>lib</module>
</modules>
</project>
pom.xml under http-request/lib:
<?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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.sonatype.oss</groupId>
<artifactId>oss-parent</artifactId>
<version>7</version>
</parent>
<groupId>com.github.kevinsawicki</groupId>
<artifactId>http-request</artifactId>
<version>5.5-SNAPSHOT</version>
<url>https://github.com/kevinsawicki/http-request</url>
<description>Library for making HTTP requests</description>
<inceptionYear>2011</inceptionYear>
<issueManagement>
<url>https://github.com/kevinsawicki/http-request/issues</url>
<system>GitHub Issues</system>
</issueManagement>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jetty.version>8.1.9.v20130131</jetty.version>
</properties>
<licenses>
<license>
<name>MIT License</name>
<url>http://www.opensource.org/licenses/mit-license.php</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<url>https://github.com/kevinsawicki/http-request</url>
<connection>scm:git:git://github.com/kevinsawicki/http-request.git</connection>
<developerConnection>scm:git:git#github.com:kevinsawicki/http-request.git</developerConnection>
</scm>
<developers>
<developer>
<email>kevinsawicki#gmail.com</email>
<name>Kevin Sawicki</name>
<url>https://github.com/kevinsawicki</url>
<id>kevinsawicki</id>
</developer>
</developers>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<archive>
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.3.7</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Require-Bundle />
<Export-Package>!.,com.github.kevinsawicki.http</Export-Package>
<Bundle-RequiredExecutionEnvironment>J2SE-1.5</Bundle-RequiredExecutionEnvironment>
</instructions>
</configuration>
<executions>
<execution>
<id>bundle-manifest</id>
<phase>process-classes</phase>
<goals>
<goal>manifest</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.8</version>
<executions>
<execution>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.1.2</version>
<executions>
<execution>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.github.github</groupId>
<artifactId>site-maven-plugin</artifactId>
<version>0.8</version>
<configuration>
<message>Generated site for ${project.name} ${project.version}</message>
<noJekyll>true</noJekyll>
</configuration>
<executions>
<execution>
<goals>
<goal>site</goal>
</goals>
<phase>site</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.0</version>
<configuration>
<reportPlugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>2.2</version>
<configuration>
<dependencyDetailsEnabled>true</dependencyDetailsEnabled>
<dependencyLocationsEnabled>true</dependencyLocationsEnabled>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.8</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
<version>2.6</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-changelog-plugin</artifactId>
<version>2.2</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>emma-maven-plugin</artifactId>
<version>1.0-alpha-3</version>
</plugin>
</reportPlugins>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>sign</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.4</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<version>${jetty.version}</version>
<scope>test</scope>
</dependency>
<!-- Used to test proxy -->
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlet</artifactId>
<version>${jetty.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlets</artifactId>
<version>${jetty.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
There are several issues raised. Let me divide my answer.
Running builds as root
I highly recommend that you stop running builds as root.
[root#localhost http-request]# ls
lib pom.xml README.md
[root#localhost http-request]# cd lib
[root#localhost lib]# ls
pom.xml src target
This is a dangerous practice. Create a normal user account on your system and use this.
Dependencies missing in Eclipse
I have tested the project you are building and confirmed that it builds as follows:
git clone https://github.com/kevinsawicki/http-request.git
cd http-request
mvn install
You state that it fails when run from within Eclipse? Could this be because you have not installed the Eclipse plugin for Maven? See the following question:
How can I make eclipse make use of packages downloaded by maven?
No plugin found for prefix 'jetty'
This error is being thrown because the build has not been configured to use jetty. You need to read the documentation on how to enable this in your build
http://www.eclipse.org/jetty/documentation/current/maven-and-jetty.html
Your question here:
Google says I should add jetty plugins to mvn configuration .But I am confused about the project.Why doesn't the project developers add this to pom.xml?Or, there exist other solutions?
Needs to be addresses to the developer of the project. The most likely explanation is that he is not using Jetty to test his code. For example in my projects I use a continuous integration server (Jenkins) which automatically builds, deploys and tests code every time a code commit is made.

gwt-maven-plugin how to add the source jar in another module pom.xml

my application has 2 module, one is jar and the other is gwt war. in the jar module (non-gwt) pom.xml, I add
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.1.2</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
and als-admin-viewer-core-1.0.0-sources.jar is successfully created.
Then In the webapp(a gwt application) pom.xml, I want to use this jar, and in the segment, I add
<plugin>
<groupId>org.codehaus.mojo<groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>2.4.0</version>
<dependencies>
<dependency>
<groupId>hk.gov.ehr.service.tch.als</groupId>
<artifactId>als-admin-viewer-core</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>hk.gov.ehr.service.tch.als</groupId>
<artifactId>als-admin-viewer-core</artifactId>
<version>1.0.0</version>
<classifier>sources</classifier>
</dependency>
</dependencies>
<execution>
<phase>prepare-package</phase>
<goals>
<goal>compile</goal>
</goals>
</executions>
........
but when I run maven install for this project (als-admin-viewer-webapp), error
No source code is available for type hk.gov.ehr.service.tch.als.admin.viewer.core.LogSearchCriteria; did you forget to inherit a required module?
is prompted.
what is the problem?!!
I even try to add
<compileSourcesArtifacts>
<compileSourcesArtifact>hk.gov.ehr.service.tch.als:als-admin-viewer-core</compileSourcesArtifact> <!-- groupId:artifactId -->
</compileSourcesArtifacts>
in
<configuration>
section of gwt-maven-plugin, but it still does not help!!
I think you forgot to create "gwt.xml" file in your jar module and inherit it in your main gwt.xml (inside gwt maven module).
Please look at
http://mojo.codehaus.org/gwt-maven-plugin/user-guide/library.html
for details (section "Using general purpose JARs as GWT library").
Also bear in mind: if you're using maven-source-plugin to attach sources, your sources will be distributed with the web application. And if you're using "compileSourcesArtifacts" you avoid this side-effect.

Create a GWT Maven Project

I'm trying to create a new project with Eclipse in order to create GWT application under maven 2 system.
I have create the project with the follow mvn command
mvn archetype:generate -DarchetypeRepository=repo1.maven.org -DarchetypeGroupId=org.codehaus.mojo -DarchetypeArtifactId=gwt-maven-plugin -DarchetypeVersion=2.3.0
I have installed the follow eclipse plugins:
* m2eclipse
* egit
* gwt plugin
Here my POM file:
<?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">
<!-- POM file generated with GWT webAppCreator -->
<modelVersion>4.0.0</modelVersion>
<groupId>com.mobc3.paperquid</groupId>
<artifactId>Backoffice</artifactId>
<packaging>war</packaging>
<version>1.0.0-SNAPSHOT</version>
<name>GWT Maven Archetype</name>
<properties>
<!-- Convenience property to set the GWT version -->
<gwtVersion>2.3.0</gwtVersion>
<!-- GWT needs at least java 1.5 -->
<maven.compiler.source>1.5</maven.compiler.source>
<maven.compiler.target>1.5</maven.compiler.target>
<webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
</properties>
<dependencies>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId>
<version>2.3.0</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>2.3.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.7</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<!-- Generate compiled stuff in the folder used for developing mode -->
<outputDirectory>${webappDirectory}/WEB-INF/classes</outputDirectory>
<plugins>
<!-- GWT Maven Plugin -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>2.3.0</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>test</goal>
<goal>i18n</goal>
<goal>generateAsync</goal>
</goals>
</execution>
</executions>
<!-- Plugin configuration. There are many available options, see gwt-maven-plugin
documentation at codehaus.org -->
<configuration>
<runTarget>Backoffice.html</runTarget>
<hostedWebapp>${webappDirectory}</hostedWebapp>
<i18nMessagesBundle>com.mobc3.paperquid.backoffice.client.Messages</i18nMessagesBundle>
</configuration>
</plugin>
<!-- Copy static web files before executing gwt:run -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>exploded</goal>
</goals>
</execution>
</executions>
<configuration>
<webappDirectory>${webappDirectory}</webappDirectory>
</configuration>
</plugin>
</plugins>
</build>
</project>
I can compile and deploy my application using the linux shell but I have many problems to build and run the application inside eclipse.
I haven't found any tutorial that explain how to create step by step a GWT application under maven inside eclipse.
Can someone help me?
One more option:
Make a gwt project by using the gwt plugin in Eclipse. Now you have an Eclipse gwt project.
Select the project in Project Explorer, right-click it, then choose Configure. Then select Convert to Maven Project. Now you get a gwt-maven project.
Now add necessary dependencies to pom.xml.
Here is the relevant (I think) section from my pom setup when I was running my GWT app with the gwt:run goal:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>2.3.0</version>
<configuration>
<runTarget>/ModuleName.html</runTarget>
<modules>
<module>${project.groupId}.package.ModuleName</module>
</modules>
<copyWebapp>true</copyWebapp>
</configuration>
<executions>
<execution>
<configuration>
<extraParam>true</extraParam>
</configuration>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
I should say, though, that I now use the GWT Eclipse Plugin to run my app within Eclipse, so it's been a while since I used this configuration. From what I remember reading, the "copyWebapp" "true" is one of the key pieces of configuration. It also helped me to specify the module name directly, because the gwt-maven-plugin sometimes had problems locating it.