jira-importer commented on issue #306:
URL: 
https://github.com/apache/maven-install-plugin/issues/306#issuecomment-2771866545

   **[Witold 
Markowski](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=wmarkow)**
 commented
   
   This behavior may be an expected behavior. It looks like **3.0.0-M1** will 
install **pom** file always, if the **pom** is available from the inside of the 
installed **jar** file. When the artifact is built by Maven, it will put the 
**pom** in the **META-INF** directory inside of the jar. This **pom** file will 
be installed always no matter what **generatePom** says.
   
   However **generatePom** comes into action when you want to install a **jar** 
file which doesn't contain any **META-INF** inside. [Robert 
Lieske](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=robert12345),
 please do a simple test:
   * delete whole **META-INF** from the inside of your 
**target/test1-1.0-SNAPSHOT.jar**
   * execute **mvn 
org.apache.maven.plugins:maven-install-plugin:3.0.0-M1:install-file 
-Dfile=target/test1-1.0-SNAPSHOT.jar -DgroupId=test1 -DartifactId=test1 
-Dversion=1.0-SNAPSHOT -Dpackaging=jar -DgeneratePom=false**
   
   In my test **pom** file is not generated by **maven-install-plugin** as 
below:
   
   ```
   $ mvn org.apache.maven.plugins:maven-install-plugin:3.0.0-M1:install-file 
-Dfile=target/test1-1.0-SNAPSHOT.jar -DgroupId=test1 -DartifactId=test1 
-Dversion=1.0-SNAPSHOT -Dpackaging=jar -Dgene ratePom=false
   [INFO] Scanning for projects...
   [INFO]
   [INFO] 
------------------------------------------------------------------------
   [INFO] Building test1 1.0-SNAPSHOT
   [INFO] 
------------------------------------------------------------------------
   [INFO]
   [INFO] --- maven-install-plugin:3.0.0-M1:install-file (default-cli) @ test1 
---
   [INFO] pom.xml not found in test1-1.0-SNAPSHOT.jar
   [INFO] Installing 
C:\Users\wmarkowski\dev-test\sources\test1\target\test1-1.0-SNAPSHOT.jar to 
C:\Users\wmarkowski\.m2\repository\test1\test1\1.0-SNAPSHOT\test1-1.0-SNAPSHOT.jar
   [INFO] 
------------------------------------------------------------------------
   [INFO] BUILD SUCCESS
   [INFO] 
------------------------------------------------------------------------
   [INFO] Total time: 0.730 s
   [INFO] Finished at: 2019-02-04T23:13:56+01:00
   [INFO] Final Memory: 9M/245M
   [INFO] 
------------------------------------------------------------------------
   ```
   
   From the other hand, this behavior may break the back compatibility with 
**2.5.2** version, where it was possible to **NOT** to install **pom**. The 
question is: does **3.0.0-M1** need to be as much back compatible with 
**2.5.2**? Second thing: it seems to be a good idea to have **pom** as well 
installed; maven will have then all information about dependencies used by the 
installed **jar**.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to