| <?xml version="1.0"?> |
| <!-- |
| 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="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>org.apache.commons</groupId> |
| <artifactId>commons-weaver-antlib-parent</artifactId> |
| <version>1.0</version> |
| </parent> |
| |
| <artifactId>commons-weaver-antlib-test</artifactId> |
| <name>Apache Commons Weaver Antlib Test</name> |
| <description>Uses the privilizer example to test the antlib</description> |
| |
| <properties> |
| <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
| <privilizer.policy>DYNAMIC</privilizer.policy> |
| </properties> |
| |
| <scm> |
| <connection>scm:svn:http://svn.apache.org/repos/asf/commons/proper/weaver/tags/1.0_RC3/ant/test</connection> |
| <developerConnection>scm:svn:https://svn.apache.org/repos/asf/commons/proper/weaver/tags/1.0_RC3/ant/test</developerConnection> |
| <url>http://svn.apache.org/viewvc/commons/proper/weaver/tags/1.0_RC3/ant/test</url> |
| </scm> |
| |
| <dependencies> |
| <dependency> |
| <groupId>org.apache.commons</groupId> |
| <artifactId>commons-weaver-privilizer-api</artifactId> |
| <version>${project.version}</version> |
| <scope>provided</scope> |
| </dependency> |
| <dependency> |
| <groupId>junit</groupId> |
| <artifactId>junit</artifactId> |
| <scope>test</scope> |
| </dependency> |
| </dependencies> |
| <profiles> |
| <profile> |
| <id>antlib-test</id> |
| <activation> |
| <property> |
| <name>!antlib-test-skip</name> |
| </property> |
| </activation> |
| <build> |
| <plugins> |
| <plugin> |
| <groupId>org.apache.maven.plugins</groupId> |
| <artifactId>maven-dependency-plugin</artifactId> |
| <executions> |
| <execution> |
| <id>unpack-example-sources</id> |
| <phase>generate-sources</phase> |
| <goals> |
| <goal>unpack</goal> |
| </goals> |
| <configuration> |
| <artifactItems> |
| <artifactItems> |
| <groupId>org.apache.commons</groupId> |
| <artifactId>commons-weaver-example</artifactId> |
| <version>${project.version}</version> |
| <classifier>sources</classifier> |
| <includes>**/*.java</includes> |
| <outputDirectory>${project.build.directory}/example-sources</outputDirectory> |
| </artifactItems> |
| </artifactItems> |
| </configuration> |
| </execution> |
| <execution> |
| <id>copy-dependencies</id> |
| <phase>generate-sources</phase> |
| <goals> |
| <goal>copy-dependencies</goal> |
| </goals> |
| <configuration> |
| <outputDirectory>${project.build.directory}/compile-classpath</outputDirectory> |
| <includeArtifactIds>commons-weaver-antlib,commons-weaver-privilizer,commons-weaver-privilizer-api,commons-io,asm,asm-commons,asm-tree,asm-util</includeArtifactIds> |
| </configuration> |
| </execution> |
| <execution> |
| <id>unpack-example-test-sources</id> |
| <phase>generate-test-sources</phase> |
| <goals> |
| <goal>unpack</goal> |
| </goals> |
| <configuration> |
| <artifactItems> |
| <artifactItems> |
| <groupId>org.apache.commons</groupId> |
| <artifactId>commons-weaver-example</artifactId> |
| <version>${project.version}</version> |
| <classifier>test-sources</classifier> |
| <includes>**/*.java</includes> |
| <outputDirectory>${project.build.directory}/example-test-sources</outputDirectory> |
| </artifactItems> |
| </artifactItems> |
| </configuration> |
| </execution> |
| <execution> |
| <id>unpack-example-test-resources</id> |
| <phase>generate-test-resources</phase> |
| <goals> |
| <goal>unpack</goal> |
| </goals> |
| <configuration> |
| <artifactItems> |
| <artifactItems> |
| <groupId>org.apache.commons</groupId> |
| <artifactId>commons-weaver-example</artifactId> |
| <version>${project.version}</version> |
| <classifier>test-sources</classifier> |
| <includes>java.policy</includes> |
| <outputDirectory>${project.build.directory}/example-test-resources</outputDirectory> |
| </artifactItems> |
| </artifactItems> |
| </configuration> |
| </execution> |
| </executions> |
| </plugin> |
| <plugin> |
| <groupId>org.apache.maven.plugins</groupId> |
| <artifactId>maven-antrun-plugin</artifactId> |
| <executions> |
| <execution> |
| <id>clean</id> |
| <phase>process-sources</phase> |
| <goals> |
| <goal>run</goal> |
| </goals> |
| <configuration> |
| <target> |
| <sequential xmlns:cw="antlib:org.apache.commons.weaver.ant"> |
| <path id="cp"> |
| <fileset dir="${project.build.directory}/compile-classpath" erroronmissingdir="false" /> |
| </path> |
| <typedef uri="antlib:org.apache.commons.weaver.ant" resource="org/apache/commons/weaver/ant/antlib.xml" classpathref="cp" /> |
| |
| <cw:clean> |
| <cw:settings target="${project.build.outputDirectory}" classpathref="cp"> |
| <properties> |
| <privilizer.policy>${privilizer.policy}</privilizer.policy> |
| <privilizer.accessLevel>PACKAGE</privilizer.accessLevel> |
| </properties> |
| </cw:settings> |
| </cw:clean> |
| </sequential> |
| </target> |
| </configuration> |
| </execution> |
| <execution> |
| <id>weave</id> |
| <phase>process-classes</phase> |
| <goals> |
| <goal>run</goal> |
| </goals> |
| <configuration> |
| <target> |
| <sequential xmlns:cw="antlib:org.apache.commons.weaver.ant"> |
| <path id="cp"> |
| <fileset dir="${project.build.directory}/compile-classpath" /> |
| </path> |
| <typedef uri="antlib:org.apache.commons.weaver.ant" resource="org/apache/commons/weaver/ant/antlib.xml" classpathref="cp" /> |
| |
| <cw:weave> |
| <cw:settings target="${project.build.outputDirectory}" classpathref="cp"> |
| <properties> |
| <privilizer.policy>${privilizer.policy}</privilizer.policy> |
| <privilizer.accessLevel>PACKAGE</privilizer.accessLevel> |
| </properties> |
| </cw:settings> |
| </cw:weave> |
| </sequential> |
| </target> |
| </configuration> |
| </execution> |
| </executions> |
| <dependencies> |
| <dependency> |
| <groupId>org.apache.commons</groupId> |
| <artifactId>commons-weaver-antlib</artifactId> |
| <version>${project.version}</version> |
| </dependency> |
| <dependency> |
| <groupId>org.apache.commons</groupId> |
| <artifactId>commons-weaver-privilizer</artifactId> |
| <version>${project.version}</version> |
| </dependency> |
| <dependency> |
| <groupId>org.apache.ant</groupId> |
| <artifactId>ant</artifactId> |
| <version>${ant.version}</version> |
| </dependency> |
| </dependencies> |
| </plugin> |
| <plugin> |
| <groupId>org.codehaus.mojo</groupId> |
| <artifactId>build-helper-maven-plugin</artifactId> |
| <executions> |
| <execution> |
| <id>add-sources</id> |
| <phase>generate-sources</phase> |
| <goals> |
| <goal>add-source</goal> |
| </goals> |
| <configuration> |
| <sources> |
| <source>${project.build.directory}/example-sources</source> |
| </sources> |
| </configuration> |
| </execution> |
| <execution> |
| <id>add-test-sources</id> |
| <phase>generate-test-sources</phase> |
| <goals> |
| <goal>add-test-source</goal> |
| </goals> |
| <configuration> |
| <sources> |
| <source>${project.build.directory}/example-test-sources</source> |
| </sources> |
| </configuration> |
| </execution> |
| </executions> |
| </plugin> |
| </plugins> |
| </build> |
| </profile> |
| <profile> |
| <id>sec</id> |
| <build> |
| <plugins> |
| <plugin> |
| <groupId>org.apache.maven.plugins</groupId> |
| <artifactId>maven-antrun-plugin</artifactId> |
| <executions> |
| <execution> |
| <id>filter-testResources</id> |
| <phase>process-test-resources</phase> |
| <goals> |
| <goal>run</goal> |
| </goals> |
| <configuration> |
| <target> |
| <mkdir dir="${project.build.testOutputDirectory}" /> |
| <condition property="slash" value="/" else=""> |
| <os family="windows" /> |
| </condition> |
| <copy todir="${project.build.testOutputDirectory}" overwrite="true"> |
| <fileset dir="${project.build.directory}/example-test-resources" erroronmissingdir="false" /> |
| <filterchain> |
| <expandproperties /> |
| <!-- append extra slash on windows only --> |
| <replacestring from="file://" to="file://${slash}" /> |
| <replacestring from="${file.separator}" to="/" /> |
| <!-- preserve system-specific file separator --> |
| <replacestring from="$${preserve.project.build.directory}" to="${project.build.directory}" /> |
| </filterchain> |
| </copy> |
| </target> |
| </configuration> |
| </execution> |
| </executions> |
| <dependencies> |
| <dependency> |
| <groupId>org.apache.ant</groupId> |
| <artifactId>ant</artifactId> |
| <version>${ant.version}</version> |
| </dependency> |
| </dependencies> |
| </plugin> |
| <plugin> |
| <groupId>org.apache.maven.plugins</groupId> |
| <artifactId>maven-surefire-plugin</artifactId> |
| <configuration> |
| <argLine>-Djava.security.manager -Djava.security.policy=${project.build.testOutputDirectory}/java.policy</argLine> |
| </configuration> |
| </plugin> |
| </plugins> |
| </build> |
| </profile> |
| </profiles> |
| </project> |