我们有一个Maven多模块项目,由父(HelloWorld)和不同的子(HelloWorldServices和HelloWorldPresentation)组成,并使用Jenkins构建.
运行成功测试后的错误是
[INFO] --- jacoco-maven-plugin:0.7.6.201602180812:report (default-cli) @ HelloWorldServices ---
[INFO] Skipping JaCoCo execution due to missing execution data file:/var/lib/jenkins/workspace/HelloWorld/HelloWorldServices/target/jacoco.exec
Run Code Online (Sandbox Code Playgroud)
它之前的线条说
[INFO] --- jacoco-maven-plugin:0.7.6.201602180812:prepare-agent (default-cli) @ HelloWorldServices ---
[INFO] argLine set to -javaagent:/var/lib/jenkins/.m2/repository/org/jacoco/org.jacoco.agent/0.7.6.201602180812/org.jacoco.agent-0.7.6.201602180812-runtime.jar=destfile=/var/lib/jenkins/workspace/HelloWorld/HelloWorldServices/target/jacoco.exec
Run Code Online (Sandbox Code Playgroud)
这是我定义父pom JaCoCo插件的方式:
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.6.201602180812</version>
<configuration>
<destfile>${project.artifactId}/target/jacoco.exec</destfile>
<datafile>${project.artifactId}/target/jacoco.exec</datafile>
</configuration>
<executions>
<execution>
<id>jacoco-initialize</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>jacoco-site</id>
<phase>package</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
Run Code Online (Sandbox Code Playgroud)
在没有pom的情况下,我明确提到了万无一失.我也尝试了你在任何地方找到的argLine配置,但都具有相同的结果.无论我做什么,JaCoCo .exec文件从未创建过.至于目标,我用
mvn clean install jacoco:prepare-agent jacoco:report
Run Code Online (Sandbox Code Playgroud)
因为当我省略jacoco目标时,它甚至不显示INFO消息.
我有一个主要的 HTML 页面,其中包括detail.xhtml和duo.xhtml。
现在duo.xhtml还包括detail.xhtml,这会导致重复的 ID,当然它不起作用。我能做些什么来解决这个问题?我不想管理冗余代码。
主要的:
<ui:composition ...>
<ui:define name="center">
<ui:insert name="insertDuo">
<ui:include src="/includes/duo.xhtml" />
</ui:insert>
...
<p:dialog header="x" widgetVar="detDialog" id="dlg" modal="true" appendTo="@(body)">
<ui:insert name="insertDetail">
<ui:include src="/includes/detail.xhtml" />
</ui:insert>
Run Code Online (Sandbox Code Playgroud)
二人组:
<ui:composition>
<p:dialog header="y" widgetVar="newDuoDialog" id="newDuoDlg" modal="true" >
<p:layout id="layout">
<p:layoutUnit position="west">
<ui:insert name="insertDetailStmt">
<h:form id="stmtDetailForm">
<ui:include src="/includes/detail.xhtml" />
</h:form>
</ui:insert>
</p:layoutUnit>
Run Code Online (Sandbox Code Playgroud)
细节:
<p:accordionPanel id="accordion">
Run Code Online (Sandbox Code Playgroud)
组件参考:
<p:commandButton value="z" update=":accordion:duoDlgForm2:pickList"/>
Run Code Online (Sandbox Code Playgroud) 我在某种程度上感到愚蠢地问这个问题,但是
为什么不能使用EnhancedForStatementList
手动更改对象的引用?
private static List<String> list = new ArrayList<String>();
public static void main(String[] args) {
list.add("AAA");
list.add("BBB");
list.add("CCC");
for(String s : list){
if(s.equals("BBB")) s = "QQQ";
}
System.out.println(list);
}
Run Code Online (Sandbox Code Playgroud)
将打印,[AAA, BBB, CCC]
因为对第二个元素的引用没有改变,正如人们所预料的那样.
但是为什么我不允许(或者是List
错误的类型?)手动更改列表条目的引用?此示例中的字符串可以是任何复杂类型,此问题与更改a中的引用有关List
.
编辑:好的,也许很清楚为什么它的工作方式有效,但我怎样才能完成参考变更?我无法相信任何子类型都List
无法改变任何元素的引用.
edit2:所以在使用EnhancedForStatement时无法更改引用?