OK, what you've told us is that this issue arises in the test phase in a build that is defined in a profile, yes? So it ought be straight forward to add a configuration for the surefire plugin to the profile in question. If you want to use the solution during the integration-test phase you could use the maven-failsafe-plugin.

This is from the surefire plugin pages:

<project>
  [...]
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.9</version>
        <configuration>
          <additionalClasspathElements>
            
<additionalClasspathElement>path/to/additional/resources</additionalClasspathElement>
            
<additionalClasspathElement>path/to/additional/jar</additionalClasspathElement>
          </additionalClasspathElements>
        </configuration>
      </plugin>
    </plugins>
  </build>
  [...]
</project>

http://maven.apache.org/plugins/maven-surefire-plugin/examples/configuring-classpath.html

I hope that this helps



On 8/31/11 11:36 AM, Benjamin Dreux wrote:
In fact my issue is that these property are in the environement when
the war is builded.
But we need this file also when the test are running.
But since the file is environement dependent, i don't want to have
this file staying in the repositry

So i decided to add a copy of this file in the test environement.
But i need to add this file to the classpath for the tests.

And for the moment i can't
Here is the issue.

Since i'm using some profile for each environment, i could add some
task to the profiles.

Any other idea ?

2011/8/31 Andy Glick<andygl...@gmail.com>:
Hi,

I'm sorry to say it, but I believe that you aren't thinking about this from
a "Maven" perspective. Your build is specified in your pom. There is "some
feature" of your build that requires a reference to some artifact outside
the scope of your module. The normal way to resolve this "not recommended
practice" is to modify the pom in some way to handle your "special case".
The build-helper-maven-plugin was written to allow people to solve this
class of problem. It would see particularly appropriate when you only want
to add the external artifact to the classpath for a single phase.

I'm not a Maven developer, but it seems like a stretch to imagine that there
is some way to hack the classpath once from the outside and get the results
that you desire. Maven "manipulates" the classpath across all of the
lifecycle phases. I can't tell you that what you are asking about won't
work, it might, but it just seems counter intuitive.

What is your concern about modifying the pom in question to resolve this
requirement?

On 8/31/11 10:58 AM, Benjamin Dreux wrote:
I'm sorry but i don't want to modify my pom
I just want to change the maven parameters, or a env variable

Is there a way you know to achieve this ??

2011/8/31 Brian Topping<topp...@codehaus.org>:
http://mojo.codehaus.org/build-helper-maven-plugin/add-source-mojo.html
added to the verify phase might be what you are looking for?

If not, there are a lot of other goals in that plugin that have similar
functionality, maybe one of them is better suited.

On Aug 31, 2011, at 10:34 AM, Benjamin Dreux wrote:

Hi
I want to add a folder to the classpath used during the maven build
(verify pase to be precise)
This folder must not be in the project (not inside src or any other
child)
How could i add  something to the classpath used my maven.

I've seen solution using the pom.xml, be since the folder is not in my
source file, i don't want it in my pom neigther.

I suspect it's possible using the command line, maybe something like
-Dclassapth
But i'm not sure

thanks for your help

--
Benjamin Dreux
Analyste-Programmeur
Chaire de logiciel libre-Finance Social et solidaire
UQAM
Montréal

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


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




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





Reply via email to