Mojo

If your module creates no artifact then osxbundle mojo fails with NullPointerException

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: osxappbundle
  • Labels:
    None
  • Complexity:
    Intermediate
  • Number of attachments :
    1

Description

My pom doesn't create an artifact, just brings together a few dependencies and creates a few installers. It has no java source and does not produce an artifact.

try
{
    FileUtils.copyFile( artifactFile, new File(repoDirectory, layout.pathOf(project.getArtifact())) );
}
catch ( IOException e )
{
    throw new MojoExecutionException( "Could not copy artifact file " + artifactFile + " to " + javaDirectory );
}

Throws a NPE inside FileUtils, because artifactFile is null.

Protecting it with

if(artifactFile!=null)
allows the plugin to continue and creates a workable .dmg.

Activity

Hide
Matthew Jensen added a comment -

Patch to not copy artifactFile if there isn't one.

Show
Matthew Jensen added a comment - Patch to not copy artifactFile if there isn't one.
Hide
Eirik Bjørsnøs added a comment -
Show
Eirik Bjørsnøs added a comment - Thanks Matthew. Patch applied in http://svnsearch.org/svnsearch/repos/MOJO/search?revision=11961

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: