简体   繁体   English

使用maven编译时验证drl文件

[英]Verify drl file when compiling with maven

First, I've attempted to use the kie-maven-plugin in the project parent: 首先,我试图在项目父级中使用kie-maven-plugin:

<groupId>org.kie</groupId>
<artifactId>kie-maven-plugin</artifactId>
<version>6.1.0.Final</version>
<extensions>true</extensions>

but after further reading it doesn't sound like it actually precompiles the rules before placing them in the jar (and I don't see any sign of it doing so). 但是在进一步阅读之后,它听起来并不像它实际上预先编译规则,然后将它们放入罐子里(我没有看到它的任何迹象)。

I also see that there is a drools verifier, however it seems that this only works to verify drl files within Java. 我也看到有一个drools验证程序,但似乎这只能用于验证Java中的drl文件。

Is there a good way to compile / verify a drl file in a Maven build so that I don't deploy and run the webservice only to find that there is a typo in the drl file? 有没有一种很好的方法来编译/验证Maven构建中的drl文件,以便我不部署和运行webservice只是为了发现drl文件中存在拼写错误?

I'm currently using Eclipse Kepler w/ the Drools plugins, Maven 3.x and Drools 6.0.1. 我目前正在使用带有Drools插件的Eclipse Kepler,Maven 3.x和Drools 6.0.1。

I would guess that you forgot to specify the packaging as "kjar". 我猜你忘了将包装指定为“kjar”。 If that is the case, the plugin won't be executed during the Maven build. 如果是这种情况,则在Maven构建期间不会执行插件。 Simply add <packaging>kjar</packaging> into you pom.xml. 只需将<packaging>kjar</packaging>到pom.xml中。

Please see the example usage of the kie-maven-plugin: https://github.com/droolsjbpm/drools/blob/master/kie-maven-plugin-example/pom.xml 请参阅kie-maven-plugin的示例用法: https//github.com/droolsjbpm/drools/blob/master/kie-maven-plugin-example/pom.xml

To best of my knowledge the kie-maven-plugin only verifies that the resources can be compiled. 据我所知,kie-maven-plugin仅验证资源是否可以编译。 Running Drools verifier is not part of the execution. 运行Drools验证程序不是执行的一部分。

If you are already using the "kjar" packaging, please post the entire pom.xml, otherwise it is hard to guess what is actually causing the described behavior. 如果您已经在使用“kjar”打包,请发布整个pom.xml,否则很难猜出究竟是什么导致了所描述的行为。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM