Re: [jetty-user] mvn:jetty ServletContext.getRealPath("") and ServletRequest.getRealPath("") return source folder instead of target folder?
Misha Koshelev <[email protected]>
| Newsgroups | gmane.comp.java.jetty.support |
|---|---|
| Message-ID | <1285601685.1761.3.camel@misha-d630> |
Hi Jan,
Thank you so much for your clear and thoughtful response. I hope it is
okay I have also started a stackoverflow question and posted your
response here:
http://stackoverflow.com/questions/3800960/maven-jetty-plug-in-mvnjetty-servletcontext-getrealpath-and-servletrequest-g
My understanding is that the mvn jetty:run-exploded task will add time
to the startup of the jetty plug in and of jetty, thus increasing time
that developers must spend when starting their OpenMRS server instance.
Is this correct?
If there is no other way, of course that is the best way to go.
Alternately, if there is a "more proper" way to dynamically generate
files on the fly inside the webapp, that would also work correctly in
maven jetty:run (i.e., inside the target folder), I would love to hear
about it. If not, I understand.
Thank you so much
Yours
Misha Koshelev
On Mon, 2010-09-27 at 18:48 +1000, Jan Bartel wrote:
> Hi Misha,
>
> The point of the mvn jetty:run goal is to operate on an
> unassembled webapp. Therefore, your static content is
> sourced from src/main/webapp (or wherever you have configured
> it to be). So if you ask for the "realPath" of something
> that is in src/main/webapp, that's the directory you'll
> get back.
>
> If your webapp does dynamic creation of files on the fly
> inside the webapp, then I suggest you use the mvn jetty:run-exploded
> goal instead, whereby all the components of your webapp are
> assembled into the /target directory.
>
> cheers
> Jan
>
>
>
>
> On 27/09/10 13:39, Misha Koshelev wrote:
> > Dear All:
> >
> > My apologies for bothering... this is related to
> > http://tickets.openmrs.org/browse/TRUNK-1760
> >
> > It can be easily tested with the following commands:
> > mvn archetype:generate -B -DarchetypeGroupId=org.appfuse.archetypes
> > -DarchetypeArtifactId=appfuse-light-struts-archetype
> > -DarchetypeVersion=2.1.0-M1 -DgroupId=com.mycompany
> > -DartifactId=myproject
> > cd myproject
> > patch -p0< diff
> > cd myproject
> > mvn clean install -DskipTests&& mvn jetty:run
> >
> > The diff file can be found here:
> > http://old.nabble.com/file/p29815681/diff
> >
> > Now, navigate to
> > http://localhost:8080/
> > in a browser and this will point to
> > !!! /home/misha/workspace/myproject/src/main/resources
> >
> > Should this not, instead, point to?
> > ./target/classes
> > or
> > ./target/myproject-2.1.0-M1/WEB-INF/classes
> >
> > Is it possible to modify this behavior?
> >
> > Thank you so much
> >
> > Yours
> > Misha Koshelev
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe from this list, please visit:
> >
> > http://xircles.codehaus.org/manage_email
> >
> >
> >
>
>
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email