maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Scholte (JIRA)" <j...@apache.org>
Subject [jira] [Closed] (MDEPLOY-205) MavenProject with only attachments must have packaging "pom"
Date Tue, 12 Jan 2016 21:22:39 GMT

     [ https://issues.apache.org/jira/browse/MDEPLOY-205?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Robert Scholte closed MDEPLOY-205.
----------------------------------
    Resolution: Fixed

Fixed in [r1724326|http://svn.apache.org/r1724326]

> 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
>             Fix For: 3.0
>
>
> 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
(v6.3.4#6332)

Mime
View raw message