上下文:我想编译和测试多模块项目中的所有模块,但如果任何编译或测试失败,我希望整体构建失败.
默认配置要么在第一次失败时停止,要么在测试失败后跳过模块
运行:
mvn clean install
在第一个失败的模块停止.
如果你添加:
mvn clean install -fae //最后失败
然后运行所有模块,但如果测试失败,那么任何相关模块都会被skpped:
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] ------------------------------------------------------------------------
[INFO] Module A ............................................. SUCCESS [15.210s]
[INFO] Module B ............................................. SUCCESS [10.923s]
[INFO] Module C ............................................. FAILED [1.731s]
[INFO] Module D ............................................. SUCCESS [3.791s]
[INFO] Module E ............................................. SUCCESS [1.488s]
[INFO] Module F ............................................. SKIPPED (dependency build failed or was skipped)
[INFO] Module G ............................................. SKIPPED (dependency build failed or was …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用Grails的内置机制在部署的WAR文件之外加载外部配置文件(*.groovy和*.properties).文档暗示这只是设置的情况下grails.config.locations用适当的classpath:或file:路径.
我已将Config.groovy配置为:
String externalConfigLocation = System.getProperty("SYSTEM_PROPERTY_KEY")
if (!grails.config.locations || !(grails.config.locations instanceof List)) {
grails.config.locations = []
}
if (classpathExternalConfigLocation) {
String pathToResource = "\"file:${basedir}" + File.separator + externalConfigLocation+"\""
print "Loading external configuration file: ${pathToResource}\n"
grails.config.locations << pathToResource
}
Run Code Online (Sandbox Code Playgroud)
但是这没有用,错误消息指示文件"不存在".但是,打印存储的绝对路径grails.config.locations表示它确实存在.我尝试了一些组合:
classpath:configurationFile.propertiesfile:c:\path_to_file\configurationFile.propertiesc:\path_to_file\configurationFile.properties但在所有这些情况下都无法找到该文件.
很奇怪 - 建议赞赏.或者有关如何调试的建议.
我在尝试使eclipse和aspectj为Dynamic Web Projects工作时遇到了问题.我正在寻找编译时编织,所以我可以使用Eclipse Visualization功能.
我按照这里给出的步骤进行了操作:
https://forums.oracle.com/forums/thread.jspa?messageID=8591748
使用Eclipse Indigo(3.7)和最新的Aspectj eclipse插件(2.1.3).
步骤如下:
[1]创建基本servlet
//imports omitted
public class MyServlet extends HttpServlet{
public void doGet(HttpServletRequest request, HttpServletResponse response){
PrintWriter out= null;
try {
out = response.getWriter();
out.write("hello from MyServlet");
} catch (IOException e) {
e.printStackTrace();
} finally {
if(out!=null)
out.close();
}
}
}
Run Code Online (Sandbox Code Playgroud)
[2]将servlet添加到部署描述符(web.xml)
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<servlet>
<servlet-name>MyServlet</servlet-name>
<servlet-class>com.myCompany.MyServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>MyServlet</servlet-name>
<url-pattern>/MyServlet/*</url-pattern>
</servlet-mapping>
</web-app>
Run Code Online (Sandbox Code Playgroud)
[3]创造方面
Run Code Online (Sandbox Code Playgroud)package com.myCompany;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public aspect MyServletAspect {
pointcut …
eclipse tomcat aspectj web-applications compile-time-weaving