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

Goal tidy:pom fails if build section is empty #105

Open
ghusta opened this issue Jul 9, 2024 · 0 comments
Open

Goal tidy:pom fails if build section is empty #105

ghusta opened this issue Jul 9, 2024 · 0 comments

Comments

@ghusta
Copy link

ghusta commented Jul 9, 2024

Running mvn tidy:pom fails if section build is empty in POM.

Execution failing with :

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.example</groupId>
    <artifactId>test-tidy-pom</artifactId>
    <version>1.0-SNAPSHOT</version>

    <properties>
        <maven.compiler.source>17</maven.compiler.source>
        <maven.compiler.target>17</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <version>5.10.3</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
    </build>
</project>

Execution successful with :

    <build>
        <finalName>${project.artifactId}</finalName>
    </build>

or

    <build>
        <plugins>
        </plugins>
    </build>

Error log :

[ERROR] Failed to execute goal org.codehaus.mojo:tidy-maven-plugin:1.3.0:pom (default-cli) on project test-tidy-pom: Illegal processing instruction target ("xml"); xml (case insensitive) is reserved by the specs.
[ERROR]  at [row,col {unknown-source}]: [26,7]
@ghusta ghusta changed the title Goal tidy:pom fails if build section empty Goal tidy:pom fails if build section is empty Jul 9, 2024
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

No branches or pull requests

1 participant