Switch to side-by-side view

--- a/pom.xml
+++ b/pom.xml
@@ -3,17 +3,19 @@
     <modelVersion>4.0.0</modelVersion>
     <groupId>net.timbusproject</groupId>
     <artifactId>tavernaextractor</artifactId>
-    <packaging>bundle</packaging>
-    <name>Simple bundle archetype</name>
+    <packaging>${packaging.type}</packaging>
+    <name>TavernaExtractor</name>
     <version>1.0-SNAPSHOT</version>
 
     <properties>
+
+        <virgo.home>C:/Users/munterberger/virgo-jetty-server-3.6.2</virgo.home>
        <!--<osgi.scope>compile</osgi.scope> --><!-- for local packaging -->
         <osgi.scope>provided</osgi.scope>
 
         <compiler.version>1.7</compiler.version>
         <!--<springframework.version>2.5.6.SEC03</springframework.version>-->
-        <springframework.version>3.1.0.RELEASE</springframework.version>
+        <springframework.version>3.2.3.RELEASE</springframework.version>
         <osgi.version>4.3.1</osgi.version>
         <maven-bundle-plugin.version>2.4.0</maven-bundle-plugin.version>
         <t2.core.version>1.4</t2.core.version>
@@ -96,42 +98,6 @@
         </dependency>
 
         <dependency>
-            <groupId>org.springframework.osgi</groupId>
-            <artifactId>spring-osgi-core</artifactId>
-            <version>1.2.1</version>
-        </dependency>
-
-        <!--
-        <dependency>
-            <groupId>org.springframework.osgi</groupId>
-            <artifactId>spring-osgi-extender</artifactId>
-            <version>1.2.1</version>
-            <scope>test</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>org.springframework.osgi</groupId>
-            <artifactId>spring-osgi-mock</artifactId>
-            <version>1.2.1</version>
-            <scope>test</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>org.springframework.osgi</groupId>
-            <artifactId>spring-osgi-test</artifactId>
-            <version>1.2.1</version>
-            <scope>test</scope>
-        </dependency>
-
-       <dependency>
-            <groupId>org.springframework</groupId>
-            <artifactId>spring-beans</artifactId>
-            <version>${springframework.version}</version>
-           <scope>${osgi.scope}</scope>
-        </dependency>
-        -->
-
-        <dependency>
             <groupId>org.springframework</groupId>
             <artifactId>spring-tx</artifactId>
             <version>${springframework.version}</version>
@@ -189,6 +155,12 @@
             <groupId>org.hibernate</groupId>
             <artifactId>hibernate-core</artifactId>
             <version>3.6.10.Final</version>
+        </dependency>
+
+        <dependency>
+            <groupId>net.timbusproject.extractors</groupId>
+            <artifactId>helpers</artifactId>
+            <version>0.1</version>
         </dependency>
 
         <dependency>
@@ -461,59 +433,9 @@
                 <configuration>
                     <source>${compiler.version}</source>
                     <target>${compiler.version}</target>
-                    <!--optional arguments: Compiler debugging options-->
                     <compilerArgument>-Xlint:all</compilerArgument>
                     <showWarnings>true</showWarnings>
                     <showDeprecation>true</showDeprecation>
