On 4/6/06, Wendy Smoak <[EMAIL PROTECTED]> wrote:
>
> On 4/6/06, Martin Cooper <[EMAIL PROTECTED]> wrote:
>
> > > We tried a couple of things with <resources> such as:
> > >      <targetPath>../${pom.artifactId
> }/WEB-INF/src/main/java</targetPath>
> > > and
> > >      <targetPath>${basedir}/${pom.artifactId
> > > }/WEB-INF/src/main/java</targetPath>
> > > but each would work for one developer and not another.  Strange.
> >
> >
> > I'm probably misunderstanding, but why not just:
> >
> > <targetPath>${project.build.directory}/${pom.artifactId
> > }/WEB-INF/src/main/java</targetPath>
>
> Looks like I missed 'target' in the second path, it should have been
> ${basedir}/target/...
> And with that,
> <targetPath>${basedir}/target/${pom.artifactId
> }/WEB-INF/src/main/java</targetPath>
>
> I get this error:
> [INFO] Error copying resources
>
> Embedded error:
> c:\svn\struts\current\action\apps\cookbook\target\classes\c:\svn
>
> \struts\current\action\apps\cookbook\target\struts-cookbook\WEB-INF\src\main\jav
> a\examples\bean\ExampleBean.java (The filename, directory name, or volume
> label
> syntax is incorrect)
>
> (<finalName> is defined as ${pom.artifactId} for this build, so that
> the war files are named without version numbers.)
>
> I tried Martin's suggestion, but it just put the sources in
> (literally) WEB-INF/classes/${project.build.directory}/struts-cookbook/...
> Very strange that ${project.build.directory} wasn't evaluated, I
> think it works elsewhere.  But this suffers from the same problem that
> the path is relative to WEB-INF/classes.


Yep, I discovered the same things, including the weird ${
project.build.directory} not being expanded. That seems like it has to be a
bug.

So, since <resource>s are meant to be under target/classes, which ends
> up in WEB-INF/classes, trying to place things directly under WEB-INF
> with <resource> is causing problems.


Yes, I'm now of the belief that we can't treat this as a plain vanilla
resource thing. However, looking at the source for the war plugin, I see
that a <webResources> section is permitted, and it looks like this may do
what you want. Unfortunately, my attempt to add this to the POM made no
difference at all, so it may be that it hasn't made it into a release of the
plugin yet. (Or I'm just doing it wrong, which is entirely possible. ;)

--
Martin Cooper


All I need to do is copy some files from one place to another during
> the build... ISTR trying this once before though and not finding a
> Maven-approved solution.  Perhaps the antrun plugin would work?
>
> That or I've been staring at this too long and I'm missing something
> really simple.
>
> --
> Wendy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to