2016-12-07 13 views
0

Gosu言語用SonarQube 6.1のカスタムプラグインを追加しました。 ビルドはANTビルドツールを使用して行います。 しかし、例外を取得カスタムプラグインを追加した後でSonarQubeを起動できません

2016年12月7日午後07時42分36秒ERRORウェブ[] [oaccCの[。[。[/]]例外クラス
org.sonar.serverのインスタンスをリスナーにコンテキスト初期化イベントを送信します.platform.web.PlatformServletContextListener とjava.lang.ClassCastException: org.sonarsource.plugins.gscan.GosuPluginはorg.sonar.api.Plugin

にキャストすることはできません

ビルドファイルは

<?xml version="1.0"?> 
<project name="Gscan" default="buildJar"> 
    <property file="build.properties"/> 
    <property name="gscan.dir" value="${gscan.source}"/> 
    <property name="jar.name" value="sonar-gosu-plugin"/> 
    <property name="lib.dir" value="${lib}"/> 

    <path id="project.classpath"> 
    <fileset dir="${lib.dir}"> 
     <include name="**/*.jar" /> 
    </fileset> 
    <pathelement path="${build.dir}"/> 
    </path> 

    <target name="clean"> 
     <delete dir="${build.dir}"/>    
     <delete dir="src" /> 
     <delete dir="${target.folder}\SonarPlugin" /> 
     <mkdir dir="${build.dir}"/> 
     <mkdir dir="src"/> 
     <mkdir dir="${target.folder}\SonarPlugin"/> 
    </target> 

    <target name="compile" depends="clean" description="compile the source"> 
    <javac classpathref="project.classpath" srcdir="${gscan.source}" destdir="${build.dir}" includeantruntime="false" debug="on"> 
    </javac> 
    <copy file="${rules.from}/gscan-rules.xml" todir="${rules.to}"/> 
    <copy file="${rules.from}/gscan_widget.html.erb" todir="${rules.to}"/> 
    <copy file="${properties.from}/gscan.properties" todir="${properties.to}"/> 
    <copy file="${properties.from}/gscan_fr.properties" todir="${properties.to}"/> 
     <copy todir="${build.dir}/META-INF"> 
       <fileset dir="${gscan.source}/META-INF"/> 
      </copy> 
    <!--copy file="${gscan.source}/jsr305-1.3.9.jar" todir="${build.dir}"/--> 
    </target> 

    <target name="getSource" depends="clean"> 

      <copy todir="src"> 
       <fileset dir="${build.dir}"/> 
      </copy>   
    </target> 
    <target name="buildJar" depends="compile,getSource"> 
     <jar basedir="src" destfile="${target.folder}\SonarPlugin\${jar.name}.jar"> 
     <manifest> 
     <attribute name="Plugin-Dependencies" value="META-INF/lib/commons-lang-2.6.jar" /> 

     <attribute name="Plugin-Description" value="Analysis GOSU with CCAP Gosu plug-in " /> 

     <attribute name="Plugin-BuildDate" value="2016-12-07T12:45:26+0530" /> 

     <attribute name="Archiver-Version" value="Plexus Archiver" /> 

     <attribute name="Built-By" value="479848" /> 
     <attribute name="Plugin-Homepage" value="http://www.sonarqube.org/sonar-gosu-plugin/" /> 

     <attribute name="Plugin-License" value="GNU LGPL 3" /> 
     <attribute name="Plugin-Version" value="2.0" /> 

     <attribute name="Plugin-Organization" value="SonarSource" /> 
     <attribute name="Sonar-Version" value="6.1" /> 

     <attribute name="Plugin-IssueTrackerUrl" value="http://www.sonarqube.org/browse/SONAR" /> 
     <attribute name="Plugin-ChildFirstClassLoader" value="true" /> 

     <attribute name="Plugin-TermsConditionsUrl" value="" /> 
     <attribute name="Implementation-Build" value="0" /> 

     <attribute name="Plugin-OrganizationUrl" value="http://www.sonarqube.org" /> 
     <attribute name="Build-Time" value="2016-12-07T12:44:29+0530" /> 

     <attribute name="Plugin-Key" value="gosu" /> 
     <attribute name="Plugin-Class" value="org.sonarsource.plugins.gscan.GosuPlugin" /> 

     <attribute name="Build-Jdk" value="1.8.0_92" /> 
     <attribute name="Plugin-Name" value="sonar-gosu-plugin-2.0" /> 
     </manifest> 
    </jar> 
    </target> 

</project> 
以下に示します。
+0

GosuPluginはorg.sonar.api.Pluginを実装していますか? (ドキュメントの説明:http://docs.sonarqube.org/display/DEV/API+Basics) –

+0

このプラグインはしばらくサポートされていないバージョンのAPIで構築されています。 –

答えて

0

この問題は、タグに記載されている間違った詳細が原因です。プロジェクトは新しいマニフェストの詳細に従って再構成されます。マニフェストの詳細については、Mavenビルドで生成された.MFファイルをチェックしてください。

関連する問題