2015-11-24 88 views
1

嘗試使用maven 3生成mvn site失敗,我無法得到原因。在無法執行目標org.apache.maven.plugins:maven-site-plugin:

mvn3 -e clean site -Pmetrics 

結果::與呼叫該站點代

[ERROR]未能執行目標 org.apache.maven.plugins:行家現場-插件:3.3:位點(默認 - 網站) 項目mi-scenarios:目標執行默認站點 org.apache.maven.plugins:maven-site-plugin:3.3:站點失敗:不匹配 找到 - > [Help 1] org.apache。 maven.lifecycle.LifecycleExecutionException:未能到 執行目標org.apache.maven.plugins:maven-site-plugin:3.3 :項目上的站點 (默認站點)mi-scenarios:目標的執行默認站點 org.apache.maven.plugins:maven-site-plugin:3.3:站點失敗:不匹配 在 org.apache處找到。 maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:224) 在 org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) 在 org.apache.maven.lifecycle。 internal.MojoExecutor.execute(MojoExecutor.java:145) 在 org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116) 在 org.apache.maven.lifecycle.internal.LifecycleModuleBuilder。 buildProject(LifecycleModuleBuilder.java :80) 在 org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) 在 org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java :128) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:106)在 org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)在 org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)在 組織.apache.maven.cli.MavenCli.main(MavenCli.java:197)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native方法)在 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 在 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 在java.lang.reflect.Method.invoke(Method.java :497)在 org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) 在 org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) 在 org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) 在 org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) 所致:有機apache.maven.plugin.PluginExecuti onException:執行 目標默認站點 org.apache.maven.plugins:maven-site-plugin:3.3:站點失敗:不匹配 找到 org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java :145) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208) ... 20更多原因:java.lang.IllegalStateException:不匹配 在java.util中找到。 regex.Matcher.group(Matcher.java:536) com.puppycrawl.tools.checkstyle.checks。javadoc.JavadocMethodCheck.getMultilineNoArgTags(JavadocMethodCheck.java:669) 在 com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck.getMethodTags(JavadocMethodCheck.java:598) 在 com.puppycrawl.tools.checkstyle.checks。 javadoc.JavadocMethodCheck.checkComment(JavadocMethodCheck.java:478) 在 com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck.processAST(JavadocMethodCheck.java:365) 在 com.puppycrawl.tools.checkstyle.checks。 AbstractTypeAwareCheck.visitToken(AbstractTypeAwareCheck.java:147) at com.puppycrawl.tools.checkstyle.TreeWalker.notifyVisit(TreeWalker.java:388) at com.puppy crawl.tools.checkstyle.TreeWalker.processIter(TreeWalker.java:499) 在 com.puppycrawl.tools.checkstyle.TreeWalker.walk(TreeWalker.java:330) 在 com.puppycrawl.tools.checkstyle.TreeWalker。 processFiltered(TreeWalker.java:207) at com.puppycrawl.tools.checkstyle.api.AbstractFileSetCheck.process(AbstractFileSetCheck.java:79) at com.puppycrawl.tools.checkstyle.Checker.process(Checker.java:265 ) 在 org.apache.maven.plugin.checkstyle.exec.DefaultCheckstyleExecutor.executeCheckstyle(DefaultCheckstyleExecutor.java:252) 在 org.apache.maven.plugin.checkstyle.AbstractCheckstyleReport.executeReport(AbstractCheckstyleReport.java:473) 在 org.apache.maven.plugin.checkstyle.CheckstyleReport.executeReport(CheckstyleReport.java:154) 在 org.apache.maven.reporting.AbstractMavenReport.generate(AbstractMavenReport.java:255) 在 org.apache .maven.plugins.site.ReportDocumentRenderer.renderDocument(ReportDocumentRenderer.java:219) 在 org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.renderModule(DefaultSiteRenderer.java:319) 在 org.apache.maven.doxia .siterenderer.DefaultSiteRenderer.render(DefaultSiteRenderer.java:135) at org.apache.maven.plugins.site.SiteMojo.renderLocale(SiteMojo.java:175) at org.apache.maven.plugins.site.S iteMojo.execute(SiteMojo.java:138) 在 org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134) ...... 21多個

我的pom.xml:

