0
votes

I have a maven dependency which requires org\drools\drools-compiler 4.0.3 (drools-compiler 4.0.3 is not mentioned in my pom.xml but gets downloaded as a dependency). Now I am trying to integrate Drools framework with Spring. This requires me to use drools-spring 5.4.0.Final jar. Hence I have added the below pom entry.

        <dependency>
            <groupId>org.drools</groupId>
            <artifactId>drools-spring</artifactId>
            <version>5.4.0.Final</version>
        </dependency>
        <dependency>
            <groupId>org.drools</groupId>
            <artifactId>drools-compiler</artifactId>
            <version>5.4.0.Final</version>
        </dependency>

Now when I run a mvn clean install , I see the dependency drools-spring and corresponding dependencies (drools-compiler 5.4,drools core 5.4) getting downloaded, but however after doing mvn eclipse:eclipse, I still dont find the new dependencies showing up under maven dependencies in Eclipse classpath. In fact I still see the old 4.0.3 version under dependencies for drools-compiler and drools-core. I have tried an eclipse restart. Doesnt help either. How do I show the new 5.4 version jar instead of the 4.0.3 ?

2
Try to right-click and select "Maven > Update project..." - Tunaki
Any work around without the m2e plugin ? - Vinod Kumar Rai

2 Answers

0
votes
  1. As you mentioned you are using eclipse i will suggest to use maven eclipse plugin from eclipse market place.
  2. When you will add maven plugin from eclipse you will able to see a Maven menu item when you will right click on the maven project then inside that menu you will able to see Update Maven project click on that.
  3. If you do not want to do above two steps run the below command with -U.

Check below

mvn eclipse:eclipse -U

OR

mvn install -U 

OR

mvn clean -U

See Maven: The Complete Reference, 6.1.11. Downloading and Verifying Dependencies or mvn --help:

-U,--update-snapshots Forces a check for missing releases and updated snapshots on remote repositories

Maven command with

-1
votes

I figured out I was adding the pom entries in the wrong pom.xml. Ideally the pom entries should be present in the service impl pom.xml.