1

I would like to use Maven to upload the content of my website on Sourceforge, I don't want to generate and upload the reports, the project info, the CSS and the images of the skin. I have succeeded in generating no report but there are still the two unwanted directories containing the CSS and the images of the skin:

<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>

Question: How can I get rid of those directories?

I tried the very last suggestion in this tutorial but it doesn't work in my case. Setting generateReports and generateProjectInfo to false didn't help. Feel free to suggest a more appropriate plugin to do this task if maven-site-plugin isn't the right one.

A_Di-Matteo
  • 26,902
  • 7
  • 94
  • 128
gouessej
  • 3,640
  • 3
  • 33
  • 67

1 Answers1

0

How can I get rid of those directories?

You could actually add some post-processing before deploying the site using the maven phases of the site lifecycle:

  • pre-site execute processes needed prior to the actual project site generation
  • site generate the project's site documentation
  • post-site execute processes needed to finalize the site generation, and to prepare for site deployment
  • site-deploy deploy the generated site documentation to the specified web server

In this case the post-site phase sounds suitable for your requirements. You could hence bind plugin executions to the post-site phase for your post-processing, deleting folders, similar to the snippet below

<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>
Community
  • 1
  • 1
A_Di-Matteo
  • 26,902
  • 7
  • 94
  • 128
  • Thank you. I'm a bit discouraged. Maven isn't flexible enough for my project, I'll probably use Ant or Gradle to do it but I'll try your suggestion. – gouessej Sep 21 '16 at 11:05