Maven升级了DROOLS版本,现在无法再构建

时间:2018-03-20 15:27:53

标签: java maven drools

我是maven和java的新手。我正在开发Java / DROOLS项目。我遇到了错误,这些错误似乎与下一版DROOLS有关。我更改了<controls:SomeControl x:Name="OhWhy" />中的版本,然后执行了mvn包。

文件已下载,但引用DROOLS的每行代码都会引发编译错误pom.xml

package org.drools does not exist

非常感谢任何帮助。

修改 这是我的pom.xml。

[ERROR] /C:/Dev/src/main/java/com/company/project/drools/client/DroolsRulesRunner.java:[11,18] package org.drools does not exist
[ERROR] /C:/Dev/src/main/java/com/company/project/drools/client/DroolsRulesRunner.java:[12,29] package org.drools.definition does not exist

我唯一改变的是

<?xml version="1.0" encoding="UTF-8"?>
<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>com.bericotechnologies</groupId>
  <artifactId>sbt-rules</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>jar</packaging>
  <name>my-app</name>
  <url>http://maven.apache.org</url>
  <properties>
    <drools.version>7.6.0.Final</drools.version>
    <jbpm5.version>7.6.0.Final</jbpm5.version>
  </properties>
  <dependencies>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-jdk14</artifactId>
      <version>1.7.12</version>
    </dependency>
    <dependency>
      <groupId>org.jbpm</groupId>
      <artifactId>jbpm-flow</artifactId>
      <version>${jbpm5.version}</version>
    </dependency>
    <dependency>
      <groupId>org.jbpm</groupId>
      <artifactId>jbpm-bpmn2</artifactId>
      <version>${jbpm5.version}</version>
    </dependency>
    <dependency>
      <groupId>org.jbpm</groupId>
      <artifactId>jbpm-flow-builder</artifactId>
      <version>${jbpm5.version}</version>
    </dependency>
    <dependency>
      <groupId>pl.maciejwalkowiak</groupId>
      <artifactId>junit-drools</artifactId>
      <version>1.0</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-all</artifactId>
      <version>1.3</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>joda-time</groupId>
      <artifactId>joda-time</artifactId>
      <version>2.9</version>
    </dependency>
    <dependency>
      <groupId>org.drools</groupId>
      <artifactId>drools-compiler</artifactId>
      <version>${drools.version}</version>
    </dependency>
    <dependency>
      <groupId>org.eclipse.persistence</groupId>
      <artifactId>org.eclipse.persistence.core</artifactId>
      <version>2.6.3</version>
    </dependency>
    <dependency>
      <groupId>com.microsoft.sqlserver</groupId>
      <artifactId>sqljdbc4</artifactId>
      <version>4.0</version>
    </dependency>
    <dependency>
      <groupId>com.microsoft.sqlserver</groupId>
      <artifactId>sqljdbc</artifactId>
      <version>4.0</version>
    </dependency>
    <dependency>
      <groupId>org.rzo.yajsw</groupId>
      <artifactId>wrapper</artifactId>
      <version>11.11</version>
    </dependency>
    <dependency>
      <groupId>org.rzo.yajsw</groupId>
      <artifactId>wrapperApp</artifactId>
      <version>11.11</version>
    </dependency>
  </dependencies>
  <repositories>
    <repository>
      <id>jboss</id>
      <name>jboss</name>
      <url>https://repository.jboss.org/nexus/content/groups/public/</url>
    </repository>
    <repository>
      <id>maciejwalkowiak.pl</id>
      <url>https://github.com/maciejwalkowiak/maven-repo/raw/releases/</url>
    </repository>
  </repositories>
  <build>
    <resources>
      <resource>
        <directory>src/main/rules</directory>
      </resource>
    </resources>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.3</version>
        <configuration>
          <source>1.7</source>
          <target>1.7</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>com.google.code.sortpom</groupId>
        <artifactId>maven-sortpom-plugin</artifactId>
        <version>2.3.0</version>
        <executions>
          <execution>
            <phase>verify</phase>
            <goals>
              <goal>sort</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <archive>
            <manifest>
              <mainClass>com.berico.psip.run.RunDroolsService</mainClass>
            </manifest>
          </archive>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>

<properties>
    <drools.version>5.6.0.Final</drools.version>
    <jbpm5.version>5.5.0.Final</jbpm5.version>
  </properties>

如果我改回来,一切正常。我可以在存储库中看到7.6.0.Final jar。

1 个答案:

答案 0 :(得分:1)

你破坏了进口,你必须修复它们。

版本5.6.0.Final7.6.0.Final之间Drools的包结构发生了变化。 “定义”包现在位于org.drools.core.definitionsv7.6.0.Final)下,而不是org.drools.definitions5.6.0.Final)下。

您需要删除类中以org.drools开头的所有导入,然后使用新的软件包位置 - 版本7.6.0.Final重新导入缺少的Drools类。