Thank you. We tried that  approach and ultimately went with this one
<http://stackoverflow.com/questions/42205024/how-do-i-change-the-working-directory-while-running-jetty-with-maven>
.

"Use the ServletContext.getRealPath(String)
<http://docs.oracle.com/javaee/7/api/javax/servlet/ServletContext.html#getRealPath-java.lang.String->
 API.

File file = new File(servletContext.getRealPath("/fileToRead.txt"));


On Tue, Feb 14, 2017 at 2:38 PM, Bruggheman, Xavier (Consultant) <
[email protected]> wrote:

> You can do that by setting the « user.dir » system property in the plugin
> configuration :
>
>
>
> <plugin>
>
>      <groupId>org.eclipse.jetty</groupId>
>
>      <artifactId>*jetty*-*maven*-*plugin*</artifactId>
>
>      <configuration>
>
>          <systemProperties>
>
>               <force>true</force>
>
>               <!-- Move *jetty* base directory to a *subdirectory* of
> target -->
>
>               <systemProperty>
>
>                   <name>user.dir</name>
>
>                   <value>${project.build.directory}/jetty</value>
>
>               </systemProperty>
>
> …
>
>
>
> Hope it helps,
>
>
>
> Xavier BRUGGHEMAN
>
>
>
> *De :* [email protected] [mailto:jetty-users-bounces@
> eclipse.org] *De la part de* Joshua Fox
> *Envoyé :* mardi 14 février 2017 10:58
> *À :* [email protected]
> *Objet :* [jetty-users] Maven Jetty: setting working directory
>
>
>
> I need to set the working directory when using jetty:run
> <http://www.eclipse.org/jetty/documentation/9.3.0.v20150612/jetty-maven-plugin.html#jetty-run-goal>
>  in
> the Maven plugin.
>
>
>
> By default this is the same directory as the *pom.xml*.
>
>
>
> For Maven exec:exec, this would be  <workingDirectory>working</
> workingDirectory>
>
>
>
> How can I set the working directory with the Maven plugin?
>
>
>
>
>
> --
>
> *JOSHUA FOX*
>
> Principal Software Architect | Freightos
>
>
>
>
>
> ☏* (Israel): *+972-545691165 <+972%2054-569-1165> | ☏ *(US)*:  +
> 1-3123400953 <(312)%20340-0953>* | Skype*: joshuafox.freightos
>
> Smoother shipping with the world's online freight marketplace.
>
> Online Marketplace
> <https://www.google.com/url?q=https%3A%2F%2Fwww.freightos.com%2Fcompare-book-manage-freight-quotes%2F&sa=D&sntz=1&usg=AFrqEzfMkBQBWsovNlg47sIDORa5FpHDkQ>
>  / In the News
> <https://www.google.com/url?q=https%3A%2F%2Fwww.freightos.com%2Fabout-us%2Fin-the-news%2F&sa=D&sntz=1&usg=AFrqEzexnYSKKYuEW4zuC-QrR4X8G53w6Q>
>  / Freightos Blog
> <http://www.google.com/url?q=http%3A%2F%2Ffreightos.com%2Fresources%2Ffreightos-blog%2F&sa=D&sntz=1&usg=AFrqEzczY9ZxESxvh7ITnd_Al01Xyp4gdA>
>
>
>
>
>
>
>
> IPC ranks #33 in IDC's Top 100 FinTech
>
> DISCLAIMER: This e-mail may contain information that is confidential,
> privileged or otherwise protected from disclosure. If you are not an
> intended recipient of this e-mail, do not duplicate or redistribute it by
> any means. Please delete it and any attachments and notify the sender that
> you have received it in error. Unintended recipients are prohibited from
> taking action on the basis of information in this e-mail. E-mail messages
> may contain computer viruses or other defects, may not be accurately
> replicated on other systems, or may be intercepted, deleted or interfered
> with without the knowledge of the sender or the intended recipient. If you
> are not comfortable with the risks associated with e-mail messages, you may
> decide not to use e-mail to communicate with IPC. IPC reserves the right,
> to the extent and under circumstances permitted by applicable law, to
> retain, monitor and intercept e-mail messages to and from its systems.
>
> _______________________________________________
> jetty-users mailing list
> [email protected]
> To change your delivery options, retrieve your password, or unsubscribe
> from this list, visit
> https://dev.eclipse.org/mailman/listinfo/jetty-users
>



-- 
*JOSHUA FOX*
Principal Software Architect | Freightos


☏* (Israel): *+972-545691165 | ☏* (US)*:  +1-3123400953* | Skype*:
joshuafox.freightos
Smoother shipping with the world's online freight marketplace.
Online Marketplace
<https://www.google.com/url?q=https%3A%2F%2Fwww.freightos.com%2Fcompare-book-manage-freight-quotes%2F&sa=D&sntz=1&usg=AFrqEzfMkBQBWsovNlg47sIDORa5FpHDkQ>
 / In the News
<https://www.google.com/url?q=https%3A%2F%2Fwww.freightos.com%2Fabout-us%2Fin-the-news%2F&sa=D&sntz=1&usg=AFrqEzexnYSKKYuEW4zuC-QrR4X8G53w6Q>
 / Freightos Blog
<http://www.google.com/url?q=http%3A%2F%2Ffreightos.com%2Fresources%2Ffreightos-blog%2F&sa=D&sntz=1&usg=AFrqEzczY9ZxESxvh7ITnd_Al01Xyp4gdA>
_______________________________________________
jetty-users mailing list
[email protected]
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users

Reply via email to