directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r697060 - /directory/studio/trunk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/StudioEclipseMojo.java
Date Fri, 19 Sep 2008 11:31:05 GMT
Author: pamarcelot
Date: Fri Sep 19 04:31:04 2008
New Revision: 697060

URL: http://svn.apache.org/viewvc?rev=697060&view=rev
Log:
Updated the Maven Studio Plugin to handle correctly the version of an artifact.
This will transform the version in a valid OSGI version.
This fix is need is we want to use snapshot version (i.e. 1.3.0-SNAPSHOT) which is not a valid
OSGI identifier (it will be renamed as 1.3.0.SNAPSHOT).

Modified:
    directory/studio/trunk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/StudioEclipseMojo.java

Modified: directory/studio/trunk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/StudioEclipseMojo.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/StudioEclipseMojo.java?rev=697060&r1=697059&r2=697060&view=diff
==============================================================================
--- directory/studio/trunk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/StudioEclipseMojo.java
(original)
+++ directory/studio/trunk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/StudioEclipseMojo.java
Fri Sep 19 04:31:04 2008
@@ -83,6 +83,11 @@
      */
     public final static String ENTRY_BUNDLE_SYMBOLICNAME = "Bundle-SymbolicName:";
 
+    /**
+     * Bundle version: updated with the project version.
+     */
+    public final static String ENTRY_BUNDLE_VERSION = "Bundle-Version:";
+
 
     public void execute() throws MojoExecutionException
     {
@@ -106,9 +111,12 @@
                 removeMavenEclipseXml();
                 removeDotExternalToolBuilders();
 
-            } catch (FileNotFoundException e)
+            }
+            catch ( FileNotFoundException e )
             {
-                getLog().error("Please run eclipse:eclipse first to create .classpath, e.g.
mvn eclipse:eclipse studio:eclipse.", e);
+                getLog().error(
+                    "Please run eclipse:eclipse first to create .classpath, e.g. mvn eclipse:eclipse
studio:eclipse.",
+                    e );
             }
             catch ( Exception e )
             {
@@ -166,8 +174,8 @@
         {
             if ( !artifact.getScope().equalsIgnoreCase( "test" ) )
             {
-                bundleClasspath.append( "," ).append( NEWLINE ).append( " " ).append( libraryPath
).append(
-                    '/' ).append( artifact.getFile().getName() );
+                bundleClasspath.append( "," ).append( NEWLINE ).append( " " ).append( libraryPath
).append( '/' )
+                    .append( artifact.getFile().getName() );
             }
         }
 
@@ -202,6 +210,14 @@
                     manifestSb.append( ";singleton:=true" );
                     manifestSb.append( NEWLINE );
                 }
+                else if ( name.equalsIgnoreCase( ENTRY_BUNDLE_VERSION ) )
+                {
+                    // get OSGI Bundle Version
+                    manifestSb.append( ENTRY_BUNDLE_VERSION );
+                    manifestSb.append( " " );
+                    manifestSb.append( maven2OsgiConverter.getVersion( project.getArtifact()
) );
+                    manifestSb.append( NEWLINE );
+                }
                 else
                 {
                     manifestSb.append( line ).append( NEWLINE );
@@ -252,16 +268,16 @@
             {
                 entry = new Xpp3Dom( "classpathentry" );
                 entry.setAttribute( "kind", "lib" );
-                entry.setAttribute( "path", ( new StringBuilder() ).append( libraryPath ).append(
'/' )
-                    .append( artifact.getFile().getName() ).toString() );
+                entry.setAttribute( "path", ( new StringBuilder() ).append( libraryPath ).append(
'/' ).append(
+                    artifact.getFile().getName() ).toString() );
             }
             else
             {
                 entry = new Xpp3Dom( "classpathentry" );
                 entry.setAttribute( "exported", "true" );
                 entry.setAttribute( "kind", "lib" );
-                entry.setAttribute( "path", ( new StringBuilder() ).append( libraryPath ).append(
'/' )
-                    .append( artifact.getFile().getName() ).toString() );
+                entry.setAttribute( "path", ( new StringBuilder() ).append( libraryPath ).append(
'/' ).append(
+                    artifact.getFile().getName() ).toString() );
             }
             dom.addChild( entry );
         }



Mime
View raw message