• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Maven dependency - Struts

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm building a webapp with Maven. At the moment, I've got all my dependencies setup so that I depend on struts, commons-validator, commons-beanutils etc. etc.

I also have to copy the .tld files into my build manually.

Does Struts provide a Maven2 pom.xml setup with the correct dependencies so that I can simply say "I want to depend on struts"? This would:
1. Copy the required .jar files into my target WEB-INF/lib
2. Copy the required .tld files into my target WEB-INF
 
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to do the same thing.

The only difference is that I am working on Maven 1.0.2 and Struts 1.2.8.

I sure hope anybody can tell me how I can smoothly integrate what I downloaded from Struts (eg example application like the struts-mailreader) into Maven.

I am trying to put struts-mailreader into Maven�s complex application which is generated with Maven�s genapp.

I noticed that the libs in the Struts lib dir does not follow maven convention for jars.
Eg commons-logging comes as commons-logging.jar from Struts but according to Maven�s convention should be commons-logging-1.0.4.jar. Thus, I had to manually extract the jar to look into its manifest�to find out exactly what version of the jar it is�and then rename the jar�and then put that jar into my local Maven repository (.maven)�and then add the dependency xml config into maven�s project.xml. Imagine doing this for the many jars that Struts has/uses. This is both tedious and error prone.

Besides taking care of the jars, I need to also integrate the tlds, webapp etc etc.

Thanks in advance.
 
Ranch Hand
Posts: 1209
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yeah its fair to expect struts to provide a POM.xml
Did you check here

This is for struts2.7 though and hope 2.8 works with the same dependencies.
 
Dave Boden
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Many thanks for that. I've changed my dependency to 1.2.7 and everything now works as I'd expect.

Shame that there's no Maven 2 plugin that will copy the dependent .tld files into the WEB-INF directory under target as part of the war:war process. I've currently got them checked into my src/main/webapp/WEB-INF directory so that they get copied across.
 
Dave Boden
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh, by the way. The powers that be have now updated the 1.2.8 project so that it works as I'd expect. I guess that I just got unlucky and picked the week that they were sorting out the release onto ibiblio.

I would still like to see the <type>tld</type> dependencies folded into struts' pom.xml. We could always <exclude> them if we're not building a jsp app with struts (e.g. if we're using velocity or XML/XSLT). I'd imagine that the most common use case is to build jsps... and it doesn't harm the velocity or XML/XSLT approach to have the tld files sitting there anyway.
 
reply
    Bookmark Topic Watch Topic
  • New Topic