Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MvnModule: package pom is not resolved as ArtifactType.POM #947

Closed
piotr-rogacki-wttech opened this issue May 12, 2023 · 1 comment · Fixed by #948
Closed

MvnModule: package pom is not resolved as ArtifactType.POM #947

piotr-rogacki-wttech opened this issue May 12, 2023 · 1 comment · Fixed by #948

Comments

@piotr-rogacki-wttech
Copy link
Collaborator

piotr-rogacki-wttech commented May 12, 2023

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>")
        }
    }
@piotr-rogacki-wttech piotr-rogacki-wttech linked a pull request May 23, 2023 that will close this issue
@krystian-panek-vmltech
Copy link
Collaborator

Cool thx @piotr-rogacki-wttech

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants