Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Maven Jetty: setting working directory

Thank you. We tried that  approach and ultimately went with this one.

"Use the ServletContext.getRealPath(String) API.

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

On Tue, Feb 14, 2017 at 2:38 PM, Bruggheman, Xavier (Consultant) <Xavier.Bruggheman@xxxxxxx> 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 : jetty-users-bounces@eclipse.org [mailto:jetty-users-bounces@eclipse.org] De la part de Joshua Fox
Envoyé : mardi 14 février 2017 10:58
À : jetty-users@xxxxxxxxxxx
Objet : [jetty-users] Maven Jetty: setting working directory

 

I need to set the working directory when using jetty:run 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 |  (US):  +1-3123400953 | Skypejoshuafox.freightos

Smoother shipping with the world's online freight marketplace.

 






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
jetty-users@xxxxxxxxxxx
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 | Skypejoshuafox.freightos
Smoother shipping with the world's online freight marketplace.


Back to the top