문제

MVN 사이트를 사용하여 사이트의 문서를 생성합니다. 대부분의 경우 기본 사이트에 만족하지만 왼쪽 메뉴 표시 줄에서 "정보"링크를 제거하고 기본 페이지를 "프로젝트 정보"페이지로 표시하고 싶습니다. 이 작업을 수행하는 쉬운 방법이 있습니까?

도움이 되었습니까?

해결책 3

나는 그 플러그인을 전혀 사용하지 않고 Maven-site-plugin을 사용했습니다. Maven 3에는 Maven Pom의 Reporplugins 구성 섹션이 있습니다. http://maven.apache.org/plugins/maven-site-plugin/maven-3.html

org.apache.maven.plugins maven-site-plugin 3.0 org.codehaus.mojo cobertura-maven-plugin

또한 색인 페이지 텍스트를 사용자 정의하기 위해 내 자신의 index.apt (src/site/apt) 파일을 제공했습니다.

다른 팁

여기에는 '정보'보고서 만 여전히 포함되어 있습니다. 다른 모든 표준 보고서가 제거됩니다.

<reporting>
  <plugins>

    <!--  Add the Maven project information reports  -->
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-project-info-reports-plugin</artifactId>
      <version>2.1.2</version>
      <reportSets>
        <reportSet>
          <reports>
            <report>index</report>
            <!--
            <report>dependencies</report>
            <report>project-team</report>
            <report>mailing-list</report>
            <report>cim</report>
            <report>issue-tracking</report>
            <report>license</report>
            <report>scm</report>
             -->
          </reports>
        </reportSet>
      </reportSets>
    </plugin>
  </plugins>
</reporting>

소스를 수정하고 댓글을 달거나 CSS 선택기를 추가하거나 jQuery와 같은 JS 라이브러리를 포함시키고 다음과 같은 것을 통해 페이지가로드 될 때 제거 할 수 있습니다.

$(function () {
   // untested
   $('#navcolumn h5:contains("Maven")').hide(); // hide the header
   $('#navcolumn h5:contains("Maven") + ul ').hide(); // hide the ul
})();

나는 이것이 오래된 질문이라는 것을 알고 있지만, 나는 항상 그것이 꽤 성가신 것을 발견했습니다. '정보'섹션은 중복되어 있으며 더 중요한 것은 사이트를 방문 할 때 '프로젝트 정보'메뉴가 기본적으로 확장되기 때문입니다. 웹에서 해결책을 찾지 못했기 때문에 직접 알아 내야했습니다.

다음 해결 방법을 사용하면 '프로젝트 정보'메뉴의 '정보'항목이 사이트에서 완전히 사라집니다. 이것을 추가하십시오 site.xml 파일:

...
<body>
        <head>
            <![CDATA[
             <script type="text/javascript">
             $(document).ready(function () {
                var linkAbout = $('a').filter(function(index) { return $(this).text() === "About"; });
                var projectInformationMenu = $('a').filter(function(index) { return $(this).text() === "Project Information"; });
                linkAbout.hide();
                if (!projectInformationMenu.parent().hasClass('active')) {
                    projectInformationMenu.parent().children('ul').hide();
                    projectInformationMenu.children('span').removeClass('icon-chevron-down').addClass('icon-chevron-right');
                }
            });
            </script>
        ]]>
        </head>
...
</body>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top