You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Matt Raible <mr...@gmail.com> on 2006/02/09 08:05:45 UTC

[m2] including resources

I'm trying to include both files from src/main/resources, as well as
src/main/java/**/*.xml.  I've found that the following works:

  <build>
    <defaultGoal>package</defaultGoal>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
      </resource>
      <resource>
        <directory>src/main/java</directory>
        <includes>
          <include>**/*.xml</include>
        </includes>
      </resource>
    </resources>
  </build>

But this doesn't:

  <build>
    <defaultGoal>package</defaultGoal>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
      </resource>
      <resource>
        <directory>${project.build.sourceDirectory}</directory>
        <includes>
          <include>**/*.xml</include>
        </includes>
      </resource>
    </resources>
  </build>

It seems like it might be better to use variables instead of
hard-coded paths.  But then again the paths are more explict and seem
to work better.  Any advice on a best practice here?

Thanks,

Matt

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


Re: [m2] including resources

Posted by Matt Raible <mr...@gmail.com>.
Right, and that's what I'm doing for my Spring context files. 
However, I prefer to keep my Hibernate mapping files right next to the
classes they describe.

On 2/9/06, Carlos Sanchez <ca...@apache.org> wrote:
> The usual practice is putting xml files in resources folder, so you
> don't need the resources section
>
> On 2/8/06, Matt Raible <mr...@gmail.com> wrote:
> > I'm trying to include both files from src/main/resources, as well as
> > src/main/java/**/*.xml.  I've found that the following works:
> >
> >   <build>
> >     <defaultGoal>package</defaultGoal>
> >     <resources>
> >       <resource>
> >         <directory>src/main/resources</directory>
> >       </resource>
> >       <resource>
> >         <directory>src/main/java</directory>
> >         <includes>
> >           <include>**/*.xml</include>
> >         </includes>
> >       </resource>
> >     </resources>
> >   </build>
> >
> > But this doesn't:
> >
> >   <build>
> >     <defaultGoal>package</defaultGoal>
> >     <resources>
> >       <resource>
> >         <directory>src/main/resources</directory>
> >       </resource>
> >       <resource>
> >         <directory>${project.build.sourceDirectory}</directory>
> >         <includes>
> >           <include>**/*.xml</include>
> >         </includes>
> >       </resource>
> >     </resources>
> >   </build>
> >
> > It seems like it might be better to use variables instead of
> > hard-coded paths.  But then again the paths are more explict and seem
> > to work better.  Any advice on a best practice here?
> >
> > Thanks,
> >
> > Matt
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>

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


Re: [m2] including resources

Posted by Carlos Sanchez <ca...@apache.org>.
The usual practice is putting xml files in resources folder, so you
don't need the resources section

On 2/8/06, Matt Raible <mr...@gmail.com> wrote:
> I'm trying to include both files from src/main/resources, as well as
> src/main/java/**/*.xml.  I've found that the following works:
>
>   <build>
>     <defaultGoal>package</defaultGoal>
>     <resources>
>       <resource>
>         <directory>src/main/resources</directory>
>       </resource>
>       <resource>
>         <directory>src/main/java</directory>
>         <includes>
>           <include>**/*.xml</include>
>         </includes>
>       </resource>
>     </resources>
>   </build>
>
> But this doesn't:
>
>   <build>
>     <defaultGoal>package</defaultGoal>
>     <resources>
>       <resource>
>         <directory>src/main/resources</directory>
>       </resource>
>       <resource>
>         <directory>${project.build.sourceDirectory}</directory>
>         <includes>
>           <include>**/*.xml</include>
>         </includes>
>       </resource>
>     </resources>
>   </build>
>
> It seems like it might be better to use variables instead of
> hard-coded paths.  But then again the paths are more explict and seem
> to work better.  Any advice on a best practice here?
>
> Thanks,
>
> Matt
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

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