maven-plugins/aspectj/xdocs/integration.xml
jjensen 154db697b9 Correct URL.
git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@491170 13f79535-47bb-0310-9956-ffa450edef68
2006-12-30 05:06:55 +00:00

96 lines
2.8 KiB
XML

<?xml version="1.0"?>
<!--
/*
* Copyright 2001-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-->
<document>
<properties>
<title>Integration Tips</title>
<author email="jjensen@apache.org">Jeff Jensen</author>
</properties>
<body>
<section name="Using Cobertura">
<p>
The following are some tips on using
the AspectJ plugin with the Cobertura plugin.
Your mileage may vary. You may need to tweak them.
Please report any problems, improvements, alternatives,
and/or new ones to the user list.
</p>
<subsection name="Multiple Source Directories">
<p>
Add this to the maven.xml file.
</p>
<source><![CDATA[
<preGoal name="test:test">
<attainGoal name ="cobertura:on"/>
</preGoal>
<postGoal name="test:test">
<attainGoal name ="cobertura:off"/>
</postGoal>
<preGoal name="cobertura:report">
<attainGoal name="set-java-compile-src-set"/>
</preGoal>
<preGoal name="java:compile">
<attainGoal name="set-java-compile-src-set"/>
</preGoal>
<goal name="set-java-compile-src-set">
<ant:path id="src.dirs">
<ant:pathelement path="${basedir}/src/main"/>
<ant:pathelement path="${basedir}/src/gen"/>
</ant:path>
<maven:addPath id="maven.compile.src.set" refid="src.dirs"/>
<ant:property name="maven.src.dirs" refid="maven.compile.src.set"/>
<ant:echo>maven.compile.src.set=${maven.src.dirs}</ant:echo>
</goal>
]]></source>
<p>
For more information, review this
<a href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1387499&amp;group_id=61626&amp;atid=497853">
Cobertura bug report
</a>.
</p>
</subsection>
<subsection name="Out of Memory">
<p>
If you experience out of memory with one or more plugins and the AspectJ plugin,
perhaps the configuration causes recursive calls of the AspectJ plugin.
This preGoal ensures AspectJ is called only once.
Add it to the maven.xml file.
</p>
<source><![CDATA[
<preGoal name="java:compile">
<j:if test="${ran != true}">
Running aspectj compilation *once*:
<attainGoal name="aspectj"/>
</j:if>
<j:set var="ran" value="true" />
</preGoal>
]]></source>
</subsection>
</section>
</body>
</document>