Author: hboutemy
Date: Sun Jan 17 16:25:54 2016
New Revision: 1725101
URL: http://svn.apache.org/viewvc?rev=1725101&view=rev
Log:
[MSITE-604] use settings data for pom interpolation
Submitted by: Jörg Schaible
Applied with little updates: works only with Maven 3 (through
DOXIASITETOOLS-145) and updated inheritance-interpolation IT
Added:
maven/plugins/trunk/maven-site-plugin/src/it/MSITE-604/parent/
maven/plugins/trunk/maven-site-plugin/src/it/MSITE-604/parent/pom.xml
(with props)
Modified:
maven/plugins/trunk/maven-site-plugin/src/it/MSITE-604/invoker.properties
maven/plugins/trunk/maven-site-plugin/src/it/MSITE-604/pom.xml
maven/plugins/trunk/maven-site-plugin/src/it/MSITE-604/verify.groovy
maven/plugins/trunk/maven-site-plugin/src/it/inheritance-interpolation/child/src/site/apt/pom.apt.vm
maven/plugins/trunk/maven-site-plugin/src/it/inheritance-interpolation/invoker.properties
maven/plugins/trunk/maven-site-plugin/src/it/inheritance-interpolation/repo-parent/pom.xml
maven/plugins/trunk/maven-site-plugin/src/it/settings.xml
Modified:
maven/plugins/trunk/maven-site-plugin/src/it/MSITE-604/invoker.properties
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/MSITE-604/invoker.properties?rev=1725101&r1=1725100&r2=1725101&view=diff
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/it/MSITE-604/invoker.properties
(original)
+++ maven/plugins/trunk/maven-site-plugin/src/it/MSITE-604/invoker.properties
Sun Jan 17 16:25:54 2016
@@ -15,5 +15,8 @@
# specific language governing permissions and limitations
# under the License.
+# only fixed with Maven 3
+invoker.maven.version = 3.0+
invoker.goals=clean site:site site:deploy
invoker.profiles = msite604
+
Added: maven/plugins/trunk/maven-site-plugin/src/it/MSITE-604/parent/pom.xml
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/MSITE-604/parent/pom.xml?rev=1725101&view=auto
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/it/MSITE-604/parent/pom.xml
(added)
+++ maven/plugins/trunk/maven-site-plugin/src/it/MSITE-604/parent/pom.xml Sun
Jan 17 16:25:54 2016
@@ -0,0 +1,44 @@
+<?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/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.apache.maven.plugins.site.its</groupId>
+ <artifactId>MSITE-604-parent</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
+
+ <name>Parent override settings IT</name>
+
+ <properties>
+ <msite604.siteRepositoryUrl>parent</msite604.siteRepositoryUrl>
+ </properties>
+
+ <distributionManagement>
+ <site>
+ <id>${msite604.siteRepositoryId}</id>
+
<url>${msite604.siteRepositoryRoot}/${msite604.siteRepositoryBase}/${msite604.siteRepositoryUrl}</url>
+ </site>
+ </distributionManagement>
+</project>
Propchange:
maven/plugins/trunk/maven-site-plugin/src/it/MSITE-604/parent/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/plugins/trunk/maven-site-plugin/src/it/MSITE-604/parent/pom.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange:
maven/plugins/trunk/maven-site-plugin/src/it/MSITE-604/parent/pom.xml
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: maven/plugins/trunk/maven-site-plugin/src/it/MSITE-604/pom.xml
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/MSITE-604/pom.xml?rev=1725101&r1=1725100&r2=1725101&view=diff
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/it/MSITE-604/pom.xml (original)
+++ maven/plugins/trunk/maven-site-plugin/src/it/MSITE-604/pom.xml Sun Jan 17
16:25:54 2016
@@ -24,6 +24,13 @@ under the License.
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.maven.plugins.site.its</groupId>
+ <artifactId>MSITE-604-parent</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <relativePath>parent</relativePath>
+ </parent>
+
<groupId>org.apache.maven.plugins.site.its</groupId>
<artifactId>MSITE-604</artifactId>
<version>1.0-SNAPSHOT</version>
@@ -34,13 +41,14 @@ under the License.
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<msite604.siteRepositoryId>defaultId</msite604.siteRepositoryId>
+ <msite604.siteRepositoryBase>defaultBase</msite604.siteRepositoryBase>
<msite604.siteRepositoryUrl>defaultRepositoryUrl</msite604.siteRepositoryUrl>
</properties>
<distributionManagement>
<site>
<id>${msite604.siteRepositoryId}</id>
-
<url>file://@project.build.directory@/it/MSITE-604/target/${msite604.siteRepositoryUrl}</url>
+
<url>${msite604.siteRepositoryRoot}/${msite604.siteRepositoryBase}/${msite604.siteRepositoryUrl}</url>
</site>
</distributionManagement>
Modified: maven/plugins/trunk/maven-site-plugin/src/it/MSITE-604/verify.groovy
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/MSITE-604/verify.groovy?rev=1725101&r1=1725100&r2=1725101&view=diff
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/it/MSITE-604/verify.groovy
(original)
+++ maven/plugins/trunk/maven-site-plugin/src/it/MSITE-604/verify.groovy Sun
Jan 17 16:25:54 2016
@@ -20,12 +20,20 @@
target = new File( basedir, 'target' );
assert target.isDirectory();
-// msite604.siteRepositoryUrl property value from settings.xml
-settingsDirectory = new File( target, 'settingsRepositoryUrl' );
-assert settingsDirectory.isDirectory();
+// msite604.siteRepositoryRoot property value from settings.xml
+rootDirectory = new File( target, 'root' );
+assert rootDirectory.isDirectory();
+
+// msite604.siteRepositoryBase property value from pom.xml
+baseDirectory = new File( rootDirectory, 'defaultBase' );
+assert !baseDirectory.isDirectory();
+
+// msite604.siteRepositoryBase property value from settings.xml
+baseDirectory = new File( rootDirectory, 'settingsBase' );
+assert baseDirectory.isDirectory();
// msite604.siteRepositoryUrl property value from pom.xml
-defaultDirectory = new File( target, 'defaultRepositoryUrl' );
-assert !defaultDirectory.exists();
+defaultDirectory = new File( baseDirectory, 'defaultRepositoryUrl' );
+assert defaultDirectory.exists();
-return true;
\ No newline at end of file
+return true;
Modified:
maven/plugins/trunk/maven-site-plugin/src/it/inheritance-interpolation/child/src/site/apt/pom.apt.vm
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/inheritance-interpolation/child/src/site/apt/pom.apt.vm?rev=1725101&r1=1725100&r2=1725101&view=diff
==============================================================================
---
maven/plugins/trunk/maven-site-plugin/src/it/inheritance-interpolation/child/src/site/apt/pom.apt.vm
(original)
+++
maven/plugins/trunk/maven-site-plugin/src/it/inheritance-interpolation/child/src/site/apt/pom.apt.vm
Sun Jan 17 16:25:54 2016
@@ -75,3 +75,17 @@ POM Inheritance and Interpolation
*-------+------+--------+
#set( $p = $p.parent )#end
#end
+
+* Property from Settings
+
+ Expected values from settings profile to override default values from
repo-parent
+
+#set( $p = $project )
+*-------*------*-------*
+|| level || artifactId || <<<project.distributionManagement.site.url>>> value
||
+*-------+------+--------+
+#foreach( $i in [1..4] )
+#if( $p )| $i| <<<$p.artifactId>>> |
<<<$p.distributionManagement.site.url>>>
+*-------+------+--------+
+#set( $p = $p.parent )#end
+#end
Modified:
maven/plugins/trunk/maven-site-plugin/src/it/inheritance-interpolation/invoker.properties
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/inheritance-interpolation/invoker.properties?rev=1725101&r1=1725100&r2=1725101&view=diff
==============================================================================
---
maven/plugins/trunk/maven-site-plugin/src/it/inheritance-interpolation/invoker.properties
(original)
+++
maven/plugins/trunk/maven-site-plugin/src/it/inheritance-interpolation/invoker.properties
Sun Jan 17 16:25:54 2016
@@ -17,5 +17,5 @@
invoker.goals.1 = -f repo-parent/pom.xml install
invoker.debug.1 = false
-invoker.goals.2 = clean site
+invoker.goals.2 = -Pmsite604 clean site
invoker.debug.2 = true
Modified:
maven/plugins/trunk/maven-site-plugin/src/it/inheritance-interpolation/repo-parent/pom.xml
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/inheritance-interpolation/repo-parent/pom.xml?rev=1725101&r1=1725100&r2=1725101&view=diff
==============================================================================
---
maven/plugins/trunk/maven-site-plugin/src/it/inheritance-interpolation/repo-parent/pom.xml
(original)
+++
maven/plugins/trunk/maven-site-plugin/src/it/inheritance-interpolation/repo-parent/pom.xml
Sun Jan 17 16:25:54 2016
@@ -38,8 +38,18 @@ under the License.
<properties>
<project.source.encoding>UTF-8</project.source.encoding>
<prop>project.artifactId = '${project.artifactId}'</prop>
+ <distUrl>scp://from.repo/dist</distUrl>
+ <msite604.siteRepositoryId>repo-parent-id</msite604.siteRepositoryId>
+
<msite604.siteRepositoryBase>default-repository-base-from-repo-parent</msite604.siteRepositoryBase>
</properties>
+ <distributionManagement>
+ <site>
+ <id>${msite604.siteRepositoryId}</id>
+ <url>${msite604.siteRepositoryRoot}/${msite604.siteRepositoryBase}</url>
+ </site>
+ </distributionManagement>
+
<build>
<plugins>
<plugin>
Modified: maven/plugins/trunk/maven-site-plugin/src/it/settings.xml
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/settings.xml?rev=1725101&r1=1725100&r2=1725101&view=diff
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/it/settings.xml (original)
+++ maven/plugins/trunk/maven-site-plugin/src/it/settings.xml Sun Jan 17
16:25:54 2016
@@ -64,7 +64,8 @@ under the License.
<id>msite604</id>
<properties>
<msite604.siteRepositoryId>settingsId</msite604.siteRepositoryId>
-
<msite604.siteRepositoryUrl>settingsRepositoryUrl</msite604.siteRepositoryUrl>
+
<msite604.siteRepositoryRoot>file://@project.build.directory@/it/MSITE-604/target/root</msite604.siteRepositoryRoot>
+ <msite604.siteRepositoryBase>settingsBase</msite604.siteRepositoryBase>
</properties>
</profile>
</profiles>