2017-03-07 57 views
0

我有以下结构如何在父模块中使用多模块项目中的jqassistent并行存储模块?

myProject 
    + parent 
     - pom.xml 
    + moduleA 
     - pom.xml 
    + moduleB 
     - pom.xml 

多模块Maven项目我会在父目录配置jqassistant以同样的方式我一个简单的项目一样。但我想,它不会找到任何类别。我是否真的需要再次声明所有模块引用:

<scanIncludes> 
    <scanInclude> 
     <path>../moduleA/target/classes</path> 
     <scope>java:classpath</scope> 
    </scanInclude> 
</scanIncludes> 

还是有更清洁的方法?我必须做额外的步骤吗?

回答

0

有没有必要进行特殊扫描包括。但有必要将jqassistant.useExecutionRootAsProjectRoot设置为true。这可以通过系统属性-Djqassistant.useExecutionRootAsProjectRoot<useExecutionRootAsProjectRoot>true</useExecutionRootAsProjectRoot>在pom.xml的配置部分完成。如果您直接运行jquasssitant目标例如jqassistant:server,则必须设置系统属性。 如果您经常使用mvn clean install,则将neo4j数据库存储在目标目录之外非常重要。否则,最后一次清理将失败。你可以通过<storeDirectory>${project.build.directory}/../../store</storeDirectory>来实现。用-DstoreDirectory似乎并不奏效。

0

如果您的模块(即moduleA和moduleB)通过它们的pom.files的父元素引用父代,那么在plugins部分中声明jQAssistant Maven插件就足够了。有关多模块项目的示例,请参阅https://github.com/buschmais/extended-objects/

+0

它不适合我。我得到'执行默认的目标com.bu ..... jqassistant:jqassistant-maven-plugin:1.2.0:扫描失败:错误开始org.neo4j.kernel.impl.factory.CommunityFacadeFactory,... Parent \ target \ jqassistant \ store:组件'[email protected]'已成功初始化,但未能启动。请参阅附加的原因异常。无法获取商店锁定文件上的锁定:..Parent \ target \ jqassistant \ store \ store_lock。请确保没有其他进程正在使用此数据库,并且该目录是可写的(...):OverlappingFileLockException' – niels

+0

您可以从根模块(myProject)运行“mvn install -Djqassistant.useExecutionRootAsProjectRoot”吗? –

+0

解决了这个问题。如何'mvn干净安装-Djqassistant.useExecutionRootAsProjectRoot'不起作用。因此,我认为我必须把商店放到另一个目录。必须稍后进行调查。 – niels