我有一个针对 3 个版本的依赖项构建的项目。最旧的版本有许多不兼容的更改,这促使我排除使用它们的唯一包:
<profiles>
<profile>
<id>spark-1.3.1</id>
<properties>
<spark.version>1.3.1</spark.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<excludes>
<exclude>**/tribbloids/spookystuff/pipeline/**</exclude>
</excludes>
<testExcludes>
<testExclude>**/tribbloids/spookystuff/pipeline/**</testExclude>
</testExcludes>
</configuration>
</plugin>
</plugins>
</build>
</profile>
但是,当我在使用 -Pspark-1.3.1 参数编译后执行任何 maven 命令时,我仍然会收到有关排除包中所有 scala 文件的错误信息:
[INFO] Compiling 54 Scala sources and 9 Java sources to /home/peng/git/spookystuff/core/target/scala/classes...
[ERROR] /home/peng/git/spookystuff/core/src/main/scala/com/tribbloids/spookystuff/pipeline/GoogleSearchTransformer.scala:28: not found: value setDefault
[ERROR] setDefault(Pages -> 0, PageCol -> null, IndexCol -> null)
[ERROR] ^
[ERROR] /home/peng/git/spookystuff/core/src/main/scala/com/tribbloids/spookystuff/pipeline/GoogleSearchTransformer.scala:37: not found: value getOrDefault
[ERROR] .wgetExplore(S"div#foot a:contains(Next)", maxDepth = getOrDefault(Pages), depthKey = $(PageCol), optimizer = Narrow)
[ERROR] ^
[ERROR] /home/peng/git/spookystuff/core/src/main/scala/com/tribbloids/spookystuff/pipeline/TransformerLike.scala:19: value defaultCopy is not a member of com.tribbloids.spookystuff.pipeline.TransformerLike
[ERROR] def copy(extra: ParamMap): TransformerLike = this.defaultCopy(extra)
[ERROR] ^
[ERROR] /home/peng/git/spookystuff/core/src/main/scala/com/tribbloids/spookystuff/pipeline/TransformerLike.scala:26: value defaultCopy is not a member of com.tribbloids.spookystuff.pipeline.SpookyTransformer
[ERROR] override def copy(extra: ParamMap): SpookyTransformer = this.defaultCopy(extra)
[ERROR] ^
[ERROR] /home/peng/git/spookystuff/core/src/main/scala/com/tribbloids/spookystuff/pipeline/TransformerLike.scala:31: not found: value getOrDefault
[ERROR] val colName = Option(getOrDefault(col))
这个问题的原因是什么,我该如何解决?