-                    <!--end of optional arguments-->
-                </configuration>
-            </plugin>
-
-            <!-- for packaging as an OSGi bundle, we use the maven-bundle-plugin -->
-            <!-- see http://felix.apache.org/site/maven-bundle-plugin-bnd.html for more info -->
-            <!--generate manifest automatically once the classes are processed (crucial for OSGI bundle deployement-->
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-bundle-plugin</artifactId>
-                <extensions>true</extensions>
-                <version>${maven-bundle-plugin.version}</version>
-                <executions>
-                    <execution>
-                        <id>bundle-manifest</id>
-                        <phase>process-classes</phase>
-                        <goals>
-                            <goal>manifest</goal>
-                        </goals>
-                    </execution>
-                </executions>
-                <configuration>
-                    <manifestLocation>META-INF</manifestLocation>
-
-                    <!--
-                     <instructions>
-                        <Import-Package>!org.apache.commons.cli,*</Import-Package>
-                        <Export-Package>net.timbusproject.extractors.modules.linuxhardware.*</Export-Package>
-                        <Exclude-Resource>net/timbusproject/extractors/modules/linuxhardware/local/*</Exclude-Resource>
-                        <Bundle-ClassPath>.,{maven-dependencies}</Bundle-ClassPath>
-                    </instructions>
-                    -->
-                    <instructions>
-                        <Import-Package>
-                            net.timbusproject.extractors.core;version="[0.0,1)",
-                            org.osgi.framework;version="[1.6,2)",
-                            <!-- javax.naming,
-                            org.springframework.context.*;version="[3.0,4.0)"-->
-                        </Import-Package>
-                        <Private-Package>net.timbusproject.extractors.modules.tavernaextractor</Private-Package>
-                        <Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
-                        <Embed-Directory>OSGI-INF/lib</Embed-Directory>
-                        <Embed-Transitive>true</Embed-Transitive>
-                        <Include-Resource>src/main/resources</Include-Resource>
-                        <Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
-                        <Bundle-Name>${project.name}</Bundle-Name>
-                        <Bundle-Version>${project.version}</Bundle-Version>
-                        <Bundle-Activator>net.timbusproject.extractors.modules.tavernaextractor.Activator</Bundle-Activator>
-                    </instructions>
                 </configuration>
             </plugin>
 
@@ -522,40 +444,116 @@
                 <artifactId>virgo-maven-plugin</artifactId>
                 <version>1.0.1-SNAPSHOT</version>
                 <configuration>
-                    <virgoRoot>C:/Users/munterberger/virgo-jetty-server-3.6.2</virgoRoot>
+                    <virgoRoot>${virgo.home}</virgoRoot>
                 </configuration>
             </plugin>
 
-            <!-- assembly -->
-            <!--
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-assembly-plugin</artifactId>
-                <version>2.4</version>
-                <configuration>
-                    <archive>
-                        <manifest>
-                            <mainClass>net.timbusproject.extractors.modules.tavernaextractor.Main</mainClass>
-                        </manifest>
-                    </archive>
-                    <descriptorRefs>
-                        <descriptorRef>jar-with-dependencies</descriptorRef>
-                    </descriptorRefs>
-                </configuration>
-                <executions>
-                    <execution>
-                        <id>make-assembly</id>
-                        <phase>package</phase>
-                        <goals>
-                            <goal>single</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-            -->
-
         </plugins>
     </build>
+
+    <profiles>
+
+        <profile>
+            <id>OSGi</id>
+            <activation>
+                <activeByDefault>false</activeByDefault>
+            </activation>
+            <properties>
+                <packaging.type>bundle</packaging.type>
+                <packaging.name>TavernaExtractorOSGi</packaging.name>
+            </properties>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.felix</groupId>
+                        <artifactId>maven-bundle-plugin</artifactId>
+                        <extensions>true</extensions>
+                        <version>${maven-bundle-plugin.version}</version>
+                        <executions>
+                            <execution>
+                                <id>bundle-manifest</id>
+                                <phase>process-classes</phase>
+                                <goals>
+                                    <goal>manifest</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                        <configuration>
+                            <manifestLocation>META-INF</manifestLocation>
+
+                            <!--
+                             <instructions>
+                                <Import-Package>!org.apache.commons.cli,*</Import-Package>
+                                <Export-Package>net.timbusproject.extractors.modules.linuxhardware.*</Export-Package>
+                                <Exclude-Resource>net/timbusproject/extractors/modules/linuxhardware/local/*</Exclude-Resource>
+                                <Bundle-ClassPath>.,{maven-dependencies}</Bundle-ClassPath>
+                            </instructions>
+                            -->
+                            <instructions>
+                                <Import-Package>
+                                    net.timbusproject.extractors.core;version="[0.0,1)",
+                                    org.osgi.framework;version="[1.6,2)",
+                                    <!-- javax.naming,
+                                    org.springframework.context.*;version="[3.0,4.0)"-->
+                                </Import-Package>
+                                <Private-Package>net.timbusproject.extractors.modules.tavernaextractor</Private-Package>
+                                <Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
+                                <Embed-Directory>OSGI-INF/lib</Embed-Directory>
+                                <Embed-Transitive>true</Embed-Transitive>
+                                <Include-Resource>src/main/resources</Include-Resource>
+                                <Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
+                                <Bundle-Name>${project.name}</Bundle-Name>
+                                <Bundle-Version>${project.version}</Bundle-Version>
+                                <Bundle-Activator>net.timbusproject.extractors.modules.tavernaextractor.Activator</Bundle-Activator>
+                            </instructions>
+                            <finalName>${project.groupId}.${project.artifactId}.osgi</finalName>
+                        </configuration>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+
+        <profile>
+            <id>standalone</id>
+            <activation>
+                <activeByDefault>true</activeByDefault>
+            </activation>
+            <properties>
+                <packaging.type>jar</packaging.type>
+                <packaging.name>TavernaExtractor</packaging.name>
+            </properties>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-assembly-plugin</artifactId>
+                        <version>2.4</version>
+                        <configuration>
+                            <archive>
+                                <manifest>
+                                    <mainClass>net.timbusproject.extractors.modules.tavernaextractor.Main</mainClass>
+                                </manifest>
+                            </archive>
+                            <descriptorRefs>
+                                <descriptorRef>jar-with-dependencies</descriptorRef>
+                            </descriptorRefs>
+                            <appendAssemblyId>false</appendAssemblyId>
+                        </configuration>
+                        <executions>
+                            <execution>
+                                <id>make-assembly</id>
+                                <phase>package</phase>
+                                <goals>
+                                    <goal>single</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+
+    </profiles>
 
     <repositories>
         <repository>