Mapstruct only works via maven package..is maven compiler plugin really necessary? - eclipse

I'm trying setting up mapstruct with my project, I'm used to lombok that does it via a simple jvm agent so I really can't understand how to make mapstruct work.
Here's my pom:
<properties>
<m2e.apt.activation>jdt_apt</m2e.apt.activation>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven.compiler.version}</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
<annotationProcessorPaths>
<path>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<version>${springboot.version}</version>
</path>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</path>
<path>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct-processor</artifactId>
<version>${org.mapstruct.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${springboot.version}</version>
</plugin>
</plugins>
</build>
Please mind that, before mapstruct entered the game, I didn't need this whole maven compile plugin block: everything was working fine. I could build my springboot fat jar with no problems at all, no need to explicitely specify spring and lombok annotation processing...they were very good times.
Now I'm not even sure that I didn't introduce some regressions with the above code but, anyhow, I noticed that mapstruct classes are only generated when I do "mvn package".
I would have expected, like for lombok, for them to be generated automatically each time I saved an object but this does not happen.
Do you have any idea? And can you assure me that that specific build block does not change anything in my spring boot project?

For the code generation to work automatically make sure that you have the m2e-apt plugin installed.
As for having or not having the maven-compiler-plugin block. It is a flavour that the MapStruct teams like to recommend.
MapStruct is an annotation processor, which means that you don't need it during runtime. Therefore, you need 2 dependencies mapstruct where the annotations are located and the mapstruct-processor where the processor is located. The processor has some extra dependencies and contains shaded Freemarker for the code generation.
The use of annotationProcessorPaths allows you to have annotation processor paths and not have conflicts on your classpath, i.e. not accidentally using some internal MapStruct classes in your production code. On top of that, you don't need Spring Boot to package the mapstruct-processor provided dependency for your runtime application.
From the maven-compiler documentation the annotationProcessorPaths means the following:
Classpath elements to supply as annotation processor path. If specified, the compiler will detect annotation processors only in those classpath elements. If omitted, the default classpath is used to detect annotation processors. The detection itself depends on the configuration of annotationProcessors.
So if you really want you can add the mapstruct-processor to your normal dependencies.

Related

Upon following setup instructions for Vue GWT, IntelliJ IDEA doesn't process e.g. #Component annotations

(NOTE: this question is self-answered Q&A-style, however please feel free to add and expand on my answer.)
I started experimenting with Vue GWT and followed the general setup instructions as well as the ones specific to IntelliJ IDEA. IDEA, however, refused to process my #Component annotation (e.g. to generate the factory class for my component).
My answer applies if you use Maven and have used IDEA's Maven project import when opening your project.
I found that I had to add the following to the project's pom.xml, an idea adapted from MapStruct setup:
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<!-- For IntelliJ IDEA to process Vue GWT annotations. -->
<annotationProcessors>
<annotationProcessor>com.axellience.vuegwt.processors.VueGwtProcessor</annotationProcessor>
</annotationProcessors>
...
</configuration>
...
</plugin>
<plugins>

Exception while building Scala-Maven project on IntelliJ

I am trying to build a Scala-Maven project on IntelliJ IDEA. Right after creating the project, it says build successful. This is how my pom.xml looks like:
<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.dbloads.pgms</groupId>
<artifactId>Arts</artifactId>
<version>1.0-SNAPSHOT</version>
<inceptionYear>2008</inceptionYear>
<properties>
<scala.version>2.7.0</scala.version>
</properties>
<dependencies>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>${scala.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.specs</groupId>
<artifactId>specs</artifactId>
<version>1.2.5</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<sourceDirectory>src/main/scala</sourceDirectory>
<testSourceDirectory>src/test/scala</testSourceDirectory>
<plugins>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>3.4.0</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
<configuration>
<scalaVersion>${scala.version}</scalaVersion>
<args>
<arg>-target:jvm-1.5</arg>
</args>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<configuration>
<downloadSources>true</downloadSources>
<buildcommands>
<buildcommand>ch.epfl.lamp.sdt.core.scalabuilder</buildcommand>
</buildcommands>
<additionalProjectnatures>
<projectnature>ch.epfl.lamp.sdt.core.scalanature</projectnature>
</additionalProjectnatures>
<classpathContainers>
<classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER</classpathContainer>
<classpathContainer>ch.epfl.lamp.sdt.launching.SCALA_CONTAINER</classpathContainer>
</classpathContainers>
</configuration>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>3.4.0</version>
<configuration>
<scalaVersion>${scala.version}</scalaVersion>
</configuration>
</plugin>
</plugins>
</reporting>
</project>
Next I tried to add the compiler options in project like below:
Once added and when I click the RUN button, I get the below error message:
[ERROR] Plugin net.alchim31.maven:scala-maven-plugin:3.4.0 or one of its dependencies could not be resolved: Failed to read artifact descriptor for net.alchim31.maven:scala-maven-plugin:jar:3.4.0: Could not transfer artifact net.alchim31.maven:scala-maven-plugin:pom:3.4.0 from/to central (https://repo.maven.apache.org/maven2): PITC-Zscaler-EMEA-Amsterdam3PR.proxy.corporate.ge.com: Unknown host PITC-Zscaler-EMEA-Amsterdam3PR.proxy.corporate.ge.com -> [Help 1]
I am using the jdk version: 1.8.0_172 and I have added the Scala plugin directly from the plugins. Hence it is the latest version of the Scala.
Could anyone let me know how can I fix this problem.
It looks like you need to configure Maven and IntelliJ to use network proxy settings, since it looks like you might be behind a corporate firewall.
Maven has the ability to configure a proxy through its settings (in ~/.m2/settings.xml on Unix-like systems, or %HOME%\.m2\settings.xml on Windows), as follows:
<settings ...>
.
.
<proxies>
<!-- You can have one of these for each possible proxy. -->
<proxy>
<active>true</active>
<!-- Pick some ID for your proxy here. -->
<id>corp-proxy</id>
<!-- Choose your protocol here. E.g. "http", "socks4" or "socks5" -->
<protocol>http</protocol>
<!-- Specify the proxy server name (or IP address) and port of your proxy here. -->
<host>proxy.example.com</host>
<port>8080</port>
<!-- Identify any hosts here that you can access directly. It's unlikely that you'll
need this unless you have a proxy repository (such as Nexus, Artifactory, etc.) on
your corporate network. -->
<nonProxyHosts>www.google.com|*.example.com</nonProxyHosts>
<!-- The following fields are only necessary if required by your proxy. If you need to
enter your own username and password, make sure you do not add this file to version
control! -->
<username>proxyuser</username>
<password>somepassword</password>
</proxy>
</proxies>
.
.
</settings>
Meanwhile, IntelliJ is configured to use proxies through its settings. Refer to this answer for further details. (Note that setting proxy information via the JAVA_OPTS environment variable will work for running any Java/Scala/JVM application that needs to access the Internet via a proxy.)
Alternatively, if your proxy settings are configured correctly or are not required, it might be a temporary network connection issue, so make sure you have an Internet connection and try again. (The exception is a failure by Maven to download the plugin from the Maven central repository.)
BTW, the version of Scala you have specified—2.7.0—is ancient and almost certainly will not work with JDK 8. Either use an older JDK or a more recent version of Scala (the current release is 2.12.6).
Note that if you need to work with the current version of Apache Spark, you must currently use Scala 2.11.x - the most recent release being 2.11.12.
UPDATE:
From your comments, it seems there is some confusion about the roles played by Maven, the scala-maven-plugin, IntelliJ and the IntelliJ Scala plugin, so I'll quickly summarize them here. Please bear with me if I cover topics you're already familiar with...
Maven is a system for building and publishing software. (It actually does a lot more than just that, which is why Maven describes itself as project management software.) It allows developers to specify, in a single place, all of their software's dependencies (third-party libraries used by the software), which Maven downloads as required from the Central Maven Repository—mostly open-source—or from other, private repositories, as required. Further settings control how compilers are configured, tests are run, reports generated, etc.
Maven was developed primarily for development of Java-language projects. The scala-maven-plugin provides support for the Scala language and compiler within Maven. It is this plugin that downloads the version of the Scala compiler specified by your project and uses it to compile and build your sources.
If you look at your Maven project's pom.xml file, you will notice the following lines in the build section:
<project ...>
...
<build>
...
<plugins>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>3.4.0</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
<configuration>
<scalaVersion>${scala.version}</scalaVersion>
<args>
<arg>-target:jvm-1.5</arg>
</args>
</configuration>
</plugin>
...
</build>
...
</project>
and again in the reporting section:
<project ...>
...
<reporting>
<plugins>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>3.4.0</version>
<configuration>
<scalaVersion>${scala.version}</scalaVersion>
</configuration>
</plugin>
</plugins>
</reporting>
</project>
In both cases, there is a line that reads <scalaVersion>${scala.version}</scalaVersion>, which tells Maven which version of Scala you want to use. The plugin then uses this version of the Scala compiler, and has Maven download it to a cached, local repository on your machine (typically, in C:\Users\{your account}\.m2 on a Windows machine). Note that both Maven and the scala-maven-plugin will ignore any versions of Scala you have installed on your machine.
So which version of Scala is the plugin going to download for you? The value ${scala.version} states that the version number is stored as the value of a property named scala.version. Your pom.xml file also has lines, near the top, that create this property:
<project ...>
...
<properties>
<scala.version>2.7.0</scala.version>
</properties>
...
</project>
So, you can see that you will use version 2.7.0 of the Scala compiler. If you want to use the latest Scala version, you should change this to:
<project ...>
...
<properties>
<scala.version>2.12.6</scala.version>
</properties>
...
</project>
OK, so now you will be using the latest version of the Scala compiler. Now let's move on to IntelliJ...
IntelliJ IDEA is an Integrated Development Environment (IDE), primarily aimed at development with the Java language. It provides syntax highlighting, smart code completion, and other features to simplify the process of writing code. In order to provide those features for the Scala programming language, you need to install its Scala plugin.
You can configure IntelliJ to use any version of Scala that you have installed on your machine. IntelliJ will then know how to compile, build and run your software and can work without using your Maven project object model (POM) file's build definition.
However, one of the reasons for using Maven is to ensure a consistent build environment for developing a project, so that it is not at the whim of whatever each developer may or may not have installed on their machine. For this reason, if a project uses Maven, it's a good idea to tell IntelliJ. That way, IntelliJ can use Maven's pom.xml file to specify the version of the compiler, download dependencies, configure the compiler settings, etc.
So, the above information should help you to get up-and-running with your project, working with your corporation's network proxy and using the latest version of Scala, using Maven and IntelliJ.

FailOnMissingWebXml error when validating pom.xml in Eclipse

When compiling a Maven project I get this error during validation phase of the pom.xml. It is quite a large project with complex build process. The project contains only JavaScript code and does not have to be compiled into war. I'm looking for a way to either:
Just disable the error through disabling failOnMissingWebXml (it appears to be a non-critical Eclipse error)
Find a solution that prevents this validation error in Eclipse (answers to related
questions didn't work for my specific scenario)
The full error:
Description Resource Path Location Type web.xml is missing
and <failOnMissingWebXml> is set to true pom.xml /testproject line 6
Maven Java EE Configuration Problem
After clicking on the error the problem seems to be on this line of 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">
<modelVersion>4.0.0</modelVersion>
<groupId>com.scs</groupId>
<artifactId>scs-control-panel</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging> **THE ERROR POINTS TO THIS LINE**
<parent>
<groupId>com.scs</groupId>
<artifactId>scs</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath>../scs</relativePath>
</parent>
<build>
</build>
<dependencies>
</dependencies>
</project>
Not sure if this is an Eclipse or Maven error, but probably Eclipse, since Maven runs smoothly through command line. It may also be a bug in Eclipse, I'm running Eclipse Java EE IDE for Web Developers Version: Mars.1 Release (4.5.1).
UPDATE1: I tried updating the project in Eclipse but no difference.
UPDATE2: I tried changing the package type from war to pom but no difference.
Everything in Maven revolves around plugins. Plugins are the programs that execute some behavior within the build process. Some plugin inclusions are implied without us having to declare anything.
These implied plugins have default configurations. For example, the maven-compiler-plugin is included in all projects without having to declare it. To override the default configurations we need to declare the plugin in our pom.xml file and set the configurations. For instance, you will see a lot of projects override the default version on the maven-compiler-plugin which has it's source and target set to Java 1.5. We can change to 1.8
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
This is just some theory behind the plugins to give you an idea of what's going on.
With that being said, in order to use <packaging>war<packaging>, the maven-war-plugin is used without us having to declare anything. Just like when using <packaging>jar</packaging>, the maven-jar-plugin's inclusion is implied.
The default configuration for the maven-war-plugin is to fail where there is no web.xml (that configuration property being failOnMissingWebXml). So if we want to override this default, we need to declare the plugin, then set the value for the property to false (not fail)
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.4</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
</plugins>
</build>
UPDATE
The war plugin now allows you to just use a property that it will lookup. This allows you to simply declare the property without having to override the plugin. To add this property, you would simply add the property failOnMissingWebXml with a value of false to the project <properties>
<properties>
<failOnMissingWebXml>false</failOnMissingWebXml>
</properties>
Just by adding this, if you have no further configurations you need to add to the compiler plugin, you will no longer have to override and declare the compiler plugin in your pom.
UPDATE 2
So if you declare the maven-war-plugin and use a <version> 3.0.0+, the default for no web.xml failure will be set to false, so we no longer have to override the configuration property, though we still need to declare the plugin.
Do:
mvn clean eclipse:clean
Add this to your POM:
<packaging>war</packaging>
<properties>
<failOnMissingWebXml>false</failOnMissingWebXml>
</properties>
I guess the easiest path is to choose the war plugin version 3. The default value for failOnMissingWebXml has been changed from true to false.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.0.0</version>
</plugin>
Once set in your pom the nasty error vanishes for ever.
Add the below property to POM.xml
<failOnMissingWebXml>false</failOnMissingWebXml>
I was able to resolve this problem by adding this property in POM.xml as like below.
<properties>
<failOnMissingWebXml>false</failOnMissingWebXml>
</properties>

How to avoid maven WTP enabled project automatically generates web.xml?

I have setup multi-modules environment with Maven, Eclipse, WTP.
The Eclipse Plugins I installed are:
m2e
m2e-extras
m2e-overlay
I have a war module(w2) that depends on another war module(w1), w1 has a web.xml file, and w2 doesn't have it's own, it uses overlay web.xml from w1. Whenever I click maven -> Update project configuration, eclipse automatically generates an empty web.xml for w2 which I really don't want.
How can I disable this?
By default, m2e-wtp specifically asks WTP to not generate a web.xml if none exists and adds the Dynamic Web Facet 2.5 by default (or 3.0 if some JavaEE 6 dependencies are detected in the classpath).
The only reason WTP would create the web.xml would be if we asked to install a facet version <=2.4. But these facets can only be inferred from an existing web.xml. See the irony?
So what you see is most likely a bug and you might want to create a bug report with a sample project attached to https://issues.sonatype.org/browse/MECLIPSEWTP
In the mean time you can try to use a dev build of m2e-wtp 0.14.0, available from http://download.jboss.org/jbosstools/builds/staging/m2eclipse-wtp-e37/all/repo/, as I recently made changes in the way Dynamic Facet version changes are handled.
And as for the overlay exclusion configuration described in the first reply, that wouldn't work for you since you want to specifically use w1's web.xml, not exclude it. I would rather invert the overlay order like :
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<overlays>
<overlay>
<groupId>foo.bar</groupId>
<artifactId>w1</artifactId>
</overlay>
<overlay>
<!-- this is the current w2,
it's resources will be overridden by w1
-->
</overlay>
</overlays>
</configuration>
</plugin>
What you can do is - explicitly exclude the dependent module's web.xml and while packaging, it will pick the xml from the parent war:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<overlays>
<!-- Overlay w2 WAR with w1 specific web.xml -->
<overlay>
<groupId>xyz</groupId>
<artifactId>w1</artifactId>
<excludes>
<exclude>WEB-INF/web.xml</exclude>
</excludes>
</overlay>
</overlays>
</configuration>
</plugin>
</plugins>
</build>
Cheers!

GWT/Eclipse/Jetty issue: Jasper can't resolve tag libraries

I'm trying to get GWT Hosted mode working in Eclipse, à la this HOWTO. Servlets work fine, as does my GWT code, but all my JSPs fail because with errors such as the following:
[WARN] /view/lniExecutiveSummary.htm
org.apache.jasper.JasperException: /WEB-INF/jsp/lni/lniExecutiveSummary.jsp(1,1) The absolute uri: http://java.sun.com/jsp/jstl/fmt cannot be resolved in either web.xml or the jar files deployed with this application
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
[ trimmed ]
This webapp works fine when deployed under Tomcat 5x; I just can't seem to get it to resolve the taglibs when running in Eclipse.
I'm new to Eclipse, and getting it working with all the moving parts required for GWT+Maven has me pulling my hair out.
Update: I'm no longer using Eclipse; I've switched (back!) to Intellij IDEA. So I can't honestly evaluate the answers you kind folks have posted. Once some voting action happens, or someone else reports success with one of these methods, I'll accept the appropriate answer. Thanks.
I feel your pain. I've gone thru the same pain trying to get gwt, maven, and eclipse to work together.
I've been able to get it working with maven using the following pom.xml. This way you can use mvn gwt:run to run in hosted mode, but unfortunately, I could never get the mvn goal mvn gwt:eclipse for generating an eclipse launch run time config to work.
Here's the relevant snippets from my pom.xml. Note that I've found it easier to install gwt in separate location and point maven to use that instead of having mvn download gwt from repo. The "system" level scope in the mvn dependencies are what make this happen.
<properties>
<!-- convenience to define GWT version in one place -->
<gwt.version>1.7.1</gwt.version>
<google.webtoolkit.home>${env.GWT_HOME}</google.webtoolkit.home>
<!-- tell the compiler we can use 1.5 -->
<maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>
</properties>
<dependencies>
<!-- GWT dependencies (from central repo) -->
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId>
<version>${gwt.version}</version>
<scope>system</scope>
<systemPath>${env.GWT_HOME}/gwt-servlet.jar</systemPath>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>${gwt.version}</version>
<scope>system</scope>
<systemPath>${env.GWT_HOME}/gwt-user.jar</systemPath>
</dependency>
... other dependencies...
</dependencies>
<build>
<outputDirectory>war/WEB-INF/classes</outputDirectory>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>1.1</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>generateAsync</goal>
<goal>test</goal>
</goals>
</execution>
</executions>
<configuration>
<runTarget>com.gwt.example/Application.html</runTarget>
<extraJvmArgs>-Xmx512m</extraJvmArgs>
</configuration>
</plugin>
<!--
If you want to use the target/web.xml file mergewebxml produces,
tell the war plugin to use it.
Also, exclude what you want from the final artifact here.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<webXml>target/web.xml</webXml>
<warSourceExcludes>.gwt-tmp/**</warSourceExcludes>
</configuration>
</plugin>
-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
<module>com.gwt.example</module>
</configuration>
</plugin>
</plugins>
...rest of pom.xml...
Another technique I've had success with is to use the eclipse google gwt plugin. Just use the wizard to create a new gwt project, make sure that you can run it from eclipse, then modify with your own code.
This webapp works fine when deployed under Tomcat 5x; I just can't seem to get it to resolve the taglibs when running in Eclipse. I'm new to Eclipse, and getting it working with all the moving parts required for GWT+Maven has me pulling my hair out.
You apparently have the JSTL JAR file(s) in Tomcat/lib instead of WEB-INF/lib. You can fix this in at least three ways:
Move/copy the JSTL JAR file(s) into WEB-INF/lib.
Move/copy the JSTL JAR file(s) into Tomcat/lib of your development machine.
Associate the right Tomcat server containing the JSTL JAR file(s) with web project in Eclipse. If not done yet, add the Tomcat server in Servers view. Then in project properties go to Java Build Path > Libraries > Add Library > Server Runtime > select the server in question.
Add the Jar files in eclipse project classpath. if you already had this file tomcat lib. This option will works for you. Second option is add jar in Web-Inf lib folder if you have eclipse web project.
Did you try to mark the "jsf-api.jar" as "exported" in your Java project ?
(as mentioned in this thread)
1.) Go into the java-project properties and mark the "jsf-api.jar" as exported.
(project>properties>java build path>order and exports)
2.) Go into the advanced global tomcat preferences and add your project to
the tomcat classpath (windows>preferences>tomcat>advanced>add projects to
tomcat classpath)
Then, try again to run your webapp under eclipse.
Here is an article describing the same procedure/setup, not for JSF but Hudson (same problem though)
You can clearly see the two steps I mentioned above:
(source: hudson-ci.org)
(source: hudson-ci.org)