我想从不同的目录编译源代码。
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<includes>
<include>src/main/java/**/*.java</include>
<include>generated-sources</include>
</includes>
<source>1.6</source>
</configuration>
</plugin>
每次我试图构建时,测试类都会出现错误:
[INFO] [compiler:testCompile {execution: default-testCompile}]
[ERROR] /home/user/project/src/test/java/com/company/model/hub/ToplogyFileUtilsTest.java:[8,45] error: package com.company.model.logic.hub does not exist
[ERROR] /home/user/project/src/test/java/com/company/model/entity/cfg/dto/OidDTOTest.java:[11,43] error: package com.company.model.dto.cfg does not exist
[ERROR] /home/user/project/src/test/java/com/company/model/fault/EventTest.java:[12,48] error: package com.company.model.entity.fault does not exist
...
src/main/java/*
?这对我来说没有意义。该消息表示您正在尝试引用不存在的类(com.company.model.entity.fault
)。此外,为什么要使用如此旧的Maven版本(2.2.X)... - khmarbaise