Maven-to-JAM Automatic Synchronization Module

Public Targets

No public targets defined.

Source: maven-synch.xml

				<?xml version="1.0" encoding="UTF-8"?>
<project name="maven-synch">
	<description>
  + ==\_/============J=A=V=A=G=E=N===A=N=T===M=O=D=U=L=E=S================= +
  +  \(_)/                                                                  +
  +  -(_)-        Maven-to-JAM Automatic Synchronization Module             +
  +  /(_)\                                                                  +
  + ======================================================================= +
  +    Copyright (c) 2002-2005 Outsource Cafe, Inc.  All rights reserved.   +
  + ======================================================================= +
  +
  + Targets to keep JAM's properties in synch with Maven's POM file. Place 
  + these targets in depends clause of 'gen' or 'compile'.
  +
  + Most useful targets:
  +   jam.synch         - synchronize project.xml with classpath.xml and 
  +                       props-maven.xml.  Build fails if out-of-synch.
  + appxml-filter.synch - synchronize aplication.xml with project.xml.
  +
  + Import dependencies: maven.xml
  +   
  + Warning 1: This module only supports a module POM and an optional project 
  +   POM.  If you have 2 or more levels of POM inheritance, you will need to 
  +   modify this script to detect changes in the higher level POMs.
  +
  + Warning 2: The 'jam.generate.dir' property in this file must match the 
  +   JAM plugin 'maven.jam.generate.dir' property for this module to work. 
  +   Both properties default to: ${basedir}/src/jam
.
  +
  + developer: RichardEasterling@OutsourceCafe.com
  + ======================================================================= +
  + 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.
  + =J=A=M===========================================J=A=V=A=G=E=N=.=C=O=M= +
	</description>
	<!-- ===================================================================== -->
	<!-- local properties: -->
	<!-- ===================================================================== -->
	<property name="jam.generate.dir" location="${basedir}/src/jam"></property>
	<property name="classpath.file" location="${jam.generate.dir}/classpath.xml"></property>
	<property name="module.pom.file" location="${basedir}/project.xml"></property>
	<property name="project.pom.file" location="${project.home}/project.xml"></property>
	<!-- ===================================================================== -->
	<!-- sanity checks -->
	<!-- ===================================================================== -->
	<fail unless="project.home" message="project.home property must be defined before importing maven-synch.xml in build file."></fail>
	<fail unless="MAVEN.PRESENT" message="maven.xml must be imported before maven-synch.xml in build file."></fail>
	<condition property="classpath-uptodate">
		<and>
			<isset property="CLASSPATH.PRESENT"></isset>
			<uptodate srcfile="${module.pom.file}" targetfile="${classpath.file}"></uptodate>
			<uptodate srcfile="${project.pom.file}" targetfile="${classpath.file}"></uptodate>
		</and>
	</condition>
	<!-- =================================================================== -->
	<!-- call 'maven jam' (classpath.xml, props-maven.xml) if out-of-synch -->
	<!-- =================================================================== -->
	<target name="jam.synch" unless="classpath-uptodate">
		<maven.macro goal="jam"></maven.macro>
		<fail message="maven-synch.pom.synch updated classpath.xml and props-maven.xml because project.xml was changed.  Rerun your build."></fail>
	</target>
	<!-- =================================================================== -->
	<!-- call 'maven jam:appxml' if out-of-synch -->
	<!-- =================================================================== -->
	<target name="appxml.synch" depends="appxml.uptodate" unless="appxml-uptodate">
		<maven.macro goal="jam:appxml"></maven.macro>
	</target>
	<!-- =================================================================== -->
	<!-- call 'maven jam:appxml-filter' if out-of-synch -->
	<!-- =================================================================== -->
	<target name="appxml-filter.synch" depends="appxml.uptodate" unless="appxml-uptodate">
		<maven.macro goal="jam:appxml-filter"></maven.macro>
	</target>
	<!-- =================================================================== -->
	<!-- support for appxml* targets, set appxml-uptodate if uptodate -->
	<!-- =================================================================== -->
	<target name="appxml.uptodate">
		<condition property="appxml-uptodate">
			<and>
				<isset property="classpath-uptodate"></isset>
				<or>
					<available file="${src.metainf.dir}/application.xml"></available>
					<available file="${gen.metainf.dir}/application.xml"></available>
				</or>
			</and>
		</condition>
	</target>
	<!-- =================================================================== -->
	<!-- call 'maven jam:properties' if out-of-synch -->
	<!-- =================================================================== -->
	<target name="pom.props.synch" unless="classpath-uptodate">
		<maven.macro goal="jam:properties"></maven.macro>
		<fail message="maven-synch.pom.props.synch updated props-maven.xml because project.xml was changed.  Rerun your build."></fail>
	</target>
	<!-- =================================================================== -->
	<!-- call 'maven javagen:classpath' if out-of-synch -->
	<!-- =================================================================== -->
	<target name="cp.synch" unless="classpath-uptodate">
		<maven.macro goal="jam:classpath"></maven.macro>
		<fail message="maven-synch.cp.synch updated classpath.xml because project.xml was changed.  Rerun your build."></fail>
	</target>
</project>