Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

o using the new plugin API

  • Loading branch information...
commit d962c5b5b89212dbf860588c8cfa5422bdae493f 1 parent 53feb72
authored June 24, 2011
2  convert.sh
... ...
@@ -1,3 +1,3 @@
1 1
 #!/bin/sh
2 2
 dir=`pwd`
3  
-mvn io.jvz.maven.plugins:m4e-maven-plugin:e2m -DeclipseInstallation=/Users/jvanzyl/eclipse/eclipse-xtext -DmavenRepository=$dir/mavenRepo -e
  3
+mvn io.jvz.maven.plugins:m4e-maven-plugin:e2m -DeclipseInstallation=/Users/jvanzyl/eclipse/eclipse-xtext -DmavenRepository=$dir/mavenRepo -e 
62  pom.xml
@@ -9,7 +9,7 @@
9 9
   <groupId>io.jvz.maven.plugins</groupId>
10 10
   <artifactId>m4e-maven-plugin</artifactId>
11 11
   <version>0.0.1-SNAPSHOT</version>
12  
-  <packaging>maven-plugin</packaging>
  12
+  <packaging>tesla-plugin</packaging>
13 13
 
14 14
   <properties>
15 15
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -17,9 +17,9 @@
17 17
 
18 18
   <dependencies>
19 19
     <dependency>
20  
-      <groupId>org.apache.maven</groupId>
21  
-      <artifactId>maven-plugin-api</artifactId>
22  
-      <version>3.0.3</version>
  20
+      <groupId>org.eclipse.tesla.plugin</groupId>
  21
+      <artifactId>tesla-plugin-api</artifactId>
  22
+      <version>0.0.1-SNAPSHOT</version>
23 23
     </dependency>
24 24
     <dependency>
25 25
       <groupId>org.eclipse.tycho</groupId>
@@ -31,8 +31,12 @@
31 31
       <artifactId>plexus-utils</artifactId>
32 32
       <version>2.0.7</version>
33 33
     </dependency>
34  
-    <!-- | | Logging: we want to be able to @Inject SLF4J loggers but all we want is the API. During runtime the client should select the implementation 
35  
-      they wish | to use | -->
  34
+    <!-- 
  35
+     | 
  36
+     | Logging: we want to be able to @Inject SLF4J loggers but all we want is the API. During runtime the client should select the 
  37
+     | implementation they wish to use.
  38
+     | 
  39
+     -->
36 40
     <dependency>
37 41
       <groupId>org.slf4j</groupId>
38 42
       <artifactId>slf4j-api</artifactId>
@@ -45,7 +49,7 @@
45 49
       <version>1</version>
46 50
       <scope>provided</scope>
47 51
     </dependency>
48  
-    <!-- | | Testing | -->
  52
+    <!-- Testing -->
49 53
     <dependency>
50 54
       <groupId>org.sonatype.sisu</groupId>
51 55
       <artifactId>sisu-inject-bean</artifactId>
@@ -65,48 +69,4 @@
65 69
       <scope>test</scope>
66 70
     </dependency>
67 71
   </dependencies>
68  
-  <build>
69  
-    <plugins>
70  
-      <plugin>
71  
-        <groupId>org.sonatype.plugins</groupId>
72  
-        <artifactId>sisu-maven-plugin</artifactId>
73  
-        <version>1.1</version>
74  
-        <executions>
75  
-          <execution>
76  
-            <goals>
77  
-              <goal>main-index</goal>
78  
-            </goals>
79  
-          </execution>
80  
-        </executions>
81  
-      </plugin>      
82  
-    </plugins>
83  
-    <pluginManagement>
84  
-      <plugins>
85  
-        <plugin>
86  
-          <groupId>org.eclipse.m2e</groupId>
87  
-          <artifactId>lifecycle-mapping</artifactId>
88  
-          <version>1.0.0</version>
89  
-          <configuration>
90  
-            <lifecycleMappingMetadata>
91  
-              <pluginExecutions>
92  
-                <pluginExecution>
93  
-                  <pluginExecutionFilter>
94  
-                    <groupId>org.sonatype.plugins</groupId>
95  
-                    <artifactId>sisu-maven-plugin</artifactId>
96  
-                    <versionRange>[1.1,)</versionRange>
97  
-                    <goals>
98  
-                      <goal>main-index</goal>
99  
-                    </goals>
100  
-                  </pluginExecutionFilter>
101  
-                  <action>
102  
-                    <ignore></ignore>
103  
-                  </action>
104  
-                </pluginExecution>
105  
-              </pluginExecutions>
106  
-            </lifecycleMappingMetadata>
107  
-          </configuration>
108  
-        </plugin>
109  
-      </plugins>
110  
-    </pluginManagement>
111  
-  </build>
112 72
 </project>
17  src/main/java/io/jvz/maven/plugins/EclipseInstallationToMavenRepositoryMojo.java
@@ -20,11 +20,17 @@
20 20
 import org.apache.maven.plugin.MojoFailureException;
21 21
 import org.osgi.framework.BundleException;
22 22
 import org.slf4j.Logger;
  23
+import org.sonatype.maven.plugin.Configuration;
  24
+import org.sonatype.maven.plugin.Goal;
  25
+import org.sonatype.maven.plugin.Property;
  26
+import org.sonatype.maven.plugin.RequiresProject;
23 27
 
24 28
 /**
25 29
  * @goal e2m
26 30
  * @requiresProject false
27 31
  */
  32
+@Goal( "e2m" )
  33
+@RequiresProject(false)
28 34
 @Named("e2m")
29 35
 public class EclipseInstallationToMavenRepositoryMojo extends AbstractMojo {
30 36
 
@@ -34,14 +40,12 @@
34 40
   @Inject
35 41
   private EclipseInstallationToMavenRepositoryConverter converter;
36 42
 
37  
-  /**
38  
-   * @parameter expression="${eclipseInstallation}"
39  
-   */
  43
+  @Configuration
  44
+  @Property("eclipseInstallation")
40 45
   private File eclipseInstallation;
41 46
 
42  
-  /**
43  
-   * @parameter expression="${mavenRepository}"
44  
-   */
  47
+  @Configuration
  48
+  @Property("mavenRepository")
45 49
   private File mavenRepository;
46 50
 
47 51
   public void execute() throws MojoExecutionException, MojoFailureException {
@@ -51,6 +55,7 @@ public void execute() throws MojoExecutionException, MojoFailureException {
51 55
     try {
52 56
       converter.convert(eclipseInstallation, mavenRepository);
53 57
     } catch (BundleException e) {
  58
+      e.printStackTrace();
54 59
       throw new MojoExecutionException(e.getMessage());
55 60
     }
56 61
   }

0 notes on commit d962c5b

Please sign in to comment.
Something went wrong with that request. Please try again.