[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ toptown-webservice-vcrs ---
[INFO] No sources to compile

我就不信世界上没有其他人会遇到这个诡异的问题。。。没有要编译的资源。 Linux,Java, Maven build,

问题场景:在linux安装jenkins,jenkins完成的事情:从gitlab拉取代码到服务器上,然后maven构建项目报编译错误。

import的包找不到,但我试过,windows上装jenkins,同样的项目,是没有编译错误的。这时候,其实应该想到,可能是系统造成的,linux严格区分大小写,但是我却没有意识到。

后来对比了target文件夹,

出错的workspace少了generated-sources。再查看classes

出错的workspace的classes只有xsd文件夹,没有任何class文件,class文件好像是通过xsd生成的。

xjc pushRoomTypeInfo.xsd -d /home/jinwx/.jenkins/workspace/ToptownRelease/modules/toptown-webservice/vcrs/target/classes/

试了一下用xjc是可以生成class的,那为啥maven-compile-plugin就不行?

又仔细对比了compile log。

正确的:

[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ toptown-webservice-vcrs ---
[INFO] Compiling 18 source files to D:\Users\wx.jin\git\toptown\modules\toptown-webservice\vcrs\target\classes

错误的:

[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ toptown-webservice-vcrs ---
[INFO] No resource to compile

明明就有.java文件啊,为啥不行呢?maven插件怎么就感知不到呢?急死了!我求助了路神和新同事。

这时候这个问题已经困扰了我一个晚上+一个上午了~ 我好着急,感觉自己就是个笨蛋,这个问题都不能解决。我必须吹风扇缓和一下怒气

有点怀疑是插件版本问题:更新了maven-compiler-plugin:3.1,还是不行呢~

哎呀,重要的事情总是容易忘。。。就像我忘记我手机到底什么时候被偷了,

我已经锁定了问题,就在pom上,pom文件在根目录下,根目录下也有src,src下也有main,main下也有Java!!!!注意是Java,我用的linux,Java而不是java,会不会是这个原因呢?

于是我用search everything在windows上搜了java,我去!!!!感觉自己马上就要成功了~ 只有这个出错的项目是Java!!!!

后来我用仅存的linux命令储备,使用了mv Java java,然后mvn clean compile

我了个去!!!! [INFO] Compiling 18 source files !我好爱这个世界!感觉又可以苟活下去了!继续迷茫!有生之年,又跟java亲近了。。。

不知道是谁建的目录,打屁屁!!!

【Maven Jenkins】No resource to compile 还有多少坑要踩。。。LongTimeNoSee的更多相关文章

  1. Jmeter+maven+Jenkins构建云性能测试平台(mark 推荐)

    转自:http://www.cnblogs.com/victorcai0922/archive/2012/06/20/2555502.html Jmeter+maven+Jenkins构建云性能测试平 ...

  2. Win10系统Jmeter+maven+Jenkins接口自动化环境搭建(一)

    Jmeter+maven+Jenkins实现接口自动化,需要使用idea或eclipse配置maven项目,这里我使用的是idea.具体步骤如下: 1.安装jmeter+jdk jmeter安装之前需 ...

  3. Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project LogTest: Compilation failure -> [Help 1]

      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default ...

  4. maven install 报错Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project*****

    [ERROR]Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-co ...

  5. Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile 解决办法

    Maven install失败 Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (d ...

  6. Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) 解决方案

    1.命令行用maven编译项目失败,提示 Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compi ...

  7. 解决Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project autotest_fchtgl: Compilation failure的方法

    在碰到maven install 发现报错 Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.2:comp ...

  8. 基于Jmeter+maven+Jenkins构建性能自动化测试平台

      一.目的: 为能够将相关系统性能测试做为常规化测试任务执行,且可自动无人值守定时执行并输出性能测试结果报告及统计数据,因此基于Jmeter+maven+Jenkins构建了一套性能自动化测试平台 ...

  9. [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project triage: Compilation failure [ERROR] No compiler is provided in this environment.

    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-c ...

随机推荐

  1. JDK 5~8的特性对比

    原文请参考:https://bbs.csdn.net/topics/392062347 jdk5新特性 1.自动装箱和拆箱2.枚举3.静态导入4.可变参数5.內省   是Java语言对Bean类属性. ...

  2. 分布式session解决——Spring-data-redis

    1.如果没有集成shiro来管理session,可以直接使用spring-session 2.若集成了shiro,需要Spring-data-redis (或 shiro-redis) 3.nginx ...

  3. Python 中的单例模式

    单例模式 单例模式(Singleton Pattern)是一种常用的软件设计模式,该模式的主要目的是确保某一个类只有一个实例存在.当你希望在整个系统中,某个类只能出现一个实例时,单例对象就能派上用场. ...

  4. Java Web 浏览器关闭后Session就会被销毁吗?

    浏览器关闭后Session就会被销毁吗? Session是JSP的九大内置对象(也称为隐含对象)中的一个,用于保存当前用户的状态信息,初学者可能认为Session的生命周期是从打开一个浏览器发送请求到 ...

  5. MySQL性能分析及explain的使用(转)

    1.使用explain语句去查看分析结果,如 explain select * from test1 where id=1; 会出现: id selecttype table type possibl ...

  6. Linux搭建git服务端

    1.安装$ yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel perl-devel$ yum inst ...

  7. [Codeforces Round #508 (Div. 2)][Codeforces 1038E. Maximum Matching]

    前几天给舍友讲这题的时候感觉挺有意思的,就贴上来吧... 题目链接:1038E - Maximum Matching 题目大意:有\(n\)个棒子,每个条两端有颜色\(c1,c2\)以及他的价值\(v ...

  8. JMeter参数化中存在逗号的解决方法

    在Jmeter中通过CSV Data Set Config进行参数化时,如果参数化数据中存在逗号(,)我们可以通过一下方式进行设置 如何存在中文乱码,可以设置file encoding:gb2312

  9. Selenium 3----定位一组元素+多表单切换+多窗口切换

    定位一组元素 和定位单个元素类似,WebDriver提供了8种用于定位一组元素的方法.定位一组元素的方法与定位单个元素的方法类似,唯一的区别是在单词element后面多了一个s表示复数. find_e ...

  10. C# 类库中添加注释方法

    C# 类库中添加注释方法 C#中新建的类库添加注释时,应注意以下问题: 1.编译动态类库时命名空间要规范,一般不要和类同名,命名空间一般定义格式:项目名+类文件名: 2.动态类库中,类.方法的注释都采 ...