kwin commented on code in PR #216:
URL: https://github.com/apache/maven-site-plugin/pull/216#discussion_r1877676339


##########
src/main/java/org/apache/maven/plugins/site/SiteResourcesAttachMojo.java:
##########
@@ -0,0 +1,154 @@
+/*
+ * 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.
+ */
+package org.apache.maven.plugins.site;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Set;
+
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugins.annotations.Component;
+import org.apache.maven.plugins.annotations.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.project.MavenProjectHelper;
+import org.codehaus.plexus.archiver.Archiver;
+import org.codehaus.plexus.archiver.ArchiverException;
+import org.codehaus.plexus.archiver.FileSet;
+import org.codehaus.plexus.archiver.util.DefaultFileSet;
+
+/**
+ * Adds the site resources (compressed in a ZIP archive) as dedicated artifact 
with classifier {@value #CLASSIFIER} to be installed/deployed.
+ * Usually used in combination with {@link 
org.apache.maven.plugins.site.descriptor.SiteDescriptorAttachMojo} to also 
deploy the actual site descriptor.
+ * This is used for sites inheriting from this project
+ *
+ * @since next
+ */
+@Mojo(name = SiteResourcesAttachMojo.GOAL_NAME, defaultPhase = 
LifecyclePhase.PACKAGE, threadSafe = true)
+public class SiteResourcesAttachMojo extends AbstractSiteMojo {
+
+    public static final String GOAL_NAME = "attach-site-resources";
+
+    /**
+     * Directory containing the <code>site.xml</code> file and the source for 
hand written docs (one directory
+     * per Doxia-source-supported markup types)
+     * @see <a href="/doxia/references/index.html">Doxia Markup Languages 
References</a>.
+     */
+    @Parameter(defaultValue = "${basedir}/src/site")
+    protected File siteDirectory;
+
+    /**
+     * Maven ProjectHelper.
+     */
+    @Component
+    private MavenProjectHelper projectHelper;
+
+    @Component(hint = ARCHIVE_EXTENSION)
+    private Archiver zipArchiver;
+
+    /**
+     * The file name patterns to exclude (potentially in addition to the 
default ones mentioned at {@link #addDefaultExcludes}).
+     * The format of each pattern is described in {@link 
org.codehaus.plexus.util.DirectoryScanner}.
+     * The comparison is performed against the file path relative to the 
{@link #siteDirectory}.
+     * <p>
+     * Each value is either a regex pattern if enclosed within {@code %regex[} 
and {@code ]}, otherwise an
+     * <a href="https://ant.apache.org/manual/dirtasks.html#patterns";>Ant 
pattern</a>.
+     * Exclusions take precedence over inclusions via {@link #includes}.
+     */
+    @Parameter(defaultValue = "**/.gitignore,**/.gitattributes", required = 
true)

Review Comment:
   Only true for `.gitignore` 
(https://github.com/codehaus-plexus/plexus-utils/blob/349b89ced5c863d0dc2c637d30d08b556265efec/src/main/java/org/codehaus/plexus/util/AbstractScanner.java#L109).
 Will fix it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to