You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Johannes Schneider <ma...@cedarsoft.com> on 2008/09/17 19:32:52 UTC

Dependencies: for test + optional

Hi,

I have added the following to my pom.xml and it seems to work as
expected:

<dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.swinglabs</groupId>
        <artifactId>swingx</artifactId>
        <version>0.9.3</version>
      </dependency>

      <dependency>
        <groupId>com.jhlabs</groupId>
        <artifactId>filters</artifactId>
        <version>2.0.235</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <dependency>
      <groupId>org.swinglabs</groupId>
      <artifactId>swingx</artifactId>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>com.jhlabs</groupId>
      <artifactId>filters</artifactId>
      <optional>true</optional>
    </dependency>

    <!-- Test dependencies -->
    <dependency>
      <groupId>org.swinglabs</groupId>
      <artifactId>swingx</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.jhlabs</groupId>
      <artifactId>filters</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>


Those dependencies are necessary for the tests to run successfully. And
I want them to be optional for the main sources.
I have added them two times.

What do you think about this? Is this a mistake? What is the "maven way"
for this?


Thanks,

Johannes




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


Re: Dependencies: for test + optional

Posted by Johannes Schneider <ma...@cedarsoft.com>.
Ok thanks, will remove it.

> They shouldn't be added twice.
> 
> Simply using test scope should do what you want... it will be on the
> classpath for compiling and tests, and will not be be transitive.



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


Re: Dependencies: for test + optional

Posted by Wendy Smoak <ws...@gmail.com>.
On Wed, Sep 17, 2008 at 10:32 AM, Johannes Schneider
<ma...@cedarsoft.com> wrote:


> Those dependencies are necessary for the tests to run successfully. And
> I want them to be optional for the main sources.
> I have added them two times.
>
> What do you think about this? Is this a mistake? What is the "maven way"
> for this?

They shouldn't be added twice.

Simply using test scope should do what you want... it will be on the
classpath for compiling and tests, and will not be be transitive.

-- 
Wendy

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