Skip to content

[MINSTALL-160] generatePom=true with 3.0.0-M1 does not generate minimal POM but copies existing one #326

@jira-importer

Description

@jira-importer

Václav Haisman opened MINSTALL-160 and commented

I am using install:install-file with generatePom=true to install JAR with minimal POM file. This has stopped working with 3.0.0-M1. With 3.0.0-M1, it copeis existing project pom.xml instead of generating a minimal one.

 

This is easily reproducible with minimal project:

<?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/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>maven.install.plugin.issue</groupId>
  <artifactId>maven.install.plugin.issue</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>jar</packaging>

  <name>maven.install.plugin.issue</name>

  <properties>
    <maven.compiler.source>1.6</maven.compiler.source>
    <maven.compiler.target>1.6</maven.compiler.target>
  </properties>

  <build>
    <pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
      <plugins>
        <plugin>
          <artifactId>maven-install-plugin</artifactId>
          <!-- 2.5.2 does generate POM correctly. But 3.0.0-M1 does not. -->
          <version>3.0.0-M1</version>
          <!-- version>2.5.2</version -->
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>
      <plugin>
        <artifactId>maven-install-plugin</artifactId>
        <executions>
          <execution>
            <id>default-install</id>
            <phase>none</phase>
            <goals><goal>install</goal></goals>
          </execution>
          <execution>
            <id>custom-install</id>
            <phase>install</phase>
            <goals>
              <goal>install-file</goal>
            </goals>
            <configuration>
              <file>${project.build.directory}/${project.artifactId}-${project.version}.${project.packaging}</file>
              <generatePom>true</generatePom>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>

Affects: 3.0.0-M1, 3.0.0

Issue Links:

  • MINSTALL-110 install-file should also install bundled pom.xml from artifact.
    ("Blocked")

Remote Links:

1 votes, 4 watchers

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingpriority:majorMajor loss of function

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions