Author: olamy
Date: Fri Oct 3 14:11:04 2008
New Revision: 701534
URL: http://svn.apache.org/viewvc?rev=701534&view=rev
Log:
add an it for [MRESOURCES-24]
Added:
maven/plugins/trunk/maven-resources-plugin/src/it/profile-override/
maven/plugins/trunk/maven-resources-plugin/src/it/profile-override/invoker.properties
(with props)
maven/plugins/trunk/maven-resources-plugin/src/it/profile-override/pom.xml
(with props)
maven/plugins/trunk/maven-resources-plugin/src/it/profile-override/prebuild.bsh
(with props)
maven/plugins/trunk/maven-resources-plugin/src/it/profile-override/src/
maven/plugins/trunk/maven-resources-plugin/src/it/profile-override/src/main/
maven/plugins/trunk/maven-resources-plugin/src/it/profile-override/src/main/resources/
maven/plugins/trunk/maven-resources-plugin/src/it/profile-override/src/main/resources/production/
maven/plugins/trunk/maven-resources-plugin/src/it/profile-override/src/main/resources/production/config.properties
(with props)
maven/plugins/trunk/maven-resources-plugin/src/it/profile-override/src/main/resources/test/
maven/plugins/trunk/maven-resources-plugin/src/it/profile-override/src/main/resources/test/config.properties
(with props)
maven/plugins/trunk/maven-resources-plugin/src/it/profile-override/verify.bsh
(with props)
Added:
maven/plugins/trunk/maven-resources-plugin/src/it/profile-override/invoker.properties
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-resources-plugin/src/it/profile-override/invoker.properties?rev=701534&view=auto
==============================================================================
---
maven/plugins/trunk/maven-resources-plugin/src/it/profile-override/invoker.properties
(added)
+++
maven/plugins/trunk/maven-resources-plugin/src/it/profile-override/invoker.properties
Fri Oct 3 14:11:04 2008
@@ -0,0 +1 @@
+invoker.profiles=production
Propchange:
maven/plugins/trunk/maven-resources-plugin/src/it/profile-override/invoker.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/plugins/trunk/maven-resources-plugin/src/it/profile-override/invoker.properties
------------------------------------------------------------------------------
svn:executable = *
Propchange:
maven/plugins/trunk/maven-resources-plugin/src/it/profile-override/invoker.properties
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added:
maven/plugins/trunk/maven-resources-plugin/src/it/profile-override/pom.xml
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-resources-plugin/src/it/profile-override/pom.xml?rev=701534&view=auto
==============================================================================
--- maven/plugins/trunk/maven-resources-plugin/src/it/profile-override/pom.xml
(added)
+++ maven/plugins/trunk/maven-resources-plugin/src/it/profile-override/pom.xml
Fri Oct 3 14:11:04 2008
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-resources-plugin-it-profile-override</artifactId>
+ <packaging>jar</packaging>
+ <version>1.0-SNAPSHOT</version>
+
+ <build>
+ <resources>
+ <resource>
+ <directory>src/main/resources/test</directory>
+ <filtering>false</filtering>
+ </resource>
+ </resources>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>@pom.version@</version>
+ <configuration>
+ <overwrite>true</overwrite>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+ <profiles>
+ <profile>
+ <id>production</id>
+ <build>
+ <resources>
+ <resource>
+ <directory>src/main/resources/production</directory>
+ <filtering>false</filtering>
+ </resource>
+ </resources>
+ </build>
+ </profile>
+ </profiles>
+</project>
Propchange:
maven/plugins/trunk/maven-resources-plugin/src/it/profile-override/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/plugins/trunk/maven-resources-plugin/src/it/profile-override/pom.xml
------------------------------------------------------------------------------
svn:executable = *
Propchange:
maven/plugins/trunk/maven-resources-plugin/src/it/profile-override/pom.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added:
maven/plugins/trunk/maven-resources-plugin/src/it/profile-override/prebuild.bsh
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-resources-plugin/src/it/profile-override/prebuild.bsh?rev=701534&view=auto
==============================================================================
---
maven/plugins/trunk/maven-resources-plugin/src/it/profile-override/prebuild.bsh
(added)
+++
maven/plugins/trunk/maven-resources-plugin/src/it/profile-override/prebuild.bsh
Fri Oct 3 14:11:04 2008
@@ -0,0 +1,27 @@
+
+/*
+ * 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.
+ */
+
+import java.io.*;
+
+import org.codehaus.plexus.util.*;
+
+File conf = new File( basedir, "src/main/resources/test/config.properties" );
+conf.setLastModified( System.currentTimeMillis() );
+
Propchange:
maven/plugins/trunk/maven-resources-plugin/src/it/profile-override/prebuild.bsh
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/plugins/trunk/maven-resources-plugin/src/it/profile-override/prebuild.bsh
------------------------------------------------------------------------------
svn:executable = *
Propchange:
maven/plugins/trunk/maven-resources-plugin/src/it/profile-override/prebuild.bsh
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added:
maven/plugins/trunk/maven-resources-plugin/src/it/profile-override/src/main/resources/production/config.properties
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-resources-plugin/src/it/profile-override/src/main/resources/production/config.properties?rev=701534&view=auto
==============================================================================
---
maven/plugins/trunk/maven-resources-plugin/src/it/profile-override/src/main/resources/production/config.properties
(added)
+++
maven/plugins/trunk/maven-resources-plugin/src/it/profile-override/src/main/resources/production/config.properties
Fri Oct 3 14:11:04 2008
@@ -0,0 +1 @@
+env=production
\ No newline at end of file
Propchange:
maven/plugins/trunk/maven-resources-plugin/src/it/profile-override/src/main/resources/production/config.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/plugins/trunk/maven-resources-plugin/src/it/profile-override/src/main/resources/production/config.properties
------------------------------------------------------------------------------
svn:executable = *
Propchange:
maven/plugins/trunk/maven-resources-plugin/src/it/profile-override/src/main/resources/production/config.properties
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added:
maven/plugins/trunk/maven-resources-plugin/src/it/profile-override/src/main/resources/test/config.properties
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-resources-plugin/src/it/profile-override/src/main/resources/test/config.properties?rev=701534&view=auto
==============================================================================
---
maven/plugins/trunk/maven-resources-plugin/src/it/profile-override/src/main/resources/test/config.properties
(added)
+++
maven/plugins/trunk/maven-resources-plugin/src/it/profile-override/src/main/resources/test/config.properties
Fri Oct 3 14:11:04 2008
@@ -0,0 +1 @@
+env=test
\ No newline at end of file
Propchange:
maven/plugins/trunk/maven-resources-plugin/src/it/profile-override/src/main/resources/test/config.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/plugins/trunk/maven-resources-plugin/src/it/profile-override/src/main/resources/test/config.properties
------------------------------------------------------------------------------
svn:executable = *
Propchange:
maven/plugins/trunk/maven-resources-plugin/src/it/profile-override/src/main/resources/test/config.properties
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added:
maven/plugins/trunk/maven-resources-plugin/src/it/profile-override/verify.bsh
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-resources-plugin/src/it/profile-override/verify.bsh?rev=701534&view=auto
==============================================================================
---
maven/plugins/trunk/maven-resources-plugin/src/it/profile-override/verify.bsh
(added)
+++
maven/plugins/trunk/maven-resources-plugin/src/it/profile-override/verify.bsh
Fri Oct 3 14:11:04 2008
@@ -0,0 +1,61 @@
+
+/*
+ * 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.
+ */
+
+import java.io.*;
+
+import org.codehaus.plexus.util.*;
+
+boolean result = true;
+
+try
+{
+ File target = new File( basedir, "target" );
+ if ( !target.exists() || !target.isDirectory() )
+ {
+ System.err.println( "target file is missing or a directory." );
+ return false;
+ }
+
+ File someResource = new File( target, "/classes/config.properties" );
+ if ( !someResource.exists() || someResource.isDirectory() )
+ {
+ System.err.println( "config.properties is missing or not a file." );
+ return false;
+ }
+
+ FileInputStream fis = new FileInputStream ( someResource );
+ String paramContent = IOUtil.toString ( fis );
+
+ int indexOf = paramContent.indexOf( "env=production" );
+ if ( indexOf < 0)
+ {
+ System.err.println( "config.properties not contains env=production" );
+ return false;
+ }
+
+
+}
+catch( IOException e )
+{
+ e.printStackTrace();
+ result = false;
+}
+
+return result;
Propchange:
maven/plugins/trunk/maven-resources-plugin/src/it/profile-override/verify.bsh
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/plugins/trunk/maven-resources-plugin/src/it/profile-override/verify.bsh
------------------------------------------------------------------------------
svn:executable = *
Propchange:
maven/plugins/trunk/maven-resources-plugin/src/it/profile-override/verify.bsh
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision