This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help with getting started with Maven, JSF, and Eclipse/JBoss dev studio

 
Scott Geller
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've been trying to follow this tutorial (http://www.mkyong.com/jsf2/jsf-2-0-hello-world-example/) to get started with Maven and JSF. I used maven to generate a simple webapp project. When I import my maven project into jboss dev studio and add all of the jsf dependencies, I get the following errors:

JavaServer Faces 2.0 can not be installed : One or more constraints have not been satisfied.
JavaServer Faces 2.0 requires Dynamic Web Module 2.5 or newer.

I have been looking online for about 6 hours today trying to find a solution and I'm just about dead. I will paste in my pom.xml file to show you everything I have so far. If you can help me with this problem, it would be greatly appreciated.

<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.scott.common</groupId>
<artifactId>JavaServerFaces</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>JavaServerFaces Maven Webapp</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>2.1.7</version>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>2.1.7</version>
</dependency>

<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>

<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
</dependency>

<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
</dependency>
</dependencies>
<build>
<finalName>JavaServerFaces</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
</project>


Thank you,
Scott
 
Alan Smith
Ranch Hand
Posts: 185
Firefox Browser Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Assuming you are using Eclipse, have you tried to change the project facet to Dynamic Web Project in the projects properties (Right click project --> properties --> project facets --> convert to faceted form...)? Ideally you should set your maven project up in Eclipse using the m2e plugin instead of creating the template from the command line and then importing. It will avoid time wasting errors like the one you posted. After that you can go to the command line and run maven commands manually.

ps. Netbeans has built in support for Maven and great JSF support out of the box if you are interested in that IDE.

Alan
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18020
47
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your problem has nothing to do with JSF and everything to do with Eclipse, which is what's hosting the JBoss dev studio.

I'm moving your question to the IDEs forum.
 
Ranganathan Kaliyur Mannar
Bartender
Posts: 1101
10
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Scott,
Welcome to the Ranch!

It would really help if you post your pm.xml with some indentation.
And, did you use 'Import Maven project ' to import the project? Also, what version of jbdev are you using?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic