Put the properties inside a profile and activate the profile while preparing
and performing the release.  The forked maven lifecycle is not inheriting
the properties, but it should inherit the profile

-Stephen

P.S. not sure if this is a bug, a side-effect, or by design

2009/7/24 Thor <[email protected]>

> Hi, community
> I'm facing a really strange problem.
> When I run release:prepare on my multimodule project it crashes telling me
> that there are test failures.
> When i look into the surefire reports I find that my tests aren't capable
> of
> loading a resource file: ServiceResources.properties
> (java.io.FileNotFoundException)
>
> The thing is that I have several version of that file in my resource
> folder,
> like this:
> <system>-core
>  - src/main/resources/
>                          - dev/
>                             ServiceResources.properties
>                          - test/
>                             ServiceResources.properties
>                          - prod/
>                             ServiceResources.properties
>
> *In my pom:*
> <build>
> <resources>
>          <resource>
>              <directory>src/main/resources/${target}</directory>
>              <filtering>false</filtering>
>          </resource>
>          <resource>
>              <directory>src/main/resources/common</directory>
>              <filtering>false</filtering>
>          </resource>
>          <resource>
>              <directory>src/main/schema</directory>
>              <excludes>
>                  <exclude>**/*.sql</exclude>
>              </excludes>
>          </resource>
>      </resources>
> ...
> *So* I always run maven with the -Dtarget system property, like so: mvn
> -Dtarget=test release:prepare
> It looks like the release plugin is ignoring that property, 'cause when I
> run
> mvn -Dtarget=test test  or
> mvn -Dtarget=test package
> and so on, it works perfectly
>
> Any ideas?, what I'm doing wrong?
>
> Best regards,
>

Reply via email to