Actually settings properties not being available in filtering might cause us
some problems in converting to M2.

Each of our developers has their own oracle schema that they can do unit
testing against (dbunit).  In M1 we put the connection strings into
build.properties.  We copy unit test property files from
src/test/resources/properties into target/test-resources/properties,
replacing in the user-specific connection strings.  As part of converting to
M2, I was planning on putting those connection strings into settings.xml.
It's going to be somewhat more complicated for me not being able to use
them.

On 2/28/07, Brad Szabo <[EMAIL PROTECTED]> wrote:

Ah. The Maven Resources Plugin only supports filtering using system
properties, project properties, and properties defined in filter
resources.

It does not appear that settings properties are available, which
actually makes sense now that I think about it. I do not think that this
is a bug. Settings properties are not included because they are user
specific. You would not want that information being filtered into the
project artifact.

Why exactly are you trying to generate a build.properties file for
inclusion in the project artifact?

-Brad


On Wed, 2007-02-28 at 17:13 +0100, Thomas Colin de Verdière wrote:
> It works.. it echoes the string.
> Here is the part for resources :
>     <resources>
>       <resource>
>         <directory>buildproperties</directory>
>         <filtering>true</filtering>
>       </resource>
>     </resources>
>
> And in the buildproperties directory here is the build.properties file
> to filter :
> MAVEN_REPO=${settings.mirrors}
> MAVEN_REPO=${project.class.name}
> MAVEN_REPO=${settings.localRepository}
> MAVEN_REPO=${localRepository.class.name}
> MAVEN_REPO2=${myrepository}
>
> and it really does generate the file into \target\classes as :
> MAVEN_REPO=${settings.mirrors}
> MAVEN_REPO=org.apache.maven.project.MavenProject
> MAVEN_REPO=${settings.localRepository}
> MAVEN_REPO=org.apache.maven.project.MavenProject
> MAVEN_REPO2=${settings.localRepository}
>
> Thanks Brad.
>
> Brad Szabo a écrit :
> > Can you elaborate a little on where you are trying to use
> > ${settings.localRepository}.
> >
> > If you add the following AntRun plugin to your pom.xml to echo the
> > expression value, does it not display the proper path to your local
> > repository?
> >
> >
> >           <plugin>
> >               <artifactId>maven-antrun-plugin</artifactId>
> >               <executions>
> >                   <execution>
> >                     <phase>validate</phase>
> >                     <configuration>
> >                       <tasks>
> >                           <echo message="settings.localRepository: ${
settings.localRepository}"/>
> >                       </tasks>
> >                     </configuration>
> >                     <goals>
> >                         <goal>run</goal>
> >                     </goals>
> >                   </execution>
> >               </executions>
> >           </plugin>
> >
> >
> > Run 'mvn validate' to check the output.
> >
> > -Brad
> >
> >
> > On Wed, 2007-02-28 at 16:25 +0100, Thomas Colin de Verdière wrote:
> >
> >> Yes i downloaded Maven 2.0.5
> >>
> >> Brad Szabo a écrit :
> >>
> >>> You are using Maven 2 right?
> >>>
> >>> On Wed, 2007-02-28 at 15:40 +0100, Thomas Colin de Verdière wrote:
> >>>
> >>>
> >>>> Thanks but i tried and it didn't work. You are right it is written
in
> >>>> the document on the maven site. ..
> >>>>
> >>>> Brad Szabo a écrit :
> >>>>
> >>>>
> >>>>> The localRepository property is configured in settings.xml,
therefore
> >>>>> you can access it using ${settings.localRepository}. (The default
is
> >>>>> ~/.m2/repository).
> >>>>>
> >>>>> Hope this helps,
> >>>>> -Brad
> >>>>>
> >>>>> References:
> >>>>> http://maven.apache.org/guides/mini/guide-configuring-maven.html
> >>>>> http://maven.apache.org/settings.html
> >>>>>
> >>>>>
> >>>>> On Wed, 2007-02-28 at 10:39 +0100, Thomas Colin de Verdière wrote:
> >>>>>
> >>>>>
> >>>>>
> >>>>>> Hello,
> >>>>>> i try to filter resources in my project to generate a
build.properties file.
> >>>>>> I would like to have the path to the localRepository. So i use
> >>>>>> ${localRepository} as it is said in "BetterBuilds with Maven" but
it
> >>>>>> doesn't work.
> >>>>>> I tried the following properties for testing :
> >>>>>> MAVEN_REPO=${project.class.name}
> >>>>>> MAVEN_REPO=${localRepository}
> >>>>>> MAVEN_REPO=${localRepository.class.name}
> >>>>>>
> >>>>>> and here is the result :
> >>>>>> MAVEN_REPO=org.apache.maven.project.MavenProject
> >>>>>> MAVEN_REPO=${localRepository}
> >>>>>> MAVEN_REPO=org.apache.maven.project.MavenProject
> >>>>>>
> >>>>>> So the localRepository seems to be a
> >>>>>> org.apache.maven.project.MavenProject  ??
> >>>>>>
> >>>>>> Thanks for helping,
> >>>>>> Thomas
> >>>>>>
> >>>>>>
> >>>>>>
---------------------------------------------------------------------
> >>>>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>>>>> For additional commands, e-mail: [EMAIL PROTECTED]
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>
---------------------------------------------------------------------
> >>>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>>>> For additional commands, e-mail: [EMAIL PROTECTED]
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>
---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>>> For additional commands, e-mail: [EMAIL PROTECTED]
> >>>>
> >>>>
> >>>>
> >>>
---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>> For additional commands, e-mail: [EMAIL PROTECTED]
> >>>
> >>>
> >>>
> >>>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to