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

   **[Peter De 
Maeyer](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=peterdm)** 
commented
   
   My use case: some of my submodules in my multi-module project only produce 
artifacts of type "test-jar". In other words, they don't have produce a main 
`my-artifact-1.0.0.jar`, but they _do_ produce a `my-artifact-1.0.0-tests.jar`. 
In my parent POM I have a section which fits for any module that produces 
either or both a main or test artifact, as supported by the default 
`maven-jar-plugin`:
   
   ```xml
   <plugin>
       <artifactId>maven-jar-plugin</artifactId>
       <executions>
           <execution>
               <!-- The ID must match the ID of the default goal, because we 
want to reconfigure it. -->
               <id>default-jar</id>
               <goals>
                   <goal>jar</goal>
               </goals>
               <!-- Don't produce an artifact of type "jar" if main/src is 
empty. -->
               <configuration>
                   <skipIfEmpty>true</skipIfEmpty>
               </configuration>
           </execution>
           <execution>
               <goals>
                   <goal>test-jar</goal>
               </goals>
               <!-- Don't produce an artifact of type "test-jar" if test/src is 
empty. -->
               <configuration>
                   <skipIfEmpty>true</skipIfEmpty>
               </configuration>
           </execution>
       </executions>
   </plugin>
   ```
   
   `maven-install-plugin` fails with the above "The packaging plugin for this 
project did not assign a main file to the project but it has attachments. 
Change packaging to 'pom'."
   
   The advice is wrong, I can't change packaging to 'pom' because then it won't 
compile nor run my tests.
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to