In the my application I have set some jars as project dependency. This jars are added as User Library. As I am running the application in JBoss AS7 and I am using the JSF implementation which is provided by the JBoss server, I have copied those JSF jars from the module and create a new User Library namely JBoss JSF. This library has been used to create JSF 2 Dynamic Web Project in Eclipse. Now when I am exporting it as a WAR file, those jsf jars are automatically being copied and added in /WEB-INF/lib
of the war. I don't want that these files are added as they are already present in the container.
Is there any way to do it?
For more information, this is the content of the .classpath file:
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/common"/>
<classpathentry kind="src" path="src/service"/>
<classpathentry kind="src" path="src/web"/>
<classpathentry kind="src" path="src/persistent"/>
<classpathentry kind="src" path="src/dao"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jre7">
<attributes>
<attribute name="owner.project.facets" value="java"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/JBoss JSF">
<attributes>
<attribute name="owner.project.facets" value="jst.jsf"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/JBoss Servlet"/>
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/JBoss log4j"/>
<classpathentry kind="output" path="build/classes"/>
</classpath>
The Deployment Assembly of my application:
It is possible to include or exclude certain files from the WAR file, by using the <packagingIncludes> and <packagingExcludes> configuration parameters. They each take a comma-separated list of Ant file set patterns.
We can have multiple transitive dependencies can be excluded by using the <exclusion> tag for each of the dependencies we want to exclude and placing all these exclusion tags inside the <exclusions> tag in pom.
war file have all the needed . jar's to run in a container in a different physical server (but same software i.e. apache tomcat).
Multiple transitive dependencies can be excluded by using the <exclusion> tag for each of the dependency you want to exclude and placing all these exclusion tags inside the <exclusions> tag in pom. xml. You will need to mention the group id and artifact id of the dependency you wish to exclude in the exclusion tag.
Try this
or try to add one more attribute to the .classpath file
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/JBoss JSF">
<attributes>
<attribute name="owner.project.facets" value="jst.jsf"/>
<attribute name="org.eclipse.jst.component.nondependency" value=""/>
</attributes>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With