Skip to content

Commit

Permalink
directory, not folder
Browse files Browse the repository at this point in the history
Use property term for item type on a filesystem.
  • Loading branch information
michael-o committed Nov 26, 2023
1 parent 488624f commit b47b280
Show file tree
Hide file tree
Showing 13 changed files with 98 additions and 98 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -711,8 +711,8 @@ public abstract class AbstractJavadocMojo extends AbstractMojo {
* <p>
* Wildcards work as followed:
* <ul>
* <li>a wildcard at the beginning should match 1 or more folders</li>
* <li>any other wildcard must match exactly one folder</li>
* <li>a wildcard at the beginning should match one or more directories</li>
* <li>any other wildcard must match exactly one directory</li>
* </ul>
* </p>
* Example:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,8 @@ public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IO
// Usage of wildcard was bad specified and bad implemented, i.e. using String.contains()
// without respecting surrounding context
// Following implementation should match requirements as defined in the examples:
// - A wildcard at the beginning should match 1 or more folders
// - Any other wildcard must match exactly one folder
// - A wildcard at the beginning should match one or more directories
// - Any other wildcard must match exactly one directory
Pattern p = Pattern.compile(excludePackagename
.replace(".", regexFileSeparator)
.replaceFirst("^\\*", ".+")
Expand Down
12 changes: 6 additions & 6 deletions src/site/apt/examples/aggregate.apt.vm
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ Project

+-----+

Since 3.1.0 the <<<aggregate>>> has changed a little bit. It'll generate aggregated
Since 3.1.0 the <<<aggregate>>> has changed a little bit. It'll generate aggregated
reports at every level.
To get only an aggregated project at root level, you need to configure the pom like:

+-----+
<project>
...
Expand All @@ -64,7 +64,7 @@ Project
<reportSets>
<reportSet>
<id>aggregate</id>
<inherited>false</inherited>
<inherited>false</inherited>
<reports>
<report>aggregate</report>
</reports>
Expand Down Expand Up @@ -178,8 +178,8 @@ Project
Be aware that is not possible to have a mixture of named and unnamed modules. Ideally every Maven module has a Java module descriptor,
but this is not always possible, e.g. due to split packages of dependencies.
In such case you must have a jar containing a <<<META-INF/MANIFEST.MF>>> with an entry for the <<<Automatic-Module-Name>>>.
In other words: ensure to call <<<package javadoc:aggregate>>>, because the manifest file is only being read from jar, not from folder.
In other words: ensure to call <<<package javadoc:aggregate>>>, because the manifest file is only being read from jar, not from directory.

+-----+
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand All @@ -191,7 +191,7 @@ Project
</manifestEntries>
</archive>
</configuration>
</plugin>
</plugin>
+-----+

Occasionally, automatic modules need to import named modules. For example,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,13 +230,13 @@ public void testAggregateJavadocResources() throws Exception {
assertTrue(new File(apidocs, "resources/test/doc-files/maven-feather.png").exists());
}

public void testAggregateWithModulsNotInSubFolders() throws Exception {
File testPom = new File(unit, "aggregate-modules-not-in-subfolders-test/all/pom.xml");
public void testAggregateWithModulsNotInSubDirectories() throws Exception {
File testPom = new File(unit, "aggregate-modules-not-in-subdirectories-test/all/pom.xml");
JavadocReport mojo = lookupMojo(testPom);
mojo.execute();

File apidocs =
new File(getBasedir(), "target/test/unit/aggregate-modules-not-in-subfolders-test/target/site/apidocs");
File apidocs = new File(
getBasedir(), "target/test/unit/aggregate-modules-not-in-subdirectories-test/target/site/apidocs");
assertTrue(apidocs.isDirectory());
assertTrue(getOverviewSummary(apidocs).isFile());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
/**
* @author <a href="mailto:reto.weiss@axonivy.com">Reto Weiss</a>
*/
public class AggregateNotInSubFolderProject1TestMavenProjectStub extends AbstractAggregateChildMavenProjectStub {
public AggregateNotInSubFolderProject1TestMavenProjectStub() {
public class AggregateNotInSubDirectoryProject1TestMavenProjectStub extends AbstractAggregateChildMavenProjectStub {
public AggregateNotInSubDirectoryProject1TestMavenProjectStub() {
super(
"/src/test/resources/unit/aggregate-modules-not-in-subfolders-test/project1",
"/src/test/resources/unit/aggregate-modules-not-in-subdirectories-test/project1",
"pom.xml",
"/target/test/unit/aggregate-modules-not-in-subfolders-test/project1/target");
"/target/test/unit/aggregate-modules-not-in-subdirectories-test/project1/target");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
/**
* @author <a href="mailto:reto.weiss@axonivy.com">Reto Weiss</a>
*/
public class AggregateNotInSubFolderProject2TestMavenProjectStub extends AbstractAggregateChildMavenProjectStub {
public AggregateNotInSubFolderProject2TestMavenProjectStub() {
public class AggregateNotInSubDirectoryProject2TestMavenProjectStub extends AbstractAggregateChildMavenProjectStub {
public AggregateNotInSubDirectoryProject2TestMavenProjectStub() {
super(
"/src/test/resources/unit/aggregate-modules-not-in-subfolders-test/project2",
"/src/test/resources/unit/aggregate-modules-not-in-subdirectories-test/project2",
"pom.xml",
"/target/test/unit/aggregate-modules-not-in-subfolders-test/project2/target");
"/target/test/unit/aggregate-modules-not-in-subdirectories-test/project2/target");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@
/**
* @author <a href="mailto:reto.weiss@axonivy.com">Reto Weiss</a>
*/
public class AggregateNotInSubFolderTestMavenProjectStub extends AbstractAggregateMavenProjectStub {
public AggregateNotInSubFolderTestMavenProjectStub() {
public class AggregateNotInSubDirectoryTestMavenProjectStub extends AbstractAggregateMavenProjectStub {
public AggregateNotInSubDirectoryTestMavenProjectStub() {
super(
"/src/test/resources/unit/aggregate-modules-not-in-subfolders-test/all",
"/src/test/resources/unit/aggregate-modules-not-in-subdirectories-test/all",
"pom.xml",
"/target/test/unit/aggregate-modules-not-in-subfolders-test/target",
"/target/test/unit/aggregate-modules-not-in-subdirectories-test/target",
"../project1",
"../project2");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ under the License.
<modelVersion>4.0.0</modelVersion>

<groupId>org.apache.maven.plugins.maven-javadoc-plugin.unit</groupId>
<artifactId>aggregate-modules-not-in-subfolders-test-resources-test</artifactId>
<artifactId>aggregate-modules-not-in-subdirectories-test-resources-test</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>

Expand All @@ -36,20 +36,20 @@ under the License.
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<encoding>ISO-8859-1</encoding>
<project implementation="org.apache.maven.plugins.javadoc.stubs.AggregateNotInSubFolderTestMavenProjectStub"/>
<outputDirectory>${basedir}/target/test/unit/aggregate-modules-not-in-subfolders-test/target/site/apidocs</outputDirectory>
<javadocOptionsDir>${basedir}/target/test/unit/aggregate-modules-not-in-subfolders-test/target/javadoc-bundle-options</javadocOptionsDir>
<project implementation="org.apache.maven.plugins.javadoc.stubs.AggregateNotInSubDirectoryTestMavenProjectStub"/>
<outputDirectory>${basedir}/target/test/unit/aggregate-modules-not-in-subdirectories-test/target/site/apidocs</outputDirectory>
<javadocOptionsDir>${basedir}/target/test/unit/aggregate-modules-not-in-subdirectories-test/target/javadoc-bundle-options</javadocOptionsDir>
<windowtitle>Maven Javadoc Plugin aggregate resources 1.0-SNAPSHOT API</windowtitle>
<reactorProjects>
<project implementation="org.apache.maven.plugins.javadoc.stubs.AggregateNotInSubFolderTestMavenProjectStub"/>
<project implementation="org.apache.maven.plugins.javadoc.stubs.AggregateNotInSubFolderProject1TestMavenProjectStub"/>
<project implementation="org.apache.maven.plugins.javadoc.stubs.AggregateNotInSubFolderProject2TestMavenProjectStub"/>
<project implementation="org.apache.maven.plugins.javadoc.stubs.AggregateNotInSubDirectoryTestMavenProjectStub"/>
<project implementation="org.apache.maven.plugins.javadoc.stubs.AggregateNotInSubDirectoryProject1TestMavenProjectStub"/>
<project implementation="org.apache.maven.plugins.javadoc.stubs.AggregateNotInSubDirectoryProject2TestMavenProjectStub"/>
</reactorProjects>
<show>protected</show>
<groups/>
<tags/>
<quiet>true</quiet>
<javadocDirectory>${basedir}/src/test/resources/unit/aggregate-modules-not-in-subfolders-test/src/main/javadoc</javadocDirectory>
<javadocDirectory>${basedir}/src/test/resources/unit/aggregate-modules-not-in-subdirectories-test/src/main/javadoc</javadocDirectory>
<debug>true</debug>
<docfilessubdirs>true</docfilessubdirs>
<stylesheet>java</stylesheet>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
<!--
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>
<parent>
<groupId>org.apache.maven.plugins.maven-javadoc-plugin.unit</groupId>
<artifactId>aggregate-modules-not-in-subfolders-test-resources-test</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<groupId>org.apache.maven.plugins.maven-javadoc-plugin.unit</groupId>
<artifactId>aggregate-modules-not-in-subfolders-test-resources-test-project1</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
</project>
<!--
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>
<parent>
<groupId>org.apache.maven.plugins.maven-javadoc-plugin.unit</groupId>
<artifactId>aggregate-modules-not-in-subdirectories-test-resources-test</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<groupId>org.apache.maven.plugins.maven-javadoc-plugin.unit</groupId>
<artifactId>aggregate-modules-not-in-subdirectories-test-resources-test-project1</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
</project>
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
<!--
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>

<parent>
<groupId>org.apache.maven.plugins.maven-javadoc-plugin.unit</groupId>
<artifactId>aggregate-modules-not-in-subfolders-test-resources-test</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<groupId>org.apache.maven.plugins.maven-javadoc-plugin.unit</groupId>
<artifactId>aggregate-modules-not-in-subfolders-test-resources-test-project2</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
</project>
<!--
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>

<parent>
<groupId>org.apache.maven.plugins.maven-javadoc-plugin.unit</groupId>
<artifactId>aggregate-modules-not-in-subdirectories-test-resources-test</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<groupId>org.apache.maven.plugins.maven-javadoc-plugin.unit</groupId>
<artifactId>aggregate-modules-not-in-subdirectories-test-resources-test-project2</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ under the License.
<debug>true</debug>
<failOnError>true</failOnError>
<reactorProjects>
<project implementation="org.apache.maven.plugins.javadoc.stubs.AggregateNotInSubFolderTestMavenProjectStub"/>
<project implementation="org.apache.maven.plugins.javadoc.stubs.AggregateNotInSubDirectoryTestMavenProjectStub"/>
</reactorProjects>
<staleDataPath>${basedir}/target/test/unit/stale-test/target/maven-javadoc-plugin-stale-data.txt</staleDataPath>
</configuration>
Expand Down

0 comments on commit b47b280

Please sign in to comment.