Author: carlos Date: Mon Dec 3 08:31:13 2007 New Revision: 600588 URL: http://svn.apache.org/viewvc?rev=600588&view=rev Log: [MECLIPSE-358] Plugin installed via eclipse:install-plugins has the wrong name
Modified: maven/plugins/trunk/maven-eclipse-plugin/pom.xml maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/InstallPluginsMojo.java Modified: maven/plugins/trunk/maven-eclipse-plugin/pom.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/pom.xml?rev=600588&r1=600587&r2=600588&view=diff ============================================================================== --- maven/plugins/trunk/maven-eclipse-plugin/pom.xml (original) +++ maven/plugins/trunk/maven-eclipse-plugin/pom.xml Mon Dec 3 08:31:13 2007 @@ -176,6 +176,11 @@ <version>0.0.145</version> </dependency> <dependency> + <groupId>org.apache.maven.shared</groupId> + <artifactId>maven-osgi</artifactId> + <version>0.2.0-SNAPSHOT</version> + </dependency> + <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.2</version> Modified: maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/InstallPluginsMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/InstallPluginsMojo.java?rev=600588&r1=600587&r2=600588&view=diff ============================================================================== --- maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/InstallPluginsMojo.java (original) +++ maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/InstallPluginsMojo.java Mon Dec 3 08:31:13 2007 @@ -38,6 +38,7 @@ import org.apache.maven.project.MavenProject; import org.apache.maven.project.MavenProjectBuilder; import org.apache.maven.project.ProjectBuildingException; +import org.apache.maven.shared.osgi.Maven2OsgiConverter; import org.codehaus.plexus.archiver.ArchiverException; import org.codehaus.plexus.archiver.UnArchiver; import org.codehaus.plexus.archiver.manager.ArchiverManager; @@ -131,6 +132,11 @@ // calculated below. Value will be ${eclipseDir}/plugins. private File pluginsDir; + /** + * @component + */ + private Maven2OsgiConverter maven2OsgiConverter; + public InstallPluginsMojo() { // used for plexus init. @@ -409,14 +415,8 @@ */ private String formatEclipsePluginName( Artifact artifact, String bundleVersion ) { - if ( bundleVersion == null ) - { - return artifact.getArtifactId() + StringUtils.replace( artifact.getVersion(), "-", "." ); - } - else - { - return artifact.getArtifactId() + "_" + bundleVersion; - } + return maven2OsgiConverter.getBundleSymbolicName( artifact ) + "_" + + maven2OsgiConverter.getVersion( artifact.getVersion() ); } }