[ https://issues.apache.org/jira/browse/MINSTALL-18?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17965851#comment-17965851 ]
Olivier Lamy commented on MINSTALL-18: -------------------------------------- This project has moved from Jira to GitHub Issues. This issue was migrated to [apache/maven-install-plugin#185|https://github.com/apache/maven-install-plugin/issues/185]. > Bad algorithm to decide if the main artifact is to be installed or not > ---------------------------------------------------------------------- > > Key: MINSTALL-18 > URL: https://issues.apache.org/jira/browse/MINSTALL-18 > Project: Maven Install Plugin (Moved to GitHub Issues) > Issue Type: Bug > Affects Versions: 2.1 > Reporter: Vincent Massol > Assignee: Benjamin Bentmann > Priority: Major > Fix For: 2.3 > > > Here' s what's in InstallMojo's execute method: > {code} > // Here, we have a temporary solution to MINSTALL-3 > (isDirectory() is true if it went through compile > // but not package). We are designing in a proper solution > for Maven 2.1 > if ( file != null && !file.isDirectory() ) > { > installer.install( file, artifact, localRepository ); > } > else if ( !attachedArtifacts.isEmpty() ) > { > getLog().info( "No primary artifact to install, > installing attached artifacts instead." ); > } > {code} > This fails if we're building a JAR with no sources but with an attached > artifact and only the attached artifact is created (this is the case when > using the clover plugin). In that case, the install mojo tries to install the > main artifact which doesn't exist). > The error is in "!file.isDirectory". In the case of a jar with no sources, > this directory will not have been created... -- This message was sent by Atlassian Jira (v8.20.10#820010)