I have found the issue: the problem was inside the pom.xml of the ear module
<dependencies>
<dependency>
<groupId>com.example</groupId>
<artifactId>APPNAME-ejb</artifactId>
<version>${project.version}</version>
<type>ejb</type>
</dependency>
<dependency>
<groupId>com.example</groupId>
<artifactId>APPNAME-web</artifactId>
<version>${project.version}</version>
<type>war</type>
</dependency>
</dependencies>
these dependencies after build block in the xml file were not added; after the edit the error disappeared.