I had the following execution in the config for karaf-maven-plugin in my
pom files:
    <execution>
        <id>generate-features-file</id>
        <phase>package</phase>
        <goals>
            <goal>features-generate-descriptor</goal>
        </goals>
    </execution>

But when I wanted to use a github task to build and publish javadoc to
github pages, the javadoc task failed because it could not resolve
dependencies like e.g. this one:
   <dependency>
       <groupId>no.priv.bang.modeling.modelstore</groupId>
       <artifactId>modelstore.services</artifactId>
       <version>${project.version}</version>
       <classifier>features</classifier>
       <type>xml</type>
   </dependency>

The reason it couldn't resolve the dependencies was that the github task
ran maven-site-plugin site:site on a clean build:
 https://maven.apache.org/plugins/maven-site-plugin/site-mojo.html

And site:site runs requires the test phase, and by the test phase stuff
in package hadn't been run.  So it couldn't find the features files.

So I moved features-generate-descriptor to the validate phase.
    <execution>
        <id>generate-features-file</id>
        <phase>validate</phase>
        <goals>
            <goal>features-generate-descriptor</goal>
        </goals>
    </execution>

After moving features-generate-descriptor to validate, the github
javadoc task works and publishes new javadoc when I push to the repo.

But I got a different issue, and that is an info level maven problem
from m2e in eclipse:
 Plugin execution not covered by lifecycle configuration: 
org.apache.karaf.tooling:karaf-maven-plugin:4.4.3:features-generate-descriptor 
(execution: generate-features-file, phase: validate)

It's just an info level message so it doesn't block anything, but it is
annoying.

The only way I've figured out to get rid of the message is to mark the
goal features-generate-descriptor as ignored in either the eclipse
workspace or in the pom files.

Ignoring in the workspace makes the problem show up again if the project
is imported into a different eclipse workspace.

Ignoring in the pom.xml creates undesirable clutter in the pom files
(especially since it has to be configured directly in the poms of the
affected projects. Ignoring a maven target in a parent pom doesn't
work).

Also: the problem doesn't occur when the execution is in phase package,
so there is some eclipse awareness of this maven goal, so ignoring the
goal feels wrong.

Where the awareness of the karaf goal is defined, I do not know. There
are as far as I can tell no m2e plugins related to karaf...?

Does anyone know a way I can make eclipse stop complaining without too
much pom clutter, and while still keeping the javadoc github task
working?

Thanks!


- Steinar

Reply via email to