t5: text file and tomcat deployment

View: New views
2 Messages — Rating Filter:   Alert me  

t5: text file and tomcat deployment

by Angelo Chen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I put a info.txt file under src/main/resources and when jetty:run I can see info.txt under target/classes, that's what I want. however when I deploy it in tomcat, the info.txt file is inside a jar file:
ROOT/WEB-INF/lib/myapp.jar, my purpose is, a text file that can be edited manually to configure some parameters, inside jar file make this impossible. any idea how to put a txt file outside of a jar and yet accessible by:this.getClass().getResourceAsStream("/info.txt")

Thanks,

Angelo

Parent Message unknown Re: t5: text file and tomcat deployment

by nille hammer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Angelo,
This is done in the pom.xml. The important tag is <archivingExcludes>
<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-war-plugin</artifactId>
  <configuration>
    <archivingExcludes>
      WEB-INF/classes/log4j.properties
   </archivingExcludes>
   <archiveClasses>true</archiveClasses>
  </configuration>
</plugin>

Regards, nillehammer

==
http://www.winfonet.eu

----- original Nachricht --------

Betreff: t5: text file and tomcat deployment
Gesendet: Mo, 29. Jun 2009
Von: Angelo Chen<angelochen960@...>

>
> Hi,
>
> I put a info.txt file under src/main/resources and when jetty:run I can see
> info.txt under target/classes, that's what I want. however when I deploy it
> in tomcat, the info.txt file is inside a jar file:
> ROOT/WEB-INF/lib/myapp.jar, my purpose is, a text file that can be edited
> manually to configure some parameters, inside jar file make this
> impossible.
> any idea how to put a txt file outside of a jar and yet accessible
> by:this.getClass().getResourceAsStream("/info.txt")
>
> Thanks,
>
> Angelo
> --
> View this message in context:
> http://www.nabble.com/t5%3A-text-file-and-tomcat-deployment-tp24255655p24255
> 655.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>
>

--- original Nachricht Ende ----


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...