felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clem...@apache.org
Subject svn commit: r1052506 - in /felix/trunk/ipojo/plugin/src/main/resources: META-INF/ META-INF/maven/ archetype-resources/ archetype-resources/src/main/java/ archetype-resources/src/main/resources/
Date Fri, 24 Dec 2010 14:01:11 GMT
Author: clement
Date: Fri Dec 24 14:01:11 2010
New Revision: 1052506

URL: http://svn.apache.org/viewvc?rev=1052506&view=rev
Log:
Fix FELIX-2744 Add annotations to the maven-ipojo-plugin archetype

Update the archetype format
Add annotation support
Provide a HelloComponent

The generated project is 'buildable' and ready to be used.

Added:
    felix/trunk/ipojo/plugin/src/main/resources/META-INF/maven/
    felix/trunk/ipojo/plugin/src/main/resources/META-INF/maven/archetype-metadata.xml
      - copied, changed from r1052264, felix/trunk/ipojo/plugin/src/main/resources/META-INF/archetype.xml
    felix/trunk/ipojo/plugin/src/main/resources/archetype-resources/bundle.properties
    felix/trunk/ipojo/plugin/src/main/resources/archetype-resources/src/main/java/HelloComponent.java
Removed:
    felix/trunk/ipojo/plugin/src/main/resources/META-INF/archetype.xml
Modified:
    felix/trunk/ipojo/plugin/src/main/resources/archetype-resources/pom.xml
    felix/trunk/ipojo/plugin/src/main/resources/archetype-resources/src/main/resources/metadata.xml

Copied: felix/trunk/ipojo/plugin/src/main/resources/META-INF/maven/archetype-metadata.xml
(from r1052264, felix/trunk/ipojo/plugin/src/main/resources/META-INF/archetype.xml)
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/plugin/src/main/resources/META-INF/maven/archetype-metadata.xml?p2=felix/trunk/ipojo/plugin/src/main/resources/META-INF/maven/archetype-metadata.xml&p1=felix/trunk/ipojo/plugin/src/main/resources/META-INF/archetype.xml&r1=1052264&r2=1052506&rev=1052506&view=diff
==============================================================================
--- felix/trunk/ipojo/plugin/src/main/resources/META-INF/archetype.xml (original)
+++ felix/trunk/ipojo/plugin/src/main/resources/META-INF/maven/archetype-metadata.xml Fri
Dec 24 14:01:11 2010
@@ -1,9 +1,25 @@
 <archetype>
