Author: jvanzyl Date: Tue Oct 4 15:09:57 2005 New Revision: 294931 URL: http://svn.apache.org/viewcvs?rev=294931&view=rev Log: o example for filtering resources against POM values o example for filtering resources against filter files
Modified: maven/components/trunk/maven-site/src/site/apt/guides/getting-started/index.apt Modified: maven/components/trunk/maven-site/src/site/apt/guides/getting-started/index.apt URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-site/src/site/apt/guides/getting-started/index.apt?rev=294931&r1=294930&r2=294931&view=diff ============================================================================== --- maven/components/trunk/maven-site/src/site/apt/guides/getting-started/index.apt (original) +++ maven/components/trunk/maven-site/src/site/apt/guides/getting-started/index.apt Tue Oct 4 15:09:57 2005 @@ -493,25 +493,106 @@ +----+ +* How do I filter resources against my POM? + ++----+ + +<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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <groupId>com.mycompany.app</groupId> + <artifactId>my-app</artifactId> + <packaging>jar</packaging> + <version>1.0-SNAPSHOT</version> + <name>Maven Quick Start Archetype</name> + <url>http://maven.apache.org</url> + <description>Killer App</description> + <dependencies> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>3.8.1</version> + <scope>test</scope> + </dependency> + </dependencies> + <build> + <resources> + <resource> + <directory>src/main/resources</directory> + <filtering>true</filtering> + </resource> + </resources> + </build> +</project> + ++----+ + ++----+ + +# application.properties + +application.name=${pom.name} +application.version=${pom.version} + ++----+ + * How do I filter resources against a properties file? -* How do I filter resources against my POM? ++----+ + +<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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <groupId>com.mycompany.app</groupId> + <artifactId>my-app</artifactId> + <packaging>jar</packaging> + <version>1.0-SNAPSHOT</version> + <name>Maven Quick Start Archetype</name> + <url>http://maven.apache.org</url> + <description>Killer App</description> + <dependencies> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>3.8.1</version> + <scope>test</scope> + </dependency> + </dependencies> + <build> + <filters> + <filter>src/main/filters/filters.properties</filter> + </filters> + <resources> + <resource> + <directory>src/main/resources</directory> + <filtering>true</filtering> + </resource> + </resources> + </build> +</project> + ++----+ +----+ -FYI - In beta-2, while the other technique is still supported, the -recommended way is finally settled: +# filtering.properties -chatting with emm in irc and src/main/filters seems like a good place for filter files. +environment=development -<build> - <filters> - <filtersFile>...</filtersFile> - </filters> -</build> ++----+ + ++----+ -~~* How do use resources with my tests? -~~ o EIDSL +# application.properties + +application.name=${pom.name} +application.version=${pom.version} + +environment=${environment} + ++----+ + ++----+ ~~* How do I use external dependencies? ~~ o Explain the use of repositories, remote and local --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]