<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/maven-v4_0_0.xsd"> 
    <modelVersion>4.0.0</modelVersion> 
    <groupId>edu.una.miscenarios</groupId> 
    <artifactId>mi-scenarios</artifactId> 
    <packaging>jar</packaging> 
    <version>1.0-SNAPSHOT</version> 
    <name>mi-scenarios</name> 
    <url>http://maven.apache.org</url> 
    <properties> 
     <additionalparam>-Xdoclint:none</additionalparam> 
    </properties> 
    <build> 
     <pluginManagement> 
      <plugins> 
       <plugin> 
        <groupId>org.apache.maven.plugins</groupId> 
        <artifactId>maven-compiler-plugin</artifactId> 
        <version>3.3</version> 
        <configuration> 
         <source>1.8</source> 
         <target>1.8</target> 
        </configuration> 
       </plugin> 
       <plugin> 
        <artifactId>maven-assembly-plugin</artifactId> 
        <configuration> 
         <archive> 
          <manifest> 
           <mainClass>edu.una.miscenarios.start.Start</mainClass> 
          </manifest> 
         </archive> 
         <descriptorRefs> 
          <descriptorRef>jar-with-dependencies</descriptorRef> 
         </descriptorRefs> 
        </configuration> 
       </plugin> 
      </plugins> 
     </pluginManagement> 
    </build> 
    <dependencies> 
     <dependency> 
      <groupId>junit</groupId> 
      <artifactId>junit</artifactId> 
      <version>4.12</version> 
      <scope>test</scope> 
     </dependency> 
     <dependency> 
      <groupId>org.javatuples</groupId> 
      <artifactId>javatuples</artifactId> 
      <version>1.2</version> 
     </dependency> 
     <dependency> 
      <groupId>org.slf4j</groupId> 
      <artifactId>slf4j-api</artifactId> 
      <version>1.7.12</version> 
     </dependency> 
     <dependency> 
      <groupId>org.slf4j</groupId> 
      <artifactId>slf4j-simple</artifactId> 
      <version>1.7.12</version> 
     </dependency> 
     <dependency> 
      <groupId>edu.gmu.cs</groupId> 
      <artifactId>mason</artifactId> 
      <version>19.0</version> 
     </dependency> 
     <dependency> 
      <groupId>edu.gmu.cs</groupId> 
      <artifactId>ecj</artifactId> 
      <version>23.0</version> 
     </dependency> 
     <dependency> 
      <groupId>infodynamics</groupId> 
      <artifactId>infodynamics</artifactId> 
      <version>1.3</version> 
     </dependency> 
     <dependency> 
      <groupId>edu.una.dependencylib</groupId> 
      <artifactId>dependencylib</artifactId> 
      <version>1.0-SNAPSHOT</version> 
     </dependency> 
     <dependency> 
      <groupId>com.google.guava</groupId> 
      <artifactId>guava</artifactId> 
      <version>18.0</version> 
     </dependency> 
     <dependency> 
      <groupId>commons-io</groupId> 
      <artifactId>commons-io</artifactId> 
      <version>2.4</version> 
     </dependency> 
    </dependencies> 
    <reporting> 
     <plugins> 
      <plugin> 
       <groupId>org.codehaus.mojo</groupId> 
       <artifactId>findbugs-maven-plugin</artifactId> 
       <version>3.0.2</version> 
       <configuration> 
        <xmlOutput>true</xmlOutput> 
        <effort>Max</effort> 
        <failOnError>false</failOnError> 
        <sourceEncoding>${file.encoding}</sourceEncoding> 
       </configuration> 
      </plugin> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-checkstyle-plugin</artifactId> 
       <version>2.17</version> 
       <reportSets> 
        <reportSet> 
         <reports> 
          <report>checkstyle</report> 
         </reports> 
        </reportSet> 
       </reportSets> 
      </plugin> 
     </plugins> 
    </reporting> 
    <profiles> 
     <profile> 
      <id>metrics</id> 
      <build> 
       <plugins> 
        <plugin> 
         <groupId>org.apache.maven.plugins</groupId> 
         <artifactId>maven-javadoc-plugin</artifactId> 
         <version>2.10.3</version> 
         <executions> 
          <execution> 
           <id>attach-javadocs</id> 
           <goals> 
            <goal>aggregate</goal> 
           </goals> 
           <configuration> 
            <additionalparam>-Xdoclint:none</additionalparam> 
           </configuration> 
          </execution> 
         </executions> 
        </plugin> 
        <plugin> 
         <groupId>org.codehaus.mojo</groupId> 
         <artifactId>findbugs-maven-plugin</artifactId> 
         <version>3.0.2</version> 
         <configuration> 
          <xmlOutput>true</xmlOutput> 
          <findbugsXmlWithMessages>true</findbugsXmlWithMessages> 
          <failOnError>false</failOnError> 
         </configuration> 
         <executions> 
          <execution> 
           <id>run-findbugs</id> 
           <phase>verify</phase> 
           <goals> 
            <goal>check</goal> 
           </goals> 
          </execution> 
         </executions> 
        </plugin> 
        <plugin> 
         <groupId>org.apache.maven.plugins</groupId> 
         <artifactId>maven-checkstyle-plugin</artifactId> 
         <version>2.17</version> 
         <executions> 
          <execution> 
           <goals> 
            <goal>check</goal> 
           </goals> 
           <phase>verify</phase> 
          </execution> 
         </executions> 
        </plugin> 
        <plugin> 
         <groupId>org.codehaus.mojo</groupId> 
         <artifactId>cobertura-maven-plugin</artifactId> 
         <version>2.7</version> 
         <configuration> 
          <formats> 
           <format>xml</format> 
           <format>html</format> 
          </formats> 
         </configuration> 
         <executions> 
          <execution> 
           <goals> 
            <goal>cobertura</goal> 
           </goals> 
           <phase>verify</phase> 
          </execution> 
         </executions> 
        </plugin> 
       </plugins> 
      </build> 
     </profile> 
    </profiles> 
</project> 

回答

1

該錯誤可能是由maven checkstyle插件引起的。從構建輸出中查看以下行:

java.lang.IllegalStateException: No match found at java.util.regex.Matcher.group(Matcher.java:536) at com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck.getMultilineNoArgTags(JavadocMethodCheck.java:669) 

這是真正的錯誤。如果錯誤與herehere中描述的相同,那麼遇到@return javadoc標籤時,該插件會出現一個錯誤,該標籤之後沒有任何文本。

解決方案:在@return標記之後添加文本修復該問題,這是由這樣一個很好的做法,有正確的javadoc充滿了正確的信息:)

快速測試:刪除的CheckStyle插件並再次運行它。如果它有效,那麼你隔離了這個問題,然後尋找沒有文本的@return標籤並修復它們。

+0

謝謝保存我的一天!但問題仍然存在於2.17 – reversiblean

相關問題