2016-07-26 3 views
0

私のプロジェクトをパッケージ化しようとしました。しかし、jarファイルを実行すると、バグが見つかります。名前が 'BlockTreeOrds'のNeo4j PostingsFormatは存在しません

Exception in thread "main" java.lang.RuntimeException: Error starting org.neo4j.kernel.impl.factory.CommunityFacadeFactory, D:\f 
    ... 
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.k[email protected]5483163c' failed to initialize. Please see attached cause exception. 
    ... 
Caused by: java.lang.IllegalArgumentException: An SPI class of type org.apache.lucene.codecs.PostingsFormat with name 'BlockTreeOrds' does not exist. You need to add the corresponding JAR file supporting this SPI to your classpath. The current classpath supports the following names: [Lucene50] 

...

私はプロジェクトをパッケージ化するためにMavenを使用しています。

<build> 
    <plugins> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-compiler-plugin</artifactId> 
      <configuration> 
       <source>1.8</source> 
       <target>1.8</target> 
      </configuration> 
     </plugin> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-assembly-plugin</artifactId> 
      <configuration> 
       <descriptorRefs> 
        <descriptorRef>jar-with-dependencies</descriptorRef> 
       </descriptorRefs> 
       <archive> 
        <manifest> 
         <mainClass>db.PostgreSQL</mainClass> 
        </manifest> 
       </archive> 
      </configuration> 
     </plugin> 
    </plugins> 
</build> 

<dependencies> 
    <dependency> 
     <groupId>org.neo4j</groupId> 
     <artifactId>neo4j</artifactId> 
     <version>3.0.3</version> 
    </dependency> 
</dependencies> 

私がIntellijで直接実行したときのプロジェクトです。

答えて

0

最後に、解決策が見つかりました。プロジェクトをパッケージ化するためにfollow Mavenプラグインを使用する。

 <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-shade-plugin</artifactId> 
      <version>2.4.3</version> 
      <executions> 
       <execution> 
        <phase>package</phase> 
        <goals> 
         <goal>shade</goal> 
        </goals> 
        <configuration> 
         <transformers> 
          <transformer 
            implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> 
           <mainClass>main</mainClass> 
          </transformer> 
          <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/> 

         </transformers> 
        </configuration> 
       </execution> 
      </executions> 
     </plugin> 
関連する問題