From c5076945cd61b3770a0f2ca89e55f389d7cdfac7 Mon Sep 17 00:00:00 2001 From: Tamas Cservenak Date: Mon, 20 Jun 2022 14:45:35 +0200 Subject: [PATCH 1/3] Drop MAT Now that Maven is 3.2.5, no need for MAT anymore. --- pom.xml | 35 +++--- .../plugins/install/AbstractInstallMojo.java | 101 +++++++++++++++--- .../plugins/install/InstallFileMojo.java | 67 ++++++------ .../maven/plugins/install/InstallMojo.java | 50 ++------- .../plugins/install/InstallFileMojoTest.java | 9 +- .../plugins/install/InstallMojoTest.java | 13 +-- 6 files changed, 157 insertions(+), 118 deletions(-) diff --git a/pom.xml b/pom.xml index 7430747..627f549 100644 --- a/pom.xml +++ b/pom.xml @@ -63,10 +63,10 @@ - 3.2.5 - 1.7.32 - 1.1.0 7 + 3.2.5 + 1.0.0.v20140518 + 1.7.5 2020-04-07T21:04:00Z @@ -97,9 +97,20 @@ provided - org.apache.maven.shared - maven-artifact-transfer - 0.13.1 + org.eclipse.aether + aether-api + ${aetherVersion} + compile + + + org.eclipse.aether + aether-util + ${aetherVersion} + compile + + + org.codehaus.plexus + plexus-utils @@ -145,18 +156,6 @@ ${slf4jVersion} test - - org.eclipse.aether - aether-api - ${aetherVersion} - test - - - org.eclipse.aether - aether-util - ${aetherVersion} - test - org.eclipse.aether aether-impl diff --git a/src/main/java/org/apache/maven/plugins/install/AbstractInstallMojo.java b/src/main/java/org/apache/maven/plugins/install/AbstractInstallMojo.java index 96d0f53..7143461 100644 --- a/src/main/java/org/apache/maven/plugins/install/AbstractInstallMojo.java +++ b/src/main/java/org/apache/maven/plugins/install/AbstractInstallMojo.java @@ -21,14 +21,22 @@ import java.io.File; +import org.apache.maven.RepositoryUtils; import org.apache.maven.artifact.Artifact; import org.apache.maven.execution.MavenSession; import org.apache.maven.plugin.AbstractMojo; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.plugins.annotations.Component; import org.apache.maven.plugins.annotations.Parameter; -import org.apache.maven.project.ProjectBuildingRequest; +import org.apache.maven.project.MavenProject; +import org.apache.maven.project.artifact.ProjectArtifact; import org.apache.maven.project.artifact.ProjectArtifactMetadata; -import org.apache.maven.shared.transfer.repository.RepositoryManager; +import org.eclipse.aether.RepositorySystem; +import org.eclipse.aether.artifact.DefaultArtifact; +import org.eclipse.aether.installation.InstallRequest; +import org.eclipse.aether.installation.InstallationException; +import org.eclipse.aether.util.artifact.SubArtifact; /** * Common fields for installation mojos. @@ -38,9 +46,8 @@ public abstract class AbstractInstallMojo extends AbstractMojo { - @Component - protected RepositoryManager repositoryManager; + protected RepositorySystem repositorySystem; @Parameter( defaultValue = "${session}", required = true, readonly = true ) protected MavenSession session; @@ -49,28 +56,98 @@ public abstract class AbstractInstallMojo * Gets the path of the specified artifact within the local repository. Note that the returned path need not exist * (yet). * - * @param buildingRequest {@link ProjectBuildingRequest}. * @param artifact The artifact whose local repo path should be determined, must not be null. * @return The absolute path to the artifact when installed, never null. */ - protected File getLocalRepoFile( ProjectBuildingRequest buildingRequest, Artifact artifact ) + protected File getLocalRepoFile( Artifact artifact ) { - String path = repositoryManager.getPathForLocalArtifact( buildingRequest, artifact ); - return new File( repositoryManager.getLocalRepositoryBasedir( buildingRequest ), path ); + String path = session.getRepositorySession().getLocalRepositoryManager() + .getPathForLocalArtifact( RepositoryUtils.toArtifact( artifact ) ); + return new File( session.getRepositorySession().getLocalRepository().getBasedir(), path ); } /** * Gets the path of the specified artifact metadata within the local repository. Note that the returned path need * not exist (yet). * - * @param buildingRequest {@link ProjectBuildingRequest}. * @param metadata The artifact metadata whose local repo path should be determined, must not be null. * @return The absolute path to the artifact metadata when installed, never null. */ - protected File getLocalRepoFile( ProjectBuildingRequest buildingRequest, ProjectArtifactMetadata metadata ) + protected File getLocalRepoFile( ProjectArtifactMetadata metadata ) { - String path = repositoryManager.getPathForLocalMetadata( buildingRequest, metadata ); - return new File( repositoryManager.getLocalRepositoryBasedir( buildingRequest ), path ); + DefaultArtifact pomArtifact = new DefaultArtifact( + metadata.getGroupId(), + metadata.getArtifactId(), + "", + "pom", + metadata.getBaseVersion() ); + + String path = session.getRepositorySession().getLocalRepositoryManager().getPathForLocalArtifact( + pomArtifact ); + return new File( session.getRepositorySession().getLocalRepository().getBasedir(), path ); } + protected void installProject( MavenProject project ) + throws MojoFailureException, MojoExecutionException + { + try + { + InstallRequest request = new InstallRequest(); + Artifact artifact = project.getArtifact(); + String packaging = project.getPackaging(); + File pomFile = project.getFile(); + boolean isPomArtifact = "pom".equals( packaging ); + + if ( pomFile != null ) + { + request.addArtifact( RepositoryUtils.toArtifact( new ProjectArtifact( project ) ) ); + } + + if ( !isPomArtifact ) + { + File file = artifact.getFile(); + + // 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.isFile() ) + { + org.eclipse.aether.artifact.Artifact mainArtifact = RepositoryUtils.toArtifact( artifact ); + request.addArtifact( mainArtifact ); + + for ( Object metadata : artifact.getMetadataList() ) + { + if ( metadata instanceof ProjectArtifactMetadata ) + { + org.eclipse.aether.artifact.Artifact pomArtifact = + new SubArtifact( mainArtifact, "", "pom" ); + pomArtifact = pomArtifact.setFile( ( (ProjectArtifactMetadata) metadata ).getFile() ); + request.addArtifact( pomArtifact ); + } + } + } + else if ( !project.getAttachedArtifacts().isEmpty() ) + { + throw new MojoExecutionException( "The packaging plugin for this project did not assign " + + "a main file to the project but it has attachments. Change packaging to 'pom'." ); + } + else + { + throw new MojoExecutionException( "The packaging for this project did not assign " + + "a file to the build artifact" ); + } + } + + for ( Artifact attached : project.getAttachedArtifacts() ) + { + getLog().debug( "Attaching for install: " + attached.getId() ); + request.addArtifact( RepositoryUtils.toArtifact( attached ) ); + } + + repositorySystem.install( session.getRepositorySession(), request ); + } + catch ( InstallationException e ) + { + throw new MojoExecutionException( e.getMessage(), e ); + } + } } diff --git a/src/main/java/org/apache/maven/plugins/install/InstallFileMojo.java b/src/main/java/org/apache/maven/plugins/install/InstallFileMojo.java index 32865b2..4ec4136 100644 --- a/src/main/java/org/apache/maven/plugins/install/InstallFileMojo.java +++ b/src/main/java/org/apache/maven/plugins/install/InstallFileMojo.java @@ -21,12 +21,12 @@ import java.io.File; import java.io.FileNotFoundException; -import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.Reader; import java.io.Writer; +import java.nio.file.Files; import java.util.Enumeration; import java.util.jar.JarEntry; import java.util.jar.JarFile; @@ -34,6 +34,7 @@ import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.handler.DefaultArtifactHandler; +import org.apache.maven.execution.MavenSession; import org.apache.maven.model.Model; import org.apache.maven.model.Parent; import org.apache.maven.model.building.ModelBuildingException; @@ -53,14 +54,15 @@ import org.apache.maven.project.ProjectBuildingException; import org.apache.maven.project.ProjectBuildingRequest; import org.apache.maven.project.artifact.ProjectArtifactMetadata; -import org.apache.maven.shared.transfer.project.install.ProjectInstaller; -import org.apache.maven.shared.transfer.project.install.ProjectInstallerRequest; -import org.apache.maven.shared.utils.Os; -import org.apache.maven.shared.utils.ReaderFactory; -import org.apache.maven.shared.utils.WriterFactory; -import org.apache.maven.shared.utils.io.IOUtil; import org.codehaus.plexus.util.FileUtils; +import org.codehaus.plexus.util.IOUtil; +import org.codehaus.plexus.util.xml.XmlStreamReader; +import org.codehaus.plexus.util.xml.XmlStreamWriter; import org.codehaus.plexus.util.xml.pull.XmlPullParserException; +import org.eclipse.aether.DefaultRepositoryCache; +import org.eclipse.aether.DefaultRepositorySystemSession; +import org.eclipse.aether.repository.LocalRepository; +import org.eclipse.aether.repository.LocalRepositoryManager; /** * Installs a file in the local repository. @@ -71,6 +73,7 @@ public class InstallFileMojo extends AbstractInstallMojo { + private static final String LINE_SEP = System.getProperty( "line.separator" ); /** * GroupId of the artifact to be installed. Retrieved from POM file if one is specified or extracted from @@ -170,19 +173,12 @@ public class InstallFileMojo @Component private ProjectBuilder projectBuilder; - /** - * Used to install the project created. - */ - @Component - private ProjectInstaller installer; - /** * @see org.apache.maven.plugin.Mojo#execute() */ public void execute() throws MojoExecutionException, MojoFailureException { - if ( !file.exists() ) { String message = "The specified file '" + file.getPath() + "' does not exist"; @@ -190,16 +186,24 @@ public void execute() throw new MojoFailureException( message ); } - ProjectBuildingRequest buildingRequest = session.getProjectBuildingRequest(); - - // ---------------------------------------------------------------------- - // Override the default localRepository variable - // ---------------------------------------------------------------------- if ( localRepositoryPath != null ) { - buildingRequest = repositoryManager.setLocalRepositoryBasedir( buildingRequest, localRepositoryPath ); - - getLog().debug( "localRepoPath: " + repositoryManager.getLocalRepositoryBasedir( buildingRequest ) ); + // "clone" session and replace localRepository + DefaultRepositorySystemSession newSession = new DefaultRepositorySystemSession( + session.getRepositorySession() ); + // Clear cache, since we're using a new local repository + newSession.setCache( new DefaultRepositoryCache() ); + // keep same repositoryType + String contentType = newSession.getLocalRepository().getContentType(); + if ( "enhanced".equals( contentType ) ) + { + contentType = "default"; + } + LocalRepositoryManager localRepositoryManager = repositorySystem.newLocalRepositoryManager( newSession, + new LocalRepository( localRepositoryPath, contentType ) ); + newSession.setLocalRepositoryManager( localRepositoryManager ); + this.session = new MavenSession( + session.getContainer(), newSession, session.getRequest(), session.getResult() ); } File temporaryPom = null; @@ -225,7 +229,7 @@ public void execute() project.getArtifact().setArtifactHandler( ah ); Artifact artifact = project.getArtifact(); - if ( file.equals( getLocalRepoFile( buildingRequest, artifact ) ) ) + if ( file.equals( getLocalRepoFile( artifact ) ) ) { throw new MojoFailureException( "Cannot install artifact. " + "Artifact is already in the local repository.\n\nFile in question is: " + file + "\n" ); @@ -262,7 +266,7 @@ public void execute() temporaryPom = generatePomFile(); ProjectArtifactMetadata pomMetadata = new ProjectArtifactMetadata( artifact, temporaryPom ); if ( Boolean.TRUE.equals( generatePom ) - || ( generatePom == null && !getLocalRepoFile( buildingRequest, pomMetadata ).exists() ) ) + || ( generatePom == null && !getLocalRepoFile( pomMetadata ).exists() ) ) { getLog().debug( "Installing generated POM" ); if ( classifier == null ) @@ -293,12 +297,7 @@ else if ( generatePom == null ) try { - // CHECKSTYLE_OFF: LineLength - ProjectInstallerRequest projectInstallerRequest = - new ProjectInstallerRequest().setProject( project ); - // CHECKSTYLE_ON: LineLength - - installer.install( buildingRequest, projectInstallerRequest ); + installProject( project ); } catch ( Exception e ) { @@ -344,7 +343,7 @@ private MavenProject createMavenProject() { if ( e.getCause() instanceof ModelBuildingException ) { - throw new MojoExecutionException( "The artifact information is not valid:" + Os.LINE_SEP + throw new MojoExecutionException( "The artifact information is not valid:" + LINE_SEP + e.getCause().getMessage() ); } throw new MojoFailureException( "Unable to create the project.", e ); @@ -387,7 +386,7 @@ private File readingPomFromJarFile() } pomFile = File.createTempFile( base, ".pom" ); - pomOutputStream = new FileOutputStream( pomFile ); + pomOutputStream = Files.newOutputStream( pomFile.toPath() ); IOUtil.copy( pomInputStream, pomOutputStream ); @@ -448,7 +447,7 @@ private Model readModel( File pomFile ) Reader reader = null; try { - reader = ReaderFactory.newXmlReader( pomFile ); + reader = new XmlStreamReader( pomFile ); final Model model = new MavenXpp3Reader().read( reader ); reader.close(); reader = null; @@ -545,7 +544,7 @@ private File generatePomFile() { File pomFile = File.createTempFile( "mvninstall", ".pom" ); - writer = WriterFactory.newXmlWriter( pomFile ); + writer = new XmlStreamWriter( pomFile ); new MavenXpp3Writer().write( writer, model ); writer.close(); writer = null; diff --git a/src/main/java/org/apache/maven/plugins/install/InstallMojo.java b/src/main/java/org/apache/maven/plugins/install/InstallMojo.java index b01c114..3e3463b 100644 --- a/src/main/java/org/apache/maven/plugins/install/InstallMojo.java +++ b/src/main/java/org/apache/maven/plugins/install/InstallMojo.java @@ -19,7 +19,6 @@ * under the License. */ -import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -27,16 +26,10 @@ import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; -import org.apache.maven.plugins.annotations.Component; import org.apache.maven.plugins.annotations.LifecyclePhase; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.project.MavenProject; -import org.apache.maven.project.ProjectBuildingRequest; -import org.apache.maven.shared.transfer.artifact.install.ArtifactInstallerException; -import org.apache.maven.shared.transfer.project.NoFileAssignedException; -import org.apache.maven.shared.transfer.project.install.ProjectInstaller; -import org.apache.maven.shared.transfer.project.install.ProjectInstallerRequest; /** * Installs the project's main artifact, and any other artifacts attached by other plugins in the lifecycle, to the @@ -55,8 +48,8 @@ public class InstallMojo */ private static final AtomicInteger READYPROJECTSCOUNTER = new AtomicInteger(); - private static final List INSTALLREQUESTS = - Collections.synchronizedList( new ArrayList() ); + private static final List INSTALLREQUESTS = + Collections.synchronizedList( new ArrayList() ); /** */ @@ -85,9 +78,6 @@ public class InstallMojo @Parameter( property = "maven.install.skip", defaultValue = "false" ) private boolean skip; - @Component - private ProjectInstaller installer; - public void execute() throws MojoExecutionException, MojoFailureException { @@ -98,18 +88,13 @@ public void execute() } else { - // CHECKSTYLE_OFF: LineLength - ProjectInstallerRequest projectInstallerRequest = - new ProjectInstallerRequest().setProject( project ); - // CHECKSTYLE_ON: LineLength - if ( !installAtEnd ) { - installProject( session.getProjectBuildingRequest(), projectInstallerRequest ); + installProject( project ); } else { - INSTALLREQUESTS.add( projectInstallerRequest ); + INSTALLREQUESTS.add( project ); addedInstallRequest = true; } } @@ -121,7 +106,7 @@ public void execute() { while ( !INSTALLREQUESTS.isEmpty() ) { - installProject( session.getProjectBuildingRequest(), INSTALLREQUESTS.remove( 0 ) ); + installProject( INSTALLREQUESTS.remove( 0 ) ); } } } @@ -132,28 +117,9 @@ else if ( addedInstallRequest ) } } - private void installProject( ProjectBuildingRequest pbr, ProjectInstallerRequest pir ) - throws MojoFailureException, MojoExecutionException - { - try - { - installer.install( session.getProjectBuildingRequest(), pir ); - } - catch ( IOException e ) - { - throw new MojoFailureException( "IOException", e ); - } - catch ( ArtifactInstallerException e ) - { - throw new MojoExecutionException( "ArtifactInstallerException", e ); - } - catch ( NoFileAssignedException e ) - { - throw new MojoExecutionException( "NoFileAssignedException", e ); - } - - } - + /** + * Visible for testing. + */ public void setSkip( boolean skip ) { this.skip = skip; diff --git a/src/test/java/org/apache/maven/plugins/install/InstallFileMojoTest.java b/src/test/java/org/apache/maven/plugins/install/InstallFileMojoTest.java index bf040b1..c135d95 100644 --- a/src/test/java/org/apache/maven/plugins/install/InstallFileMojoTest.java +++ b/src/test/java/org/apache/maven/plugins/install/InstallFileMojoTest.java @@ -28,8 +28,8 @@ import org.apache.maven.plugin.testing.AbstractMojoTestCase; import org.apache.maven.project.DefaultProjectBuildingRequest; import org.apache.maven.project.ProjectBuildingRequest; -import org.apache.maven.shared.utils.ReaderFactory; -import org.apache.maven.shared.utils.io.FileUtils; +import org.codehaus.plexus.util.FileUtils; +import org.codehaus.plexus.util.xml.XmlStreamReader; import org.eclipse.aether.DefaultRepositorySystemSession; import org.eclipse.aether.internal.impl.EnhancedLocalRepositoryManagerFactory; import org.eclipse.aether.repository.LocalRepository; @@ -159,7 +159,7 @@ public void testInstallFileWithGeneratePom() File installedPom = new File( getBasedir(), LOCAL_REPO + groupId + "/" + artifactId + "/" + version + "/" + artifactId + "-" + version + "." + "pom" ); - try ( Reader reader = ReaderFactory.newXmlReader( installedPom ) ) { + try ( Reader reader = new XmlStreamReader( installedPom ) ) { Model model = new MavenXpp3Reader().read( reader ); assertEquals( "4.0.0", model.getModelVersion() ); @@ -258,7 +258,7 @@ public void testInstallFile() assertTrue( installedArtifact.exists() ); - assertEquals( 5, FileUtils.getFiles( new File( LOCAL_REPO ), null, null ).size() ); + assertEquals( FileUtils.getFiles( new File( LOCAL_REPO ), null, null ).toString(), 5, FileUtils.getFiles( new File( LOCAL_REPO ), null, null ).size() ); } private void assignValuesForParameter( Object obj ) @@ -294,6 +294,7 @@ repositorySession, new LocalRepository( LOCAL_REPO ) ProjectBuildingRequest buildingRequest = new DefaultProjectBuildingRequest(); buildingRequest.setRepositorySession( repositorySession ); when( session.getProjectBuildingRequest() ).thenReturn( buildingRequest ); + when( session.getRepositorySession() ).thenReturn( repositorySession ); return session; } } diff --git a/src/test/java/org/apache/maven/plugins/install/InstallMojoTest.java b/src/test/java/org/apache/maven/plugins/install/InstallMojoTest.java index ed73d2c..374872a 100644 --- a/src/test/java/org/apache/maven/plugins/install/InstallMojoTest.java +++ b/src/test/java/org/apache/maven/plugins/install/InstallMojoTest.java @@ -26,6 +26,7 @@ import java.util.Collections; import java.util.List; +import org.apache.maven.RepositoryUtils; import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.metadata.ArtifactMetadata; import org.apache.maven.execution.MavenSession; @@ -36,9 +37,9 @@ import org.apache.maven.project.DefaultProjectBuildingRequest; import org.apache.maven.project.MavenProject; import org.apache.maven.project.ProjectBuildingRequest; -import org.apache.maven.shared.transfer.repository.RepositoryManager; -import org.apache.maven.shared.utils.io.FileUtils; +import org.codehaus.plexus.util.FileUtils; import org.eclipse.aether.DefaultRepositorySystemSession; +import org.eclipse.aether.artifact.DefaultArtifact; import org.eclipse.aether.internal.impl.EnhancedLocalRepositoryManagerFactory; import org.eclipse.aether.repository.LocalRepository; import org.eclipse.aether.repository.NoLocalRepositoryManagerException; @@ -279,12 +280,7 @@ public void testBasicInstallAndCreate() } } - RepositoryManager repoManager = (RepositoryManager) getVariableValueFromObject( mojo, "repositoryManager" ); - - ProjectBuildingRequest pbr = mavenSession.getProjectBuildingRequest(); - - File pom = new File( repoManager.getLocalRepositoryBasedir( pbr ), - repoManager.getPathForLocalMetadata( pbr, metadata ) ); + File pom = new File( new File( LOCAL_REPO ), mavenSession.getRepositorySession().getLocalRepositoryManager().getPathForLocalArtifact( new DefaultArtifact( artifact.getGroupId(), artifact.getArtifactId(), "pom", artifact.getVersion() ) ) ); assertTrue( pom.exists() ); @@ -357,6 +353,7 @@ repositorySession, new LocalRepository( LOCAL_REPO ) ProjectBuildingRequest buildingRequest = new DefaultProjectBuildingRequest(); buildingRequest.setRepositorySession( repositorySession ); when( session.getProjectBuildingRequest() ).thenReturn( buildingRequest ); + when( session.getRepositorySession() ).thenReturn( repositorySession ); return session; } From c24e909196b738b9701cd484afeb1621f9200e66 Mon Sep 17 00:00:00 2001 From: Tamas Cservenak Date: Mon, 20 Jun 2022 14:55:24 +0200 Subject: [PATCH 2/3] Fix scopes --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 627f549..e556d80 100644 --- a/pom.xml +++ b/pom.xml @@ -100,13 +100,13 @@ org.eclipse.aether aether-api ${aetherVersion} - compile + provided org.eclipse.aether aether-util ${aetherVersion} - compile + compile org.codehaus.plexus From 51bc6fc5b8e607aaa75176049c1c915a50adb254 Mon Sep 17 00:00:00 2001 From: Tamas Cservenak Date: Tue, 5 Jul 2022 11:26:37 +0200 Subject: [PATCH 3/3] Clean up use of LS --- .../org/apache/maven/plugins/install/InstallFileMojo.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/apache/maven/plugins/install/InstallFileMojo.java b/src/main/java/org/apache/maven/plugins/install/InstallFileMojo.java index 4ec4136..c6d527d 100644 --- a/src/main/java/org/apache/maven/plugins/install/InstallFileMojo.java +++ b/src/main/java/org/apache/maven/plugins/install/InstallFileMojo.java @@ -73,7 +73,7 @@ public class InstallFileMojo extends AbstractInstallMojo { - private static final String LINE_SEP = System.getProperty( "line.separator" ); + private static final String LS = System.getProperty( "line.separator" ); /** * GroupId of the artifact to be installed. Retrieved from POM file if one is specified or extracted from @@ -188,7 +188,7 @@ public void execute() if ( localRepositoryPath != null ) { - // "clone" session and replace localRepository + // "clone" repository session and replace localRepository DefaultRepositorySystemSession newSession = new DefaultRepositorySystemSession( session.getRepositorySession() ); // Clear cache, since we're using a new local repository @@ -232,7 +232,7 @@ public void execute() if ( file.equals( getLocalRepoFile( artifact ) ) ) { throw new MojoFailureException( "Cannot install artifact. " - + "Artifact is already in the local repository.\n\nFile in question is: " + file + "\n" ); + + "Artifact is already in the local repository." + LS + LS + "File in question is: " + file + LS ); } if ( classifier == null ) @@ -343,7 +343,7 @@ private MavenProject createMavenProject() { if ( e.getCause() instanceof ModelBuildingException ) { - throw new MojoExecutionException( "The artifact information is not valid:" + LINE_SEP + throw new MojoExecutionException( "The artifact information is not valid:" + LS + e.getCause().getMessage() ); } throw new MojoFailureException( "Unable to create the project.", e );