mvn网站只创建css,图像和Web-Inf文件夹

时间:2011-03-11 17:39:51

标签: java maven

当我运行mvn site:运行并转到localhost:8080我只看到3个文件夹:

  • CSS
  • 图像
  • Web-Inf

如何获取index.html文件?或者我应该在哪里创建index.html?

pm.xml

中的

site/

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

<properties>
 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-site-plugin</artifactId>
        <configuration>
          <port>9000</port>
          <tempWebappDirectory>
            ${basedir}/src/documentation/src/site
          </tempWebappDirectory>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>

1 个答案:

答案 0 :(得分:0)

以下项目结构可能适用于您:

<project>
   +- src/
      +- site/
          +- apt/
          |   +- apt-files 
          |   +- index.apt            <-- index file
          |    
          |- fml/                     <-- optional ... 
          |   +- fml-files
          |
          |- ....
          |   +- ...
          |
          |- resources/
          |   +- css/
          |   +- images/
          |    
          `- site.xml                 <-- this must be configuered appropriately

还配置以下内容以便能够部署:

  <distributionManagement>
     <site>
       <id>site</id>
       <url>http://host.coom/site</url>
     </site>
  </distributionManagement>