You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Radu Cotescu <ra...@apache.org> on 2019/08/21 14:09:09 UTC

[slingfeature-maven-plugin] are multi-module builds supported?

Hi,

Before opening a bug in JIRA I want to figure out if what I’m experiencing is a bug or if this is the normal behaviour.

I have the current Maven setup:

Reactor:
    Project A - feature attached to the build
    Project B - A is the prototype, feature attached to the build

If I’m trying to build everything from the reactor using slingfeature-maven-plugin 1.0.6 and I get the following error:

[INFO] Scanning for projects...
[ERROR] Unable to get feature A:slingosgifeature:0.0.1-SNAPSHOT : Recursive feature dependency list including project MavenProject: B:0.0.1-SNAPSHOT @ ~/workspace/reactor/B/pom.xml
[ERROR] Internal error: java.lang.IllegalStateException: Unable to find prototype feature A:slingosgifeature:0.0.1-SNAPSHOT -> [Help 1]
org.apache.maven.InternalErrorException: Internal error: java.lang.IllegalStateException: Unable to find prototype feature A:slingosgifeature:0.0.1-SNAPSHOT
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:120)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: java.lang.IllegalStateException: Unable to find prototype feature A:slingosgifeature:0.0.1-SNAPSHOT
    at org.apache.sling.feature.builder.FeatureBuilder.internalAssemble (FeatureBuilder.java:314)
    at org.apache.sling.feature.builder.FeatureBuilder.assemble (FeatureBuilder.java:59)
    at org.apache.sling.feature.maven.Preprocessor.process (Preprocessor.java:216)
    at org.apache.sling.feature.maven.Preprocessor.process (Preprocessor.java:118)
    at org.apache.sling.feature.maven.mojos.DependencyLifecycleParticipant.afterProjectsRead (DependencyLifecycleParticipant.java:79)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:264)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)

Project A is marked as a prototype for B in B's feature file:

"prototype": {
    "id": “A:slingosgifeature:0.0.1-SNAPSHOT”
}

But it’s also a Maven dependency:

<dependency>
    <groupId>org.apache.sling</groupId>
    <artifactId>A</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <scope>provided</scope>
</dependency>

Removing the Maven dependency didn’t help from the pom didn’t help. Any ideas? If I build the modules independently everything works as expected.

Thanks,
Radu

Re: [slingfeature-maven-plugin] are multi-module builds supported?

Posted by Radu Cotescu <ra...@apache.org>.
Hello,

I’ve figured out that we indeed have a bug and opened https://issues.apache.org/jira/browse/SLING-8652 <https://issues.apache.org/jira/browse/SLING-8652>.

Cheers,
Radu