I use Annotations to instantiate my Spring context in my tests:
@ContextConfiguration(locations = {"classpath:*applicationContext-test.xml*"
})
public class UserWebServiceTest extends AbstractSpringTest {
Then when I do not have to modify my Maven config in order to switch from
test, to production version of my context.
---
Thank You…
Mick Knutson, President
BASE Logic, Inc.
Enterprise Architecture, Design, Mentoring & Agile Consulting
p. (866) BLiNC-411: (254-6241-1)
f. (415) 685-4233
Website: http://baselogic.com
Linked IN: http://linkedin.com/in/mickknutson
Vacation Rental: http://tahoe.baselogic.com
---
On Tue, Jun 23, 2009 at 4:06 PM, David Weintraub <[email protected]> wrote:
> This should help:
>
>
> http://maven.apache.org/plugins/maven-resources-plugin/examples/include-exclude.html
>
> And over here:
>
>
> http://maven.apache.org/plugins/maven-resources-plugin/copy-resources-mojo.html
>
> (Note the Examples links on the left side. They can provide you with
> specific pom.xml examples).
>
> I find that the reference at http://maven.apache.org/plugins/ is the
> best way to find information. I'm not too impress with any of the
> books I've seen. Most talk about how to setup a pom.xml for a specific
> type of application, but not about exactly how everything works, or
> where you can find more information.
>
> You can define command line properties to define exactly which
> directory you want:
>
> $ mvn -Dconfig-type=foo package
>
> <build>
> <resources>
> <resource>
> <directory>src/main/resources</directory>
> </resource>
> <resource>
> <directory>src/main/${config-type}-resources</directory>
> </resource>
> </resources>
> </build>
>
> If you use the above examples, you'll have to move those two
> directories to where you really want those the "mySpringBean.xml" file
> to be located when copied. For example, if they go into the META-INF
> directory, you'll need to have the two files in:
>
> src/main/foo-resources/META-INF/mySpringBean.xml
>
> and
>
> src/main/bar-resources/META-INF/mySpringBean.xml
>
>
>
> On Tue, Jun 23, 2009 at 3:00 PM, Robert Glover<[email protected]>
> wrote:
> >
> > I have read chapter 13 of "Maven: The Definitive Guide" and did not find
> my question answered there.
> >
> > Here is what I need to do. I have two subdirectories as follows:
> >
> > src/main/resources/foo
> > src/main/resources/bar
> >
> > I have the same file in each of those two directories:
> >
> > src/main/resources/foo/mySpringBean.xml
> > src/main/recourse/bar/mySpringBean.xml
> >
> > What I need to do is specify on the command line (or in a Profile or
> in settings.xml) which of those two directories should have it's contents
> copied to target/classes. The other directory should not have its contents
> copied into target/classes.
> >
> > Thank you in advance! (hope hope).
> >
> > Robert
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [email protected]
> > For additional commands, e-mail: [email protected]
> >
> >
>
>
>
> --
> David Weintraub
> [email protected]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>