You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Yuri (Jira)" <ji...@apache.org> on 2019/12/27 12:22:00 UTC

[jira] [Commented] (MDEPLOY-205) MavenProject with only attachments must have packaging "pom"

    [ https://issues.apache.org/jira/browse/MDEPLOY-205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17004154#comment-17004154 ] 

Yuri commented on MDEPLOY-205:
------------------------------

What about projects that are assemblies of other dependencies? These types of projects only customize an assembly from another project and they dont have Java classes: they only produce an assembly.

Before, you could create a jar project and ignore the fact that the project produces no jar. Now, I am forced to use a pom packaging, but then the assembly <dependencies> are ignored and I cannot pull in other dependencies.

For now, we have forced version 2.8 of the plugin to make sure it still works. I guess producing a dummy jar would also work, but is there a proper solution for this?

 

> MavenProject with only attachments must have packaging "pom"
> ------------------------------------------------------------
>
>                 Key: MDEPLOY-205
>                 URL: https://issues.apache.org/jira/browse/MDEPLOY-205
>             Project: Maven Deploy Plugin
>          Issue Type: Improvement
>            Reporter: Robert Scholte
>            Assignee: Robert Scholte
>            Priority: Major
>             Fix For: 3.0.0-M1
>
>
> According to {{svn blame}} MDEPLOY-78 is responsible for this piece of code:
> {code}
> if ( isPomArtifact )
>             {
>                 deployableArtifacts.add( artifact );
>             }
>             else
>             {
>                 File file = artifact.getFile();
>                 if ( file != null && file.isFile() )
>                 {
>                     deployableArtifacts.add( artifact );
>                 }
>                 else if ( !attachedArtifacts.isEmpty() )
>                 {
>                     getLog().info( "No primary artifact to deploy, deploying attached artifacts instead." );
>                     Artifact pomArtifact =
>                         artifactFactory.createProjectArtifact( artifact.getGroupId(), artifact.getArtifactId(),
>                                                                artifact.getBaseVersion() );
>                     pomArtifact.setFile( pomFile );
>                     if ( request.isUpdateReleaseInfo() )
>                     {
>                         pomArtifact.setRelease( true );
>                     }
>                     deployableArtifacts.add( pomArtifact );
>                     // propagate the timestamped version to the main artifact for the attached artifacts to pick it up
>                     artifact.setResolvedVersion( pomArtifact.getVersion() );
>                 }
>                 else
>                 {
>                     String message = "The packaging for this project did not assign a file to the build artifact";
>                     throw new MojoExecutionException( message );
>                 }
>             }
> {code}
> I don't like the {{else if}}-clause. IMHO if there's no main artifact, the packaging should simply be 'pom'.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)