maven/maven-model/maven.xml

44 lines
2.2 KiB
XML

<!--
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>
</project>