<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>net.osgiliath.wrappers</groupId>
    <artifactId>net.osgiliath.wrappers</artifactId>
    <version>0.1.2</version>
  </parent>
  <artifactId>net.osgiliath.wrapper.xbean-spring</artifactId>
  <name>XBean spring wrapper</name>
  <description>Spring 4 wrapping for xbean-spring</description>
  	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-assembly-plugin</artifactId>
				<executions>
					<execution>
						<id>assembly:package</id>
						<phase>package</phase>
						<goals>
							<goal>single</goal>
						</goals>
						<configuration>
							<appendAssemblyId>false</appendAssemblyId>
							<descriptors>
								<descriptor>src/main/resources/assembly.xml</descriptor>
							</descriptors>
							<archive>
								<manifestFile>src/main/resources/META-INF/MANIFEST.MF</manifestFile>
							</archive>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
				<executions>
					<execution>
						<id>copy</id>
						<phase>generate-sources</phase>
						<goals>
							<goal>copy</goal>
						</goals>
						<configuration>
							<artifactItems>
								<artifactItem>
									<groupId>org.apache.xbean</groupId>
									<artifactId>xbean-spring</artifactId>
									<overWrite>true</overWrite>
									<outputDirectory>${project.build.directory}/dependencies</outputDirectory>
								</artifactItem>
							</artifactItems>
						</configuration>
					</execution>
					<execution>
						<id>get-manifest</id>
						<phase>process-sources</phase>
						<goals>
							<goal>unpack</goal>
						</goals>
						<configuration>
							<artifactItems>
								<artifactItem>
									<groupId>org.apache.xbean</groupId>
									<artifactId>xbean-spring</artifactId>
									<includes>META-INF/MANIFEST.MF</includes>
									<overWrite>true</overWrite><!-- TODO set to true -->
									<outputDirectory>${project.build.resources[0].directory}/</outputDirectory>
								</artifactItem>
							</artifactItems>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>exec-maven-plugin</artifactId>
				<executions>
					<execution>
						<phase>process-resources</phase>
						<goals>
							<goal>java</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<mainClass>net.osgiliath.helpers.manifest.transformer.ManifestBundleImportVersionUpdaterTransformer</mainClass>
					<arguments>
						<argument>overrides=org.springframework.beans=[4,${org.apache.servicemix.bundles.spring4.version}];org.springframework.beans.factory=[4,${org.apache.servicemix.bundles.spring4.version}];org.springframework.beans.factory.config=[4,${org.apache.servicemix.bundles.spring4.version}];org.springframework.beans.factory.parsing=[4,${org.apache.servicemix.bundles.spring4.version}];org.springframework.beans.factory.support=[4,${org.apache.servicemix.bundles.spring4.version}];org.springframework.beans.factory.xml=[4,${org.apache.servicemix.bundles.spring4.version}];org.springframework.context=[4,${org.apache.servicemix.bundles.spring4.version}];org.springframework.context.support=[4,${org.apache.servicemix.bundles.spring4.version}];org.springframework.core.io=[4,${org.apache.servicemix.bundles.spring4.version}];org.springframework.core.io.support=[4,${org.apache.servicemix.bundles.spring4.version}];org.springframework.util=[4,${org.apache.servicemix.bundles.spring4.version}];org.springframework.util.xml=[4,${org.apache.servicemix.bundles.spring4.version}];org.springframework.web.context.support=[4,${org.apache.servicemix.bundles.spring4.version}];org.springframework.core=[4,${org.apache.servicemix.bundles.spring4.version}];</argument>
						<argument>basedir=${project.basedir}</argument>
						<argument>bundleClasspath=xbean-spring-${org.apache.xbean_xbean-spring.version}</argument>
					</arguments>
					<executableDependency>
						<groupId>net.osgiliath.framework</groupId>
						<artifactId>net.osgiliath.helpers.manifest.transformer</artifactId>
					</executableDependency>
				</configuration>
			</plugin>
		</plugins>
	</build>
	<dependencies>
		<dependency>
			<groupId>org.apache.xbean</groupId>
			<artifactId>xbean-spring</artifactId>
		</dependency>
		<dependency>
			<groupId>net.osgiliath.framework</groupId>
			<artifactId>net.osgiliath.helpers.manifest.transformer</artifactId>
			<version>${project.version}</version>
		</dependency>
	</dependencies>
</project>