blob: 4d251e69860d2618850d9d770b2d7cafb57306ef [file] [log] [blame]
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you 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.
-->
<project xmlns:modello="modello" xmlns:ant="jelly:ant" xmlns:maven="jelly:maven" xmlns:j="jelly:core">
<goal name="customizeModello">
<j:if test="${not modelloGenerated}">
<!-- We need to have the generated code before to compile -->
<ant:copy tofile="${maven.modello.model}" file="${maven.modello.model.m2}"/>
<!-- We have to change the namespace before to generate the schema -->
<ant:replace file="${maven.modello.model}" token="http://maven.apache.org/POM/4.0.0" value="http://maven.apache.org/POM/3.0.0"/>
<attainGoal name="modello:modello"/>
<!-- Need the original package as well -->
<ant:copy tofile="${maven.modello.model}.2" file="${maven.modello.model}"/>
<ant:replace file="${maven.modello.model}.2" token="org.apache.maven.model" value="org.apache.maven.project"/>
<maven:set plugin="maven-modello-plugin" property="maven.modello.model" value="${maven.modello.model}.2"/>
<attainGoal name="modello:modello"/>
<j:set var="modelloGenerated" value="true" scope="parent"/>
</j:if>
</goal>
<!-- We need to have the generated code before to compile -->
<preGoal name="java:compile">
<attainGoal name="customizeModello"/>
</preGoal>
<!-- We need to have the generated code before to compute the javadoc and to register the modello report -->
<preGoal name="xdoc:register-reports">
<attainGoal name="customizeModello"/>
</preGoal>
<!-- Workaround for MODELLO-87 -->
<postGoal name="modello:xdoc">
<ant:replace file="${maven.modello.xdoc.targetDirectory}/${maven_modello_model_id}.xml" token="packageName" value="package"/>
</postGoal>
<postGoal name="modello:xsd">
<ant:replace file="${maven.modello.xsd.targetDirectory}/${maven_modello_model_id}-${maven.modello.version}.xsd" token="packageName" value="package"/>
</postGoal>
</project>