TaskService

Hi Team,

I want to use TaskService for one of operation, but not able to import org.nuxeo.ecm.platform.task package and as a result TaskService also not found.

Which maven dependency I need to include to solve this problem ?

Appreciating your help. Thank you.

Note*: we are using Nuxeo LTS 2021.1.19 version.

Regards, Vinit Shah

0 votes

1 answers

517 views

ANSWER



I hope there is some better way of doing it, or better tooling, because I also struggle with this and it makes the development tedious. For now what I am doing is:

Note: You need the complete sources including the addons. Also I am doing this for LTS2019 but the process should be the same.

  1. Find the corresponding java file in the sources i.e. ./nuxeo-features/nuxeo-platform-task/nuxeo-platform-task-api/src/main/java/org/nuxeo/ecm/platform/task/TaskService.java
  2. open the the associated pom.xml i.e. ./nuxeo-features/nuxeo-platform-task/nuxeo-platform-task-api/pom.xml
  3. note the parent group id org.nuxeo.ecm.platform and the artificatId (not the parent one) nuxeo-platform-task-api
  4. Add these as a dependency in your pom.xml
    <dependency>
      <groupId>org.nuxeo.ecm.platform</groupId>
      <artifactId>nuxeo-platform-task-api</artifactId>
    </dependency>
    
    If you specifiy nuxeo (e.g. nuxeo-addons-parent) as your parent you should not need a version tag (e.g. <version>10.10</version>).

But: More often this is not enough and you keep doing these steps again and again for different missing dependencies. Sometimes there is a parent artificat that is more appropirate to use instead of listing all the single dependencies.

0 votes



Thanks Konrad Krenzlin , it work for me.
11/01/2022