-	<id>org.apache.felix.ipojo.plugin</id>
-	<sources>
-		<source>src/main/java/source.txt</source>
-	</sources>
-	<resources>
-		<resource>src/main/resources/metadata.xml</resource>
-	</resources>
+	<id>maven-ipojo-plugin</id>
+	<fileSets>
+    <fileSet filtered="true" packaged="true" encoding="UTF-8">
+      <directory>src/main/java</directory>
+      <includes>
+        <include>**/*.java</include>
+		<include>**/*.txt</include>
+      </includes>
+    </fileSet>
+	<fileSet filtered="true" encoding="UTF-8">
+      <directory>src/main/resources</directory>
+      <includes>
+        <include>**/*.xml</include>
+      </includes>
+    </fileSet>
+    <fileSet filtered="true" encoding="UTF-8">
+      <directory></directory>
+      <includes>
+        <include>*.properties</include>
+      </includes>
+    </fileSet>
+  </fileSets>
+
 </archetype>
\ No newline at end of file

Added: felix/trunk/ipojo/plugin/src/main/resources/archetype-resources/bundle.properties
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/plugin/src/main/resources/archetype-resources/bundle.properties?rev=1052506&view=auto
==============================================================================
--- felix/trunk/ipojo/plugin/src/main/resources/archetype-resources/bundle.properties (added)
+++ felix/trunk/ipojo/plugin/src/main/resources/archetype-resources/bundle.properties Fri
Dec 24 14:01:11 2010
@@ -0,0 +1,4 @@
+# Configure the created bundle
+private.packages=${package}
+import.packages=*
+export.package=*
\ No newline at end of file

Modified: felix/trunk/ipojo/plugin/src/main/resources/archetype-resources/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/plugin/src/main/resources/archetype-resources/pom.xml?rev=1052506&r1=1052505&r2=1052506&view=diff
==============================================================================
--- felix/trunk/ipojo/plugin/src/main/resources/archetype-resources/pom.xml (original)
+++ felix/trunk/ipojo/plugin/src/main/resources/archetype-resources/pom.xml Fri Dec 24 14:01:11
2010
@@ -5,21 +5,30 @@
 	<groupId>${groupId}</groupId>
 	<artifactId>${artifactId}</artifactId>
 	<version>${version}</version>
-	<name>$YOUR_PROJECT_NAME</name>
+
+	<name>${artifactId}</name>
+
+	<dependencies>
+		<dependency>
+			<groupId>org.apache.felix</groupId>
+			<artifactId>org.apache.felix.ipojo.annotations</artifactId>
+			<version>1.6.0</version>
+		</dependency>
+	</dependencies>
 
 	<build>
 		<plugins>
 			<plugin>
 				<groupId>org.apache.felix</groupId>
 				<artifactId>maven-bundle-plugin</artifactId>
-				<version>1.4.3</version>
+				<version>2.1.0</version>
 				<extensions>true</extensions>
 				<configuration>
 					<instructions>
 						<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
-						<Private-Package>YOUR_PRIVATE_PACKAGES</Private-Package>
-						<Import-Package>*</Import-Package> <!-- YOUR_IMPORTED_PACKAGES -->
-						<Export-Package>*</Export-Package> <!-- YOUR_EXPORTED_PACKAGES -->
+						<Private-Package>${private.packages}</Private-Package>
+						<Import-Package>${import.packages}</Import-Package> <!-- defined in
bundle.properties -->
+						<Export-Package>${export.packages}</Export-Package> <!-- define in bundle.properties
-->
 					</instructions>
 				</configuration>
 			</plugin>
@@ -34,6 +43,33 @@
 					</execution>
 				</executions>
 			</plugin>
+			<plugin>
+				<artifactId>maven-compiler-plugin</artifactId>
+				<version>2.3.2</version>
+				<configuration>
+					<source>1.5</source>
+					<target>1.5</target>
+				</configuration>
+			</plugin>
+			<plugin>
+				<!-- Simply read properties from file -->
+				<groupId>org.codehaus.mojo</groupId>
+				<artifactId>properties-maven-plugin</artifactId>
+				<version>1.0-alpha-2</version>
+				<executions>
+					<execution>
+						<phase>initialize</phase>
+						<goals>
+							<goal>read-project-properties</goal>
+						</goals>
+						<configuration>
+							<files>
+								<file>bundle.properties</file>
+							</files>
+						</configuration>
+					</execution>
+				</executions>
+			</plugin>
 		</plugins>
 	</build>
 </project>

Added: felix/trunk/ipojo/plugin/src/main/resources/archetype-resources/src/main/java/HelloComponent.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/plugin/src/main/resources/archetype-resources/src/main/java/HelloComponent.java?rev=1052506&view=auto
==============================================================================
--- felix/trunk/ipojo/plugin/src/main/resources/archetype-resources/src/main/java/HelloComponent.java
(added)
+++ felix/trunk/ipojo/plugin/src/main/resources/archetype-resources/src/main/java/HelloComponent.java
Fri Dec 24 14:01:11 2010
@@ -0,0 +1,14 @@
+package ${package};
+
+import org.apache.felix.ipojo.annotations.Component;
+import org.apache.felix.ipojo.annotations.Instantiate;
+
+@Component
+@Instantiate
+public class HelloComponent {
+
+	public HelloComponent() {
+		System.out.println("Hello ${artifactId}");
+	}
+
+}

Modified: felix/trunk/ipojo/plugin/src/main/resources/archetype-resources/src/main/resources/metadata.xml
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/plugin/src/main/resources/archetype-resources/src/main/resources/metadata.xml?rev=1052506&r1=1052505&r2=1052506&view=diff
==============================================================================
--- felix/trunk/ipojo/plugin/src/main/resources/archetype-resources/src/main/resources/metadata.xml
(original)
+++ felix/trunk/ipojo/plugin/src/main/resources/archetype-resources/src/main/resources/metadata.xml
Fri Dec 24 14:01:11 2010
@@ -1,8 +1,16 @@
 <ipojo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 	xsi:schemaLocation="org.apache.felix.ipojo http://felix.apache.org/ipojo/schemas/CURRENT/core.xsd"
 	xmlns="org.apache.felix.ipojo">
+	<!--
+		Declare your component types and instances here
+	-->
+
+	<!--
+
 	<component classname="$YOUR_COMPONENT_CLASS">
-   		<!-- Component type description -->
+
 	</component>
 	<instance component="$YOUR_COMPONENT_CLASS" />
+
+	-->
 </ipojo>
\ No newline at end of file



Mime
View raw message