wttech/gradle-aem-plugin

MvnModule: package pom is not resolved as ArtifactType.POM

Closed this issue · 1 comments

The problem occurs when package pom contains the <build> element that begins with the <pluginManagement> element which includes <artifactId>content-package-maven-plugin</artifactId>

The logic responsible for that behavoir is there

text.substringBetweenTag("build").substringBetweenTag("plugins").contains("<artifactId>$it</artifactId>")

Possible solution might be

    fun isPackage(pom: File) = pom.parentFile.resolve(build.contentPath.get()).exists() || pom.readText().let { text ->
        text.contains("<packaging>content-package</packaging>") && packagePlugins.get().any {
            text.substringBetweenTag("build").substringBetweenTag("plugins").contains("<artifactId>$it</artifactId>")
        }
    }