January 22, 2009 at 11:29 am #293815
we use maven2 for the build and let the maven-eclipse-plugin create our eclipse configuration files (m2eclipse is not working well with our project). We defined the dependencies to the standard JEE libs as usual with scope “provided” in our poms. The problem is, that jsp-api.jar is added to the build-path by the maven-eclipse-plugin, and therefore myeclipse deploys it to the server (Tomcat 6) in WEB-INF/lib, which leads to a JasperException when accessing the app. (“Unable to read TLD “META-INF/fmt.tld” from JAR file “file:/D:/Projekte/epa/install/apache-tomcat-6.0.18/webapps/epa-web/WEB-INF/lib/jstl-1.2.jar”: org.apache.jasper.JasperException: Failed to load or instantiate TagLibraryValidator class: org.apache.taglibs.standard.tlv.JstlFmtTLV…”
How can I make myeclipse access the jsp-api.jar when compiling the sources but NOT deploy the jsp-api.jar to Tomcat?
Martin.January 23, 2009 at 1:33 pm #293887
You can work with the Deployment rules under the project properties > Web > Deployment and re-add that JAR in some way that it’s filtered out… for example, filter out User Libraries, then create a single user library with that JAR and add it to the project.January 27, 2009 at 10:30 am #294029
Hmm, adding the jar again as a user library does not work, because it’s already added. The error message is “Build path contains duplicate entry: ‘jsp-api-2.1.jar’ for project ‘my-project'” and the OK button is greyed out.January 29, 2009 at 2:01 pm #294138
Sorry for the confusion, you would have to remove it from one resource and re-add it from another. If you can’t do that, there isn’t a way to filter deployments at this time in MyEclipse.January 29, 2009 at 2:47 pm #294144
Thanks, Riyad, for the tip. Removing the jar from the original resource means removing it from the pom, which will break the maven build.
In our environment maven is the leading tool that handles all dependencies, and we use the maven-eclipse-plugin to create our .classpath files. Removing the file in the Java Build Path Dialog must be done again every time after we call the plugin.
Maven and MyEclipse are both wonderful tools. To use them together is a everlasting search for workarounds.February 2, 2009 at 9:36 am #294220
I’m sorry about not having better news for you — if it’s any help I am pushing hard to get through management the addition of deployment exclusion which would fix this issue for you.February 3, 2009 at 4:27 am #294266
Having deployment exclusions would definitely be a nice feature. Or, more generally, all scopes that maven defines: http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Dependency_Scope. This would also handle the problem, that myeclipse also deploys test-classes and -resources.February 4, 2009 at 12:53 pm #294354
We looked into this a bit closer and it looks like the deployer is actually honoring the Maven scopes… but I told the dev to look into it further to see why *this* wasn’t working for you, very strange.February 5, 2009 at 12:45 am #294386
Maybe it’s honoring only the maven scopes, if maven4myeclipse is used. As I wrote, we use the maven-eclipse-plugin instead. I didn’t tried maven4myeclipse by now, because it says, it’s for myeclipse projects that want to use myeclipse and not the other way round, as we use it.February 5, 2009 at 8:10 am #294395
Ahhh that’s what’s going on then. Because you aren’t using the Maven4MyEclipse integration, MyEclipse is using it’s standard deployment code — ignoring the Maven scopes. The only way to get the best of both worlds is to use maven-enabled MyEclipse projects.
Actually Maven-enabled MyEclipse projects create pom.xml files and use standard Maven conventions to build and package the projects — so you can take those projects and put them on another machine and just use command line maven just fine.
I would encourage you to give it a try.February 5, 2009 at 11:55 pm #294474
Thanks, Riyad, for this information. This sounds nice, I will definitely give it a try!March 26, 2009 at 7:57 am #296800
Hello, again. I actually could spare a little time for this again, but didn’t manage to activate Maven4MyEclipse for my existing project. The doc also says that this is not possible (see http://www.myeclipseide.com/documentation/quickstarts/maven_overview/, Chapter 4). Is this a “secret feature”?April 1, 2009 at 7:36 am #297087
No, no secret feature. The project during the creation-step needs to be created as a Maven project.