I have a Maven project in Netbeans 7.1 IDE.
I would like to add the same dependency to both Dependencies and Test Dependencies .
Adding to one removes it from another.
Duplication of dependency in pom.xml and inclusion in one of them:
<scope>test</scope>
.. doesn't work either.
Help!
More details:
Suppose I have MyProject and MyDependency .
MyProject contains MyDependency as the default scope (i.e., the compile scope):
<dependencies> <dependency> <groupId>my.group.id</groupId> <artifactId>AnArtifactId</artifactId> <version>1.0-SNAPSHOT</version> </dependency> </dependencies>
MyProject contains several classes in the Source Packages folder (i.e. MyProject/src/main/... ) that reference the MyDependency source classes. They work fine; Netbeans does not display red error flags, and these classes compile successfully.
MyProject contains several classes in the Test Packages folder (i.e. MyProject/src/test/... ) that reference the MyDependency test classes. Netbeans displays red error flags in MyProject for these links.
MyDependency been cleaned, built, and saved to the local Maven repository using mvn clean install -DskipTests . Running the same command for MyProject causes errors only in test classes; non-test classes compile fine.
source share