Maven 如何跳过报告&;项目信息,不上传默认皮肤';s CSS&;图像?

Maven 如何跳过报告&;项目信息,不上传默认皮肤';s CSS&;图像?,maven,pom.xml,maven-site-plugin,Maven,Pom.xml,Maven Site Plugin,我想使用Maven在Sourceforge上上传我网站的内容,我不想生成和上传报告、项目信息、CSS和皮肤图像。我没有成功生成任何报告,但仍有两个不需要的目录包含CSS和皮肤图像: <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

我想使用Maven在Sourceforge上上传我网站的内容,我不想生成和上传报告、项目信息、CSS和皮肤图像。我没有成功生成任何报告,但仍有两个不需要的目录包含CSS和皮肤图像:

<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>mygroupid</groupId>
  <artifactId>myartifactid</artifactId>
  <version>0.0.1-SNAPSHOT</version>

  <name>myname</name>
  <description>mydescription</description>
  <url>http://www.somewhere.fr</url>
  <inceptionYear>2016</inceptionYear>

  <distributionManagement>
    <site>
      <id>myproject.sf.net</id>
      <url>scp://shell.sourceforge.net/home/project-web/myproject/htdocs/tmp/www_somewhere_fr</url>
    </site>
  </distributionManagement>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
  </properties>

  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-project-info-reports-plugin</artifactId>
        <version>2.9</version>
        <reportSets>
          <reportSet>
            <reports></reports>
          </reportSet>
        </reportSets>
      </plugin>
    </plugins>
  </reporting>

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-site-plugin</artifactId>
        <version>3.5.1</version>
        <dependencies>
          <dependency>
            <groupId>org.apache.maven.wagon</groupId>
            <artifactId>wagon-ssh</artifactId>
            <version>1.0</version>
          </dependency>
        </dependencies>
      </plugin>
    </plugins>
  </build>
</project>

4.0.0
mygroupid
但对我来说不起作用。将
generateReports
generateProjectInfo
设置为
false
没有帮助。如果maven site plugin不是合适的插件,请随意推荐一个更合适的插件来完成此任务

我怎样才能摆脱那些目录

实际上,您可以在使用站点生命周期的maven部署站点之前添加一些后期处理:

  • 现场前
    在实际项目现场生成之前执行所需的流程
  • 站点
    生成项目的站点文档
  • 站点发布
    执行完成站点生成和准备站点部署所需的流程
  • 站点部署
    将生成的站点文档部署到指定的web服务器
在这种情况下,
post-site
阶段听起来适合您的要求。因此,您可以将插件执行绑定到后期处理的
post-site
阶段,类似于下面的代码片段

<plugin>
    <artifactId>maven-clean-plugin</artifactId>
    <version>3.0.0</version>
    <executions>
      <execution>
        <id>auto-clean</id>
        <phase>post-site</phase>
        <goals>
          <goal>clean</goal>
        </goals>
        <configuration>
         <filesets>
            <fileset>
              <directory>${project.reporting.outputDirectory}/folderToDelete</directory>
            </fileset>
          </filesets>
        </configuration>
      </execution>
    </executions>
</plugin>

maven清洁插件
3.0.0
自动清洗
驿站
清洁的
${project.reporting.outputDirectory}/folderToDelete
我怎样才能摆脱那些目录

实际上,您可以在使用站点生命周期的maven部署站点之前添加一些后期处理:

  • 现场前
    在实际项目现场生成之前执行所需的流程
  • 站点
    生成项目的站点文档
  • 站点发布
    执行完成站点生成和准备站点部署所需的流程
  • 站点部署
    将生成的站点文档部署到指定的web服务器
在这种情况下,
post-site
阶段听起来适合您的要求。因此,您可以将插件执行绑定到后期处理的
post-site
阶段,类似于下面的代码片段

<plugin>
    <artifactId>maven-clean-plugin</artifactId>
    <version>3.0.0</version>
    <executions>
      <execution>
        <id>auto-clean</id>
        <phase>post-site</phase>
        <goals>
          <goal>clean</goal>
        </goals>
        <configuration>
         <filesets>
            <fileset>
              <directory>${project.reporting.outputDirectory}/folderToDelete</directory>
            </fileset>
          </filesets>
        </configuration>
      </execution>
    </executions>
</plugin>

maven清洁插件
3.0.0
自动清洗
驿站
清洁的
${project.reporting.outputDirectory}/folderToDelete

谢谢。我有点泄气。Maven对于我的项目来说不够灵活,我可能会使用Ant或Gradle来做,但我会尝试你的建议。谢谢。我有点泄气。Maven对于我的项目来说不够灵活,我可能会使用Ant或Gradle来做,但我会尝试你的建议。