- This topic has 12 replies, 2 voices, and was last updated 15 years, 8 months ago by Riyad Kalla.
-
AuthorPosts
-
MartinMemberHi,
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?
Regards,
Martin.
Riyad KallaMemberMartin,
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.
MartinMemberHmm, 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.
Riyad KallaMemberMartin,
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.
MartinMemberThanks, 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.
Riyad KallaMemberMartin,
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.
MartinMemberThanks Riyad.
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.
Riyad KallaMemberMartin,
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.
MartinMemberMaybe 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.
Riyad KallaMemberAhhh 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.
MartinMemberThanks, Riyad, for this information. This sounds nice, I will definitely give it a try!
MartinMemberHello, 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”?
Riyad KallaMemberNo, no secret feature. The project during the creation-step needs to be created as a Maven project.
-
AuthorPosts