I have a project created from some maven archetype, dont remmebrer realy which one. I use maven and Eclipse Kepler.
The project is deployed on Wildfly8.1 server
In the project facests I have JSF 2.0 and when I try to change the facet to JSF 2.2 I get the massege "Cann not change version of facet JavaServerFaces ..."
Do I have to change something in my maven pom file?
Here is my maven pom :
<?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">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>ypay</artifactId>
<groupId>si.arctur</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>ypay-web</artifactId>
<packaging>war</packaging>
<name>ypay Web module</name>
<dependencies>
<dependency>
<groupId>org.jboss.spec.javax.ejb</groupId>
<artifactId>jboss-ejb-api_3.1_spec</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.primefaces.extensions</groupId>
<artifactId>primefaces-extensions</artifactId>
<version>1.2.1</version>
</dependency>
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>4.0</version>
</dependency>
<!-- Dependency on the EJB module so we can use it's services if needed -->
<dependency>
<groupId>si.arctur</groupId>
<artifactId>ypay-ejb</artifactId>
<type>ejb</type>
<scope>provided</scope>
</dependency>
<!-- Import the JAX-RS API, we use provided scope as the API is included
in JBoss AS 7 -->
<dependency>
<groupId>org.jboss.spec.javax.ws.rs</groupId>
<artifactId>jboss-jaxrs-api_1.1_spec</artifactId>
<scope>provided</scope>
</dependency>
<!-- Import the CDI API, we use provided scope as the API is included
in JBoss AS 7 -->
<dependency>
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
<scope>provided</scope>
</dependency>
<!-- Import the JPA API, we use provided scope as the API is included
in JBoss AS 7 -->
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.0-api</artifactId>
<scope>provided</scope>
</dependency>
<!-- Import the JSF API, we use provided scope as the API is included
in JBoss AS 7 -->
<dependency>
<groupId>org.jboss.spec.javax.faces</groupId>
<artifactId>jboss-jsf-api_2.2_spec</artifactId>
<version>2.2.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.omnifaces</groupId>
<artifactId>omnifaces</artifactId>
<version>1.7</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<configuration>
<!-- Java EE 6 doesn't require web.xml, Maven needs to catch
up! -->
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
</plugins>
</build>
</project>
You don't mention which Eclipse plugins you use. Assuming you have a current version of JBoss Tools, the facets should be set correctly when first importing the Maven project into Eclipse, depending on the POM dependencies.
In your POM, there's a mixture of Java EE 6 and 7 dependencies, which might be causing the problem.
Try deleting the javax:javaee-api:6.0 dependency - you have indidual Java EE 7 APIs further down in your POM -, then run Maven | Update project in Eclipse.
If that does not help, delete the project from the workspace, delete all Eclipse metadata from the file system (.project, .classpath,. settings) and re-import the project.
Related
I am totally new in Java , and trying to install Cucumber.
I have downloaded JDK and JRE and their versions are: jdk-12.0.1 && jre1.8.0_211 and set the environment variables.
I have also downloaded Eclipse
I am following the tutorial https://www.toolsqa.com/cucumber-video-tutorials/
I have downloaded all jar files here, C:\JavaJars\Cucumber
then I have referenced them in my pom.xml file (C:\JavaProjects\CucumberMaven)
Here is a snippet of dependencies:
<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>ToolsQA</groupId>
<artifactId>CucumberMaven</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>CucumberMaven</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-java</artifactId>
<version>1.2.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-jvm</artifactId>
<version>1.2.5</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-junit</artifactId>
<version>4.13-beta-3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.sourceforge.cobertura</groupId>
<artifactId>cobertura</artifactId>
<version>2.1.1</version>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-jvm-deps</artifactId>
<version>1.0.5</version>
</dependency>
<dependency>
<groupId>net.masterthought</groupId>
<artifactId>cucumber-reporting</artifactId>
<version>4.6.0</version>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>gherkin</artifactId>
<version>2.12.2</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>2.0.2-beta</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13-beta-3</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
in command prompt -->
mvn clean install
I get the error -->
[ERROR] Source option 5 is no longer supported. Use 7 or later.
[ERROR] Target option 5 is no longer supported. Use 7 or later.
I am not sure how to fix it
maven-compiler-plugin by default will compile your project using Java 1.5 which is where m2e gets its information.
Your effective pom.xml will implicitly use the default settings in the maven-compiler-plugin pom.xml.
That's why you have to explicitly declare the maven-compiler-plugin in your project with something other than 1.5.
Add this to your pom.xml
<build>
<pluginManagement>
<plugins>
<!-- Default java version was 1.5, to change the default version added this plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
I have a spring STS project which depends on two other projects in the same workspace. I have included them in my pom.xml but when I build jar they are excluded from the generated jar.Could you please let me know how to include these two dependent projects in the build.
I have below entries in pom.xml
<dependencies>
<dependency>
<groupId>org.acord.standards.life</groupId>
<artifactId>txlife</artifactId>
<version>2.37.00</version>
</dependency>
<dependency>
<groupId>com.xxx.service.query</groupId>
<artifactId>queryutil</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.acord.standards.life</groupId>
<artifactId>txlife</artifactId>
<version>2.37.00</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.xxx.service.query</groupId>
<artifactId>queryutil</artifactId>
<version>1.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
<configuration>
<attach>true</attach>
<!-- <includes>
<include>
<groupId>org.acord.standards.life</groupId>
<artifactId>txlife</artifactId>
<version>2.37.00</version>
<classifier>2.37.00</classifier>
</include>
<include>
<groupId>com.xxx.service.query</groupId>
<artifactId>queryutil</artifactId>
<version>1.0</version>
<classifier>1.0</classifier>
</include>
</includes> -->
</configuration>
</plugin>
</plugins>
</build>
I solve this problem following this documentation from Spring.io.
An alternative approach is you run Maven Install for each dependency project and, after it, set them in your pom.xml (in your main project). For example, I have a main spring project called Alna Rest that depends of others particular spring projects how Alna Data and Alna Service, then, in my Alna Rest project my pom.xml has this:
<dependency>
<groupId>com.alna.data</groupId>
<artifactId>alna-data</artifactId>
<version>0.0.1</version>
</dependency>
<dependency>
<groupId>com.alna.service</groupId>
<artifactId>alna-service</artifactId>
<version>0.0.1</version>
</dependency>
After it I can run Maven Install in my Alna Rest project that the Spring Boot Maven Plugin build an executable jar with all projects dependencies.
Well, this works for me. But I don't know if it is the better approach for build a project that requires many othes spring boot projects. Then I recommend you search more about this.
I have an ASP.NET (C#) project that is based on consuming SOAP services from the german SAP ERP and we recently decided to port it to a Java dynamic web project. Mostly of all these web services needs authentication.
On Visual Studio (ASP.NET), though, it was pretty easy and straightforward to import a web service, as easy as clicking on Add service reference, putting the WSDL URL, giving a namespace name and clicking on Ok. Done. All the generated classes will be "hidden" just so someone wouldnt change then. Nice! Also, we have a bindings file, which is plain XML, containing stuff like maxBufferSize, maxBufferPoolSize, maxReceivedMessageSize etc...
On Eclipse (Java), I tried adding a New Web Service Client (New > Web Services > Web Service Client) and this is where I faced my first problem. It is like it does not recognize the WSDL as a valid URL for some reason, however it works in any browser (it even prompts for the authentication) and also in the Visual Studio project. This is what the WSDL look like: http://spceqsap01:8000/sap/bc/srt/wsdl/flv_10002A111AD1/bndg_url/sap/bc/srt/rfc/sap/zws_listar_municipios/300/zws_listar_municipios/zws_listar_municipios?sap-client=300
There are a few WSDLs out there used in examples and they are "successfully" imported, except that the Eclipse complains about some JARs. One curious thing that I noted is that most of them ends with ?wsdl, but placing this in the above WSDL wont work.
Maven has a few plugins to generate the source code for the WSDLs, but I couldnt get it to work too (sources weren't generated or anything, probably because missing some plugin configuration or wrong ones). If someone has a working example for consuming SAP web services, please post below!
For the Java dynamic web project, we're currently using the following:
Maven 3.3.9
Java 8
Tomcat 9
VRaptor 4.2
Hibernate 5.2.9
Eclipse Neon 4.6.1
This is my pom.xml:
<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">
<!-- Artifact details -->
<modelVersion>4.0.0</modelVersion>
<groupId>br.com.nooder</groupId>
<artifactId>portal</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<!-- Properties -->
<properties>
<deploy.version.log4j>2.8.2</deploy.version.log4j>
<deploy.version.vraptor>4.2.0-RC5</deploy.version.vraptor>
<deploy.version.weld>3.0.0.CR2</deploy.version.weld>
<deploy.version.hibernate>5.2.9.Final</deploy.version.hibernate>
<deploy.version.junit>4.12</deploy.version.junit>
<deploy.version.slf4j>1.7.25</deploy.version.slf4j>
</properties>
<!-- Development and production settings -->
<profiles>
<profile>
<id>tst</id>
<properties>
<deploy.enviroment>tst</deploy.enviroment>
</properties>
</profile>
<profile>
<id>prd</id>
<properties>
<deploy.enviroment>prd</deploy.enviroment>
</properties>
</profile>
</profiles>
<!-- Dependencies -->
<dependencies>
<!-- JUnit -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${deploy.version.junit}</version>
</dependency>
<!-- VRaptor -->
<dependency>
<groupId>br.com.caelum</groupId>
<artifactId>vraptor</artifactId>
<version>${deploy.version.vraptor}</version>
</dependency>
<!-- VRaptor plugins -->
<dependency>
<groupId>br.com.caelum.vraptor</groupId>
<artifactId>vraptor-java8</artifactId>
<version>4.0.0.Final</version>
</dependency>
<dependency>
<groupId>br.com.caelum.vraptor</groupId>
<artifactId>vraptor-brutauth</artifactId>
<version>4.0.4</version>
</dependency>
<dependency>
<groupId>br.com.caelum.vraptor</groupId>
<artifactId>vraptor-jpa</artifactId>
<version>4.0.5</version>
</dependency>
<!--
<dependency>
<groupId>br.com.caelum.vraptor</groupId>
<artifactId>vraptor-hibernate</artifactId>
<version>4.1.0</version>
</dependency>
-->
<!-- VRaptor's dependencies: Servlet Container (Tomcat) -->
<dependency>
<groupId>org.jboss.weld.servlet</groupId>
<artifactId>weld-servlet-core</artifactId>
<version>${deploy.version.weld}</version>
<exclusions>
<exclusion>
<groupId>org.jboss.spec.javax.el</groupId>
<artifactId>jboss-el-api_3.0_spec</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jboss.weld</groupId>
<artifactId>weld-core-impl</artifactId>
<version>${deploy.version.weld}</version>
<exclusions>
<exclusion>
<groupId>org.jboss.spec.javax.el</groupId>
<artifactId>jboss-el-api_3.0_spec</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- VRaptor's dependencies: Java 8 -->
<dependency>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.18.1-GA</version>
</dependency>
<!-- VRaptor's dependencies: Bean Validation -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator-cdi</artifactId>
<version>5.1.1.Final</version>
</dependency>
<!-- Hibernate + DB -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>${deploy.version.hibernate}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>6.1.0.jre8</version>
</dependency>
<!-- JavaEE 8: CDI -->
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
</dependency>
<!-- Tomcat's dependencies: JSTL -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<!-- Maven's dependencies (?) -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.4</version>
<scope>provided</scope>
</dependency>
<!-- Expression language -->
<dependency>
<groupId>javax.el</groupId>
<artifactId>el-api</artifactId>
<version>2.2</version>
<scope>provided</scope>
</dependency>
<!-- Log4j 2 -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>${deploy.version.log4j}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${deploy.version.log4j}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>${deploy.version.log4j}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${deploy.version.slf4j}</version>
</dependency>
</dependencies>
<!-- Build -->
<build>
<finalName>portal</finalName>
<sourceDirectory>src/main/java</sourceDirectory>
<testSourceDirectory>src/test/java</testSourceDirectory>
<!-- Resources -->
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<filters>
<filter>src/main/filters/settings.${deploy.enviroment}.properties</filter>
</filters>
<plugins>
<!-- JDK Compiler Level -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<compilerArgument>-parameters</compilerArgument>
<testCompilerArgument>-parameters</testCompilerArgument>
</configuration>
</plugin>
<!-- Eclipse project -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
<configuration>
<!-- Always download and attach dependencies source code -->
<downloadSources>true</downloadSources>
<downloadJavadocs>false</downloadJavadocs>
<!-- Avoid type mvn eclipse:eclipse -Dwtpversion=2.0 -->
<wtpversion>2.0</wtpversion>
</configuration>
</plugin>
<!-- For Maven Tomcat Plugin -->
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<path>/portal</path>
</configuration>
</plugin>
</plugins>
</build>
</project>
Any input is GREATLY appreciated!
I've been running through the hello world example from JIRA(https://developer.atlassian.com/display/DOCS/Getting+Started).
Eclipse (Kepler) gives me a large list of errors in the pom for my project. Specifically on the first plugin tag. All of them are some variation of
Plugin execution not covered by lifecycle configuration: com.atlassian.maven.plugins:maven-jira-
plugin:4.2.10:filter-test-plugin-descriptor (execution: default-filter-test-plugin-descriptor, phase: process-test-
resources)
with descriptions after the second colon. I think these are the goals.
I've come across this but it wasn't much help to someone who was completely new to all this.
Here is the pom that was generated by Atlassian:
<?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">
<modelVersion>4.0.0</modelVersion>
<groupId>com.atlassian.tutorial</groupId>
<artifactId>helloworld</artifactId>
<version>1.0-SNAPSHOT</version>
<organization>
<name>HelloGoodby Inc.</name>
<url>http://www.helloworldgoodbye.com</url>
</organization>
<name>helloworld</name>
<description>This is the com.atlassian.tutorial:helloworld plugin for Atlassian JIRA.</description>
<packaging>atlassian-plugin</packaging>
<dependencies>
<dependency>
<groupId>com.atlassian.jira</groupId>
<artifactId>jira-api</artifactId>
<version>${jira.version}</version>
<scope>provided</scope>
</dependency>
<!-- Add dependency on jira-core if you want access to JIRA implementation
classes as well as the sanctioned API. -->
<!-- This is not normally recommended, but may be required eg when migrating
a plugin originally developed against JIRA 4.x -->
<dependency>
<groupId>com.atlassian.jira</groupId>
<artifactId>jira-core</artifactId>
<version>${jira.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<scope>test</scope>
</dependency>
<!-- WIRED TEST RUNNER DEPENDENCIES -->
<dependency>
<groupId>com.atlassian.plugins</groupId>
<artifactId>atlassian-plugins-osgi-testrunner</artifactId>
<version>${plugin.testrunner.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>jsr311-api</artifactId>
<version>1.1.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.2.2-atlassian-1</version>
</dependency>
<!-- Uncomment to use TestKit in your project. Details at https://bitbucket.org/atlassian/jira-testkit -->
<!-- You can read more about TestKit at https://developer.atlassian.com/display/JIRADEV/Plugin+Tutorial+-+Smarter+integration+testing+with+TestKit -->
<!-- <dependency>
<groupId>com.atlassian.jira.tests</groupId>
<artifactId>jira-testkit-client</artifactId>
<version>${testkit.version}</version>
<scope>test</scope>
</dependency> -->
<dependency>
<groupId>com.atlassian.maven.plugins</groupId>
<artifactId>maven-amps-plugin</artifactId>
<version>4.2.10</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.atlassian.maven.plugins</groupId>
<artifactId>maven-jira-plugin</artifactId>
<version>${amps.version}</version>
<extensions>true</extensions>
<configuration>
<productVersion>${jira.version}</productVersion>
<productDataVersion>${jira.version}</productDataVersion>
<!-- Uncomment to install TestKit backdoor in JIRA. -->
<!-- <pluginArtifacts> <pluginArtifact> <groupId>com.atlassian.jira.tests</groupId>
<artifactId>jira-testkit-plugin</artifactId> <version>${testkit.version}</version>
</pluginArtifact> </pluginArtifacts> -->
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<jira.version>6.1.3</jira.version>
<amps.version>4.2.10</amps.version>
<plugin.testrunner.version>1.1.2</plugin.testrunner.version>
<!-- TestKit version 5.x for JIRA 5.x, 6.x for JIRA 6.x -->
<testkit.version>5.2.26</testkit.version>
</properties>
</project>
And yet, "this" is exactly going to fix your problem for you.
While Maven just bluntly executes whatever plugins are configured, the Maven Integration (m2e) in Eclipse is a bit more reluctant in doing so. Not everything that makes sense for execution on the command-line should also be executed while within Eclipse. Now, some common plugins it will automatically take care of, but when it encounters the Atlassian plugins it seemingly does not know what to do, and wants your help with that.
Depending on the plugin in question, you can either:
Install a m2e connector for that particular plugin (which will know what to do)
Configure what to do within your POM file (pom.xml)
Configure what to do within your local Eclipse
These are given in (my) order of preference. In any case 2. makes a lot of sense, because each developer who imports your POM file will be good to go, think about that. The configuration in the POM file can either tell m2e to ignore or execute the plugin execution, and in the latter case whether to run on incremental builds (runOnIncremental).
"The link" gives examples of this configuration, which is configured as lifecycleMappingMetadata in a plugin configuration under pluginManagement of your POM. The good news is that Eclipse can help you with the three solutions above using a quick fix on the error that you're seeing.
In my pom file, I have included the dependency of gwt-servlet but if i run mvn clean install and mvn eclipse:eclipse and open the project in eclipse, I get the following error
GWT SDK JAR gwt-servlet.jar is missing in the WEB-INF/lib directory
EDIT :
Here is my dependency (we use a custom maven repository):
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>2.4.0</version>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId>
<version>2.4.0</version>
</dependency>
<dependency>
<groupId>com.smartgwt</groupId>
<artifactId>smart-gwt</artifactId>
<version>2.5</version>
</dependency>
EDIT 2 (main pom):
<build>
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ftp</artifactId>
</extension>
</extensions>
....
There are two things I noticed.
1) The smartgw dependency you specified cannot be resolved from the maven central repository
<dependency>
<groupId>com.smartgwt</groupId>
<artifactId>smart-gwt</artifactId>
<version>2.5</version>
</dependency>
It only has the 2.4 version of smartgw (see here http://search.maven.org/#search%7Cga%7C1%7Csmartgwt) Instead I had to use this
<dependency>
<groupId>com.smartgwt</groupId>
<artifactId>smartgwt</artifactId>
<version>2.4</version>
</dependency>
notice that the artifact ID is different too. (If you have a custom repository containing this then please update your question)
2) You dont need to do eclipse:eclipse instead you can issue the
File > Import > Existing Maven projects
this will auto generate the eclipse project from your pom.xml
UPDATE
I tested with the following :
Parent pom in gwttest2 folder
<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.test</groupId>
<artifactId>gwttest2-main</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>gwttest2-module1</module>
</modules>
<build>
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ftp</artifactId>
</extension>
</extensions>
</build>
<dependencies>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>2.4.0</version>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId>
<version>2.4.0</version>
</dependency>
<dependency>
<groupId>com.smartgwt</groupId>
<artifactId>smartgwt</artifactId>
<version>2.4</version>
</dependency>
</dependencies>
</project>
child pom in gwttest2/gwttest2-module1 folder
<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.test</groupId>
<artifactId>gwttest2-module1</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<parent>
<artifactId>gwttest2-main</artifactId>
<groupId>com.test</groupId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<build>
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ftp</artifactId>
</extension>
</extensions>
</build>
<dependencies>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>2.4.0</version>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId>
<version>2.4.0</version>
</dependency>
<dependency>
<groupId>com.smartgwt</groupId>
<artifactId>smartgwt</artifactId>
<version>2.4</version>
</dependency>
</dependencies>
</project>
Tell Eclipse to use Maven dependencies by right-clicking on your Project folder and selecting
Configure > Convert to Maven Project.
It seems that even after running mvn eclipse:eclipse, you must do this manually to get Eclipse to actually let Maven take care of your dependencies.
If you don't see this option you may not have the M2Eclipse plugin installed in your Eclipse...