parse external pom.xml with CustomPomParser to handle multiple definitions.

Fixes #758.  This is the same issue fixed by 74c07c64a7
but in this case the cause was the top-level pom.xml, which didn't go through CustomPomParser.
This commit is contained in:
Mark Harrah 2013-09-16 11:57:02 -04:00
parent 6a293c4efe
commit 8ff424711c
5 changed files with 93 additions and 1 deletions

View File

@ -168,7 +168,7 @@ final class IvySbt(val configuration: IvyConfiguration)
/** Parses the Maven pom 'pomFile' from the given `PomConfiguration`.*/
private def configurePom(pc: PomConfiguration) =
{
val md = PomModuleDescriptorParser.getInstance.parseDescriptor(settings, toURL(pc.file), pc.validate)
val md = CustomPomParser.default.parseDescriptor(settings, toURL(pc.file), pc.validate)
val dmd = IvySbt.toDefaultModuleDescriptor(md)
IvySbt.addConfigurations(dmd, Configurations.defaultInternal)
val defaultConf = Configurations.DefaultMavenConfiguration.name

View File

@ -0,0 +1,3 @@
scalaVersion := "2.10.1"
externalPom()

View File

@ -0,0 +1,78 @@
<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>example</groupId>
<artifactId>example</artifactId>
<packaging>jar</packaging>
<version>1.0.0-SNAPSHOT</version>
<build>
<sourceDirectory>src/main/scala</sourceDirectory>
<testSourceDirectory>src/test/scala</testSourceDirectory>
<plugins>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<recompileMode>incremental</recompileMode>
<useZincServer>true</useZincServer>
<args>
<arg>-target:jvm-1.6</arg>
<arg>-feature</arg>
<arg>-deprecation</arg>
<arg>-encoding</arg>
<arg>UTF-8</arg>
</args>
<javacArgs>
<javacArg>-source</javacArg>
<javacArg>1.6</javacArg>
<javacArg>-Xlint:-options</javacArg>
<javacArg>-target</javacArg>
<javacArg>1.6</javacArg>
</javacArgs>
<jvmArgs>
<jvmArg>-Xmx768m</jvmArg>
<jvmArg>-Xss10m</jvmArg>
</jvmArgs>
<scalaVersion>${scala.version}</scalaVersion>
</configuration>
<executions>
<execution>
<id>scala-compile</id>
<goals>
<goal>compile</goal>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>2.10.1</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.5</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.5</version>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,8 @@
// Put in src/test/scala
object Foo {
// From main slf4j-api JAR
val logger = org.slf4j.LoggerFactory.getLogger("Foo")
// From test slf4j-api JAR
val bp = new org.slf4j.helpers.BogoPerf
}

View File

@ -0,0 +1,3 @@
> export compile:dependencyClasspath
> export test:dependencyClasspath
> test:compile