scala-maven-plugin excludes
Hello, every one.
I have a problem to add excludes to scala-maven-plugin. There are two scala files:Spark_1.6.1.scala and Spark_2.0.1.scala in src/main/scala/test. I want to exclude Spark_1.6.1.scala when compilation, so I write a pom.xml with the following setups. But it doesn't work.
May I do something incorrectly? How to add excludes correctly ?
在pom.xml文件中,引入scala-maven-plugin,将一部分文件排除编译工作:
scala-maven-plugin不支持完全模式匹配,仅支持/test/scala/和 /main/scala下的模式匹配。故而,在配置文件中需要配置成按包名路径的模式。
<excludes>
<exclude>**/com/excludes_package/**</exclude>
<exclude>**/com/excludes_package/excludes_package_1/**</exclude>
<exclude>**/com/excludes_package/excludes_package_2/**</exclude>
</excludes>
此外incremental模式下貌似不支持excludes,需要注释掉。Java的compiler中也需要加入exclude,否则在build中Java build阶段会报错。
<!-- mixed Java/Scala projects, see https://davidb.github.io/scala-maven-plugin/example_java.html -->
<plugin>
<!-- see http://davidb.github.com/scala-maven-plugin -->
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>3.2.2</version>
<executions>
<execution>
<id>eclipse-add-source</id>
<goals>
<goal>add-source</goal>
</goals>
</execution>
<execution>
<id>scala-compile-first</id>
<phase>process-resources</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>scala-test-compile-first</id>
<phase>process-test-resources</phase>
<goals>
<goal>testCompile</goal>
</goals>
</execution>
<execution>
<id>attach-scaladocs</id>
<phase>verify</phase>
<goals>
<goal>doc-jar</goal>
</goals>
</execution>
</executions>
<configuration>
<scalaVersion>${scala.version}</scalaVersion>
<!-- <recompileMode>incremental</recompileMode> <!-- here -->
<useZincServer>true</useZincServer> -->
<args>
<arg>-unchecked</arg>
<arg>-deprecation</arg>
<arg>-feature</arg>
<arg>-language:postfixOps</arg>
</args>
<jvmArgs>
<jvmArg>-Xms1024m</jvmArg>
<jvmArg>-Xmx1024m</jvmArg>
<jvmArg>-XX:ReservedCodeCacheSize=${CodeCacheSize}</jvmArg>
</jvmArgs>
<javacArgs>
<javacArg>-source</javacArg>
<javacArg>${java.version}</javacArg>
<javacArg>-target</javacArg>
<javacArg>${java.version}</javacArg>
<javacArg>-Xlint:all,-serial,-path</javacArg>
</javacArgs>
<excludes> <!-- here -->
<exclude>**/com/excludes_package/**</exclude>
<exclude>**/com/excludes_package/excludes_package_1/**</exclude>
<exclude>**/com/excludes_package/excludes_package_2/**</exclude>
</excludes>
</configuration>
</plugin>
<!-- This plugin compiles Java files -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<encoding>UTF-8</encoding>
<maxmem>1024m</maxmem>
<fork>true</fork>
<compilerArgs>
<arg>-Xlint:all,-serial,-path</arg>
</compilerArgs>
<excludes> <!-- here -->
<exclude>**/com/excludes_package/**</exclude>
<exclude>**/com/excludes_package/excludes_package_1/**</exclude>
<exclude>**/com/excludes_package/excludes_package_2/**</exclude>
</excludes>
</configuration>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
经验证:incremental模式下支持excludes,不需要注释掉。
<recompileMode>incremental</recompileMode>
scala-maven-plugin excludes的更多相关文章
- 学习Maven之Cobertura Maven Plugin
cobertura-maven-plugin是个什么鬼? cobertura-maven-plugin是一个校验单元测试用例覆盖率的工具,可以生成一个测试覆盖率报告,可以给单元测试用例编写提供参考. ...
- Spring Boot Maven Plugin(一):repackage目标
简介 Spring Boot Maven Plugin插件提供spring boot在maven中的支持.允许你打包可运行的jar包或war包. 插件提供了几个maven目标和Spring Boot ...
- Maven实现Web应用集成測试自己主动化 -- 部署自己主动化(WebTest Maven Plugin)
上篇:Maven实现Web应用集成測试自己主动化 -- 測试自己主动化(WebTest Maven Plugin) 之前介绍了怎样在maven中使用webtest插件实现web的集成測试,这里有个遗留 ...
- 解决Jetty Maven Plugin:Please initialize the log4j system properly(转)
解决Jetty Maven Plugin:Please initialize the log4j system properly.Jetty Maven Plugin环境: <plugin> ...
- Spring Boot Maven Plugin(二):run目标
简介 Spring Boot Maven Plugin插件提供spring boot在maven中的支持.允许你打包可运行的jar包或war包. 插件提供了几个maven目标和Spring Boot ...
- Spring Boot Maven Plugin打包异常及三种解决方法:Unable to find main class
[背景]spring-boot项目,打包成可执行jar,项目内有两个带有main方法的类并且都使用了@SpringBootApplication注解(或者另一种情形:你有两个main方法并且所在类都没 ...
- Error : Weblogic Maven Plugin deployment WebLogic 12c
Error : Weblogic Maven Plugin deployment i want to use weblogic-maven-plugin in my maven project in ...
- tomcat:run和tomcat7:run的区别,以及Apache Tomcat Maven Plugin 相关
起因: 同事部署的maven项目,之前使用 jetty,现在切换到 tomcat,但是他使用的命令是 tomcat:run ,而不是 tomcat7:run,能启动,但出现问题了. 于是搜索了一番,想 ...
- Versions maven plugin 修改版本
使用versions maven plugin插件,批量修改项目各模块的版本号,灵活推进或回退版本,避免主干每次更新代码,立即对所有分支产生影响. https://blog.csdn.net/sunz ...
- Spring Boot的Maven插件Spring Boot Maven plugin详解
Spring Boot的Maven插件(Spring Boot Maven plugin)能够以Maven的方式为应用提供Spring Boot的支持,即为Spring Boot应用提供了执行Mave ...
随机推荐
- ASP.NET Core使用Razor页面
ASP.NET Core使用Razor页面 Razor是ASP.NET的页面引擎,在ASP.NET MVC 3以后被广泛使用,我在之前的博客中有所介绍,需要更多了解的朋友请移步[Razor语法] 在A ...
- JavaAes加密操作工具类
package com.king.weixin.util;import java.io.UnsupportedEncodingException;import java.security.Algori ...
- boost::make_function_output_iterator报错: C4996
用VS2013运行boost::make_function_output_iterator的官方例子: https://www.boost.org/doc/libs/1_68_0/libs/itera ...
- 第六周周赛——AK机会不易得,好好把握题解(出自HDU5650,codeforces 616A,624A,659A,655A,658A)
A题: A题题目链接 题目描写叙述: 位运算 TimeLimit:1000MS MemoryLimit:65536KB 64-bit integer IO format:%I64d Problem ...
- grid - 使用相同的名称命名网格线和设置网格项目位置
1.使用repeat()函数可以给网格线分配相同的名称.这可以节省一定的时间 使用repeat()函数可以给网格线命名,这也导致多个网格线具有相同的网格线名称. 相同网格线名称指定网格线的位置和名称, ...
- 【C++】C++中的引用与指针
想必大家对C++中的指针都有所了解,但是什么是引用呢?C++11标准引入了“引用”的新功能. 引用 引用(reference):给对象起了另外一个名字,引用类型引用(refers to)另外一种类型, ...
- DMA(直接存储器存取)
DMA(Direct Memory Access) DMA(Direct Memory Access)即直接存储器存取,是一种快速传送数据的机制. 工作原理 DMA是指外部设备不通过CPU而直接与系统 ...
- 在Python中定义和使用抽象类的方法
https://www.jb51.net/article/87710.htm 像java一样python也可以定义一个抽象类. 在讲抽象类之前,先说下抽象方法的实现. 抽象方法是基类中定义的方法,但却 ...
- jYD框架使用
jQuery是一个非常好的框架,涉及的内容比较多,随着现在浏览器的发展,原生JS的功能越来越强大,jQuery包含内容很多,但是常用的功能无非涉及到Dom操作,事件,样式,表单和Ajax交互.引入那么 ...
- HTML5+CSS3 效果网站集合
1.jquery插件库 HTML5制作3D樱花漫天飞舞 http://www.jq22.com/jquery-info3547 2.17素材网 http://www.17sucai.com/pi ...