Uploaded image for project: 'Maven Deploy Plugin'
  1. Maven Deploy Plugin
  2. MDEPLOY-205

MavenProject with only attachments must have packaging "pom"

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0.0-M1
    • Component/s: None
    • Labels:
      None

      Description

      According to svn blame MDEPLOY-78 is responsible for this piece of 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 );
                      }
                  }
      

      I don't like the else if-clause. IMHO if there's no main artifact, the packaging should simply be 'pom'.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                rfscholte Robert Scholte
                Reporter:
                rfscholte Robert Scholte
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: