maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ltheu...@apache.org
Subject svn commit: r628264 - in /maven/shared/trunk/maven-doxia-tools/src: main/java/org/apache/maven/doxia/tools/DefaultSiteTool.java test/java/org/apache/maven/doxia/tools/SiteToolTest.java
Date Sat, 16 Feb 2008 11:29:33 GMT
Author: ltheussl
Date: Sat Feb 16 03:29:33 2008
New Revision: 628264

URL: http://svn.apache.org/viewvc?rev=628264&view=rev
Log:
[MSITE-261] Local Parent POM not found if <relativePath> specifies a directory
Submitted by: Benjamin Bentmann

Modified:
    maven/shared/trunk/maven-doxia-tools/src/main/java/org/apache/maven/doxia/tools/DefaultSiteTool.java
    maven/shared/trunk/maven-doxia-tools/src/test/java/org/apache/maven/doxia/tools/SiteToolTest.java

Modified: maven/shared/trunk/maven-doxia-tools/src/main/java/org/apache/maven/doxia/tools/DefaultSiteTool.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-doxia-tools/src/main/java/org/apache/maven/doxia/tools/DefaultSiteTool.java?rev=628264&r1=628263&r2=628264&view=diff
==============================================================================
--- maven/shared/trunk/maven-doxia-tools/src/main/java/org/apache/maven/doxia/tools/DefaultSiteTool.java
(original)
+++ maven/shared/trunk/maven-doxia-tools/src/main/java/org/apache/maven/doxia/tools/DefaultSiteTool.java
Sat Feb 16 03:29:33 2008
@@ -716,8 +716,15 @@
             {
                 try
                 {
-                    MavenProject mavenProject = mavenProjectBuilder.build( new File( aProject.getBasedir(),
aProject
-                        .getModel().getParent().getRelativePath() ), localRepository, null
);
+                    File pomFile = new File( aProject.getBasedir(), aProject.getModel().getParent().getRelativePath()
);
+
+                    if ( pomFile.isDirectory() )
+                    {
+                        pomFile = new File( pomFile, "pom.xml" );
+                    }
+
+                    MavenProject mavenProject = mavenProjectBuilder.build( pomFile, localRepository,
null );
+
                     if ( mavenProject.getGroupId().equals( origParent.getGroupId() )
                         && mavenProject.getArtifactId().equals( origParent.getArtifactId()
)
                         && mavenProject.getVersion().equals( origParent.getVersion()
) )

Modified: maven/shared/trunk/maven-doxia-tools/src/test/java/org/apache/maven/doxia/tools/SiteToolTest.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-doxia-tools/src/test/java/org/apache/maven/doxia/tools/SiteToolTest.java?rev=628264&r1=628263&r2=628264&view=diff
==============================================================================
--- maven/shared/trunk/maven-doxia-tools/src/test/java/org/apache/maven/doxia/tools/SiteToolTest.java
(original)
+++ maven/shared/trunk/maven-doxia-tools/src/test/java/org/apache/maven/doxia/tools/SiteToolTest.java
Sat Feb 16 03:29:33 2008
@@ -127,11 +127,30 @@
         String to = "http://maven.apache.org";
         String from = "http://maven.apache.org";
         assertEquals( tool.getRelativePath( to, from ), "" );
+        to = "http://maven.apache.org/";
+        from = "http://maven.apache.org/plugins/maven-site-plugin";
+        assertEquals( tool.getRelativePath( to, from ), ".." + File.separator + ".." );
         to = "http://maven.apache.org";
         from = "http://maven.apache.org/plugins/maven-site-plugin/";
         assertEquals( tool.getRelativePath( to, from ), ".." + File.separator + ".." );
+        to = "http://maven.apache.org/";
+        from = "http://maven.apache.org/plugins/maven-site-plugin/";
+        assertEquals( tool.getRelativePath( to, from ), ".." + File.separator + ".." );
+        to = "http://maven.apache.org";
+        from = "http://maven.apache.org/plugins/maven-site-plugin";
+        assertEquals( tool.getRelativePath( to, from ), ".." + File.separator + ".." );
+
+        to = "http://maven.apache.org/plugins/maven-site-plugin/";
+        from = "http://maven.apache.org";
+        assertEquals( tool.getRelativePath( to, from ), "plugins" + File.separator + "maven-site-plugin"
);
         to = "http://maven.apache.org/plugins/maven-site-plugin/";
+        from = "http://maven.apache.org/";
+        assertEquals( tool.getRelativePath( to, from ), "plugins" + File.separator + "maven-site-plugin"
);
+        to = "http://maven.apache.org/plugins/maven-site-plugin";
         from = "http://maven.apache.org";
+        assertEquals( tool.getRelativePath( to, from ), "plugins" + File.separator + "maven-site-plugin"
);
+        to = "http://maven.apache.org/plugins/maven-site-plugin";
+        from = "http://maven.apache.org/";
         assertEquals( tool.getRelativePath( to, from ), "plugins" + File.separator + "maven-site-plugin"
);
     }
 



Mime
View raw message