You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by rf...@apache.org on 2014/01/01 23:42:46 UTC

svn commit: r1554692 - in /maven/plugins/trunk/maven-invoker-plugin/src/it/local-repo-url: pom.xml src/it/project/postbuild.groovy verify.bsh verify.groovy

Author: rfscholte
Date: Wed Jan  1 22:42:46 2014
New Revision: 1554692

URL: http://svn.apache.org/r1554692
Log:
[MINVOKER-162] IT fails with empty local it-repo

Added:
    maven/plugins/trunk/maven-invoker-plugin/src/it/local-repo-url/src/it/project/postbuild.groovy
    maven/plugins/trunk/maven-invoker-plugin/src/it/local-repo-url/verify.groovy
Removed:
    maven/plugins/trunk/maven-invoker-plugin/src/it/local-repo-url/verify.bsh
Modified:
    maven/plugins/trunk/maven-invoker-plugin/src/it/local-repo-url/pom.xml

Modified: maven/plugins/trunk/maven-invoker-plugin/src/it/local-repo-url/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/it/local-repo-url/pom.xml?rev=1554692&r1=1554691&r2=1554692&view=diff
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/it/local-repo-url/pom.xml (original)
+++ maven/plugins/trunk/maven-invoker-plugin/src/it/local-repo-url/pom.xml Wed Jan  1 22:42:46 2014
@@ -49,12 +49,9 @@ under the License.
         <version>@pom.version@</version>
         <configuration>
           <localRepositoryPath>${project.build.directory}/it-repo</localRepositoryPath>
-          <pomIncludes>
-            <pomInclude>*/pom.xml</pomInclude>
-          </pomIncludes>
           <settingsFile>src/it/settings.xml</settingsFile>
           <goals>
-            <goal>org.apache.maven.plugins:maven-resources-plugin:2.2:resources</goal>
+            <goal>validate</goal>
           </goals>
         </configuration>
         <executions>

Added: maven/plugins/trunk/maven-invoker-plugin/src/it/local-repo-url/src/it/project/postbuild.groovy
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/it/local-repo-url/src/it/project/postbuild.groovy?rev=1554692&view=auto
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/it/local-repo-url/src/it/project/postbuild.groovy (added)
+++ maven/plugins/trunk/maven-invoker-plugin/src/it/local-repo-url/src/it/project/postbuild.groovy Wed Jan  1 22:42:46 2014
@@ -0,0 +1,42 @@
+/*
+ * 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.
+ */
+
+// ensure script context contains localRepositoryPath
+assert new File( basedir, "../../../target/it-repo" ).canonicalFile.equals( localRepositoryPath )
+
+File interpolatedSettings = new File( basedir, "../interpolated-settings.xml" )
+assert interpolatedSettings.isFile()
+
+def filename = new File( basedir, "../../../../../local-repo" ).canonicalPath
+// Convert URL, see org.apache.maven.plugin.invoker.AbstractInvokerMojo.toUrl(String)
+String url = "file://" + new File(  filename  ).toURI().path
+if ( url.endsWith( "/" ) )
+{
+    url = url.substring( 0, url.length() - 1 )
+}
+
+def settings = new XmlSlurper().parse( interpolatedSettings )
+
+// ensure right settings and mirror are picked up
+def sandboxMirror = settings.mirrors.mirror[0]
+assert sandboxMirror.id.text() == "sandbox"
+assert sandboxMirror.url.text() != "@localRepositoryUrl@"
+
+// sandboxMirror.url is NOT filled with localRepositoryPath, but with the localRepository of the parent Settings
+assert sandboxMirror.url.text() == url

Added: maven/plugins/trunk/maven-invoker-plugin/src/it/local-repo-url/verify.groovy
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/it/local-repo-url/verify.groovy?rev=1554692&view=auto
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/it/local-repo-url/verify.groovy (added)
+++ maven/plugins/trunk/maven-invoker-plugin/src/it/local-repo-url/verify.groovy Wed Jan  1 22:42:46 2014
@@ -0,0 +1,20 @@
+/*
+ * 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.
+ */
+File buildLog = new File( basedir, 'build.log' )
+assert buildLog.text.contains( '[INFO] run script postbuild.groovy' ) 
\ No newline at end of file