Win a copy of Zero to AI - A non-technical, hype-free guide to prospering in the AI era this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

Problem excluding *.jars in war build using maven(pom.xml)

 
Ranch Hand
Posts: 64
Oracle Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everybody, I've been working with maven with a multi-module project, I had some problems to achieve my war building but I finally did it. The problem now is the deploying of my war.

The problem is basically that my war is being generated with some extra jars, these "extra" jars causes a conflict with other jars in my tomcat, that's why I want to remove them during the build of my war. For example my war must be like this to run:

ROOT.war/WEB-INF/classes/lib/stax-api.jar
ROOT.war/WEB-INF/classes/lib/webservices-rt.jar
ROOT.war/WEB-INF/classes/lib/junit.jar

But in the war they appeared like this:
ROOT.war/WEB-INF/classes/lib/activation.jar
ROOT.war/WEB-INF/classes/lib/jaxb.jar
ROOT.war/WEB-INF/classes/lib/xerces.jar
ROOT.war/WEB-INF/classes/lib/stream.jar
ROOT.war/WEB-INF/classes/lib/stax-api.jar
ROOT.war/WEB-INF/classes/lib/webservices-rt.jar
ROOT.war/WEB-INF/classes/lib/junit.jar
and a lot of jars more that I don't want because they cause a "NoSuchMethodError" during my deploy in tomcat, I tried the tag "scope: provided" for the dependencies, I also tried "excludes" to exclude the jars but none of them seems to work, the war is always generated with all these jars.

Please I will be very grateful if someone could help me I will be really grateful, thanks in advance for your attention and help.
 
Bartender
Posts: 1051
5
Hibernate Eclipse IDE Chrome
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you provide more information about the structure of your Maven project? Specifically, where files reside before you run a Maven build.
 
Marcelo Tataje
Ranch Hand
Posts: 64
Oracle Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry for the inconvenients, after look my pom.xml for almost 4 hours I was able to found the error, the problem were these tags:



I removed from my pom and voilá, it worked. Hope the solution runs for the person who needed. Thanks for your attention and time.
 
this llama doesn't want your drama, he just wants this tiny ad for his mama
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic