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

Add support for pomFile parameter #98

Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/it/check-separate-fails/invalid-pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?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 http://maven.apache.org/maven-v4_0_0.xsd">

<artifactId>pom-check-fails</artifactId>
<groupId>org.codehaus.mojo.tidy.its</groupId>
<parent>
<groupId>org.codehaus</groupId>
<artifactId>codehaus-parent</artifactId>
<version>4</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<version>1.0-SNAPSHOT</version>

<description>Test that check fails for a POM that is not tidy.</description>
</project>
2 changes: 2 additions & 0 deletions src/it/check-separate-fails/invoker.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
invoker.goals = verify
invoker.buildResult = failure
38 changes: 38 additions & 0 deletions src/it/check-separate-fails/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?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>

<parent>
<groupId>org.codehaus</groupId>
<artifactId>codehaus-parent</artifactId>
<version>4</version>
</parent>

<groupId>org.codehaus.mojo.tidy.its</groupId>
<artifactId>pom-check-separate-fails</artifactId>
<version>1.0-SNAPSHOT</version>

<description>Test that check fails for an external invalid POM</description>

<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tidy-maven-plugin</artifactId>
<version>@pom.version@</version>
<executions>
<execution>
<id>validate</id>
<phase>validate</phase>
<goals>
<goal>check</goal>
</goals>
<configuration>
<pomFile>${project.basedir}/invalid-pom.xml</pomFile>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
2 changes: 2 additions & 0 deletions src/it/check-separate-succeeds/invoker.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
invoker.goals = verify
invoker.buildResult = success
37 changes: 37 additions & 0 deletions src/it/check-separate-succeeds/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?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 http://maven.apache.org/maven-v4_0_0.xsd">

<artifactId>pom-check-fails</artifactId>
<groupId>org.codehaus.mojo.tidy.its</groupId>
<parent>
<groupId>org.codehaus</groupId>
<artifactId>codehaus-parent</artifactId>
<version>4</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<version>1.0-SNAPSHOT</version>

<description>Test that check passes for a separate POM that is tidy.</description>

<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tidy-maven-plugin</artifactId>
<version>@pom.version@</version>
<executions>
<execution>
<id>validate</id>
<phase>validate</phase>
<goals>
<goal>check</goal>
</goals>
<configuration>
<pomFile>${project.basedir}/valid-pom.xml</pomFile>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
16 changes: 16 additions & 0 deletions src/it/check-separate-succeeds/valid-pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?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>

<parent>
<groupId>org.codehaus</groupId>
<artifactId>codehaus-parent</artifactId>
<version>4</version>
</parent>

<groupId>org.codehaus.mojo.tidy.its</groupId>
<artifactId>pom-check-succeeds</artifactId>
<version>1.0-SNAPSHOT</version>

<description>Test that check doesn't fail for a tidy separate POM</description>
</project>
2 changes: 2 additions & 0 deletions src/it/separate-pom/invoker.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
invoker.goals = org.codehaus.mojo:tidy-maven-plugin:${project.version}:pom -Dtidy.pomFile=separate-pom.xml
invoker.buildResult = success
17 changes: 17 additions & 0 deletions src/it/separate-pom/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?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 http://maven.apache.org/maven-v4_0_0.xsd">

<packaging>pom</packaging>

<artifactId>pom-space-indent</artifactId>
<groupId>org.codehaus.mojo.tidy.its</groupId>
<parent>
<groupId>org.codehaus</groupId>
<artifactId>codehaus-parent</artifactId>
<version>4</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<version>1.0-SNAPSHOT</version>
<description>Test of tidy:pom on a separate pom with all elements.</description>

</project>
231 changes: 231 additions & 0 deletions src/it/separate-pom/separate-pom-expected.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,231 @@
<?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>

<parent>
<groupId>org.codehaus</groupId>
<artifactId>codehaus-parent</artifactId>
<version>4</version>
</parent>

<groupId>org.codehaus.mojo.tidy.its</groupId>
<artifactId>pom-space-indent</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>

<name>Complete POM test</name>
<description>Test of tidy:pom on a separate pom with all elements.</description>
<url>http://maven.apache.org</url>
<inceptionYear>2011</inceptionYear>
<organization>
<name>MojoHaus</name>
<url>http://www.mojohaus.org</url>
</organization>
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>

<developers>
<developer>
<name>John Doe</name>
<email>[email protected]</email>
<roles>
<role>Lead Developer</role>
</roles>
<timezone>0</timezone>
</developer>
</developers>
<contributors>
<contributor>
<name>Jane Doe</name>
<email>[email protected]</email>
</contributor>
</contributors>

<mailingLists>
<mailingList>
<name>MojoHaus Development List</name>
<subscribe>[email protected]</subscribe>
<unsubscribe>[email protected]</unsubscribe>
<post>[email protected]</post>
<archive>https://groups.google.com/forum/#!forum/mojohaus-dev</archive>
</mailingList>
<mailingList>
<name>Maven Users List</name>
<subscribe>[email protected]</subscribe>
<unsubscribe>[email protected]</unsubscribe>
<post>[email protected]</post>
<archive>http://mail-archives.apache.org/mod_mbox/maven-users/</archive>
<otherArchives>
<otherArchive>http://maven.40175.n5.nabble.com/Maven-Users-f40176.html</otherArchive>
</otherArchives>
</mailingList>
</mailingLists>

<prerequisites>
<maven>2.2.1</maven>
</prerequisites>

<scm>
<connection>scm:git:https://github.com/mojohaus/tidy-maven-plugin.git</connection>
<developerConnection>scm:git:ssh://[email protected]/mojohaus/tidy-maven-plugin.git</developerConnection>
<url>https://github.com/mojohaus/tidy-maven-plugin</url>
</scm>
<issueManagement>
<system>GitHub</system>
<url>https://github.com/mojohaus/tidy-maven-plugin/issues</url>
</issueManagement>
<ciManagement>
<system>travis</system>
<url>https://travis-ci.org/mojohaus/tidy-maven-plugin</url>
</ciManagement>
<distributionManagement>
<repository>
<id>ossrh-staging</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
</repository>
<snapshotRepository>
<id>ossrh-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<site>
<id>github</id>
<url>scm:git:[email protected]:mojohaus/tidy-maven-plugin.git</url>
</site>
</distributionManagement>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<junit.version>5.7.2</junit.version>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>3.0.24</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.19.0</version>
<type>bundle</type>
</dependency>
</dependencies>

<repositories>
<repository>
<id>ossrh-snapshots</id>
<name>ossrh-snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>ossrh-snapshots</id>
<name>ossrh-snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration></configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.16</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<id>build-helper</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
</execution>
</executions>
<configuration>
<source>dummy</source>
</configuration>
</plugin>
</plugins>
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh-external</artifactId>
<version>1.0-beta-6</version>
</extension>
</extensions>
</build>

<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>2.7</version>
</plugin>
</plugins>
</reporting>

<profiles>
<profile>
<id>run-its</id>
<activation>
<property>
<name>skipTests</name>
<value>!true</value>
</property>
</activation>
</profile>
</profiles>
</project>
Loading