
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<parent>
		<groupId>org.cogchar</groupId>
		<artifactId>org.cogchar.project.root</artifactId>
		<version>1.0.9.1</version>
		<relativePath>../../pom.xml</relativePath>
	</parent>  
	
	<artifactId>org.cogchar.modules.main</artifactId>

	<packaging>pom</packaging>
	<name>${project.artifactId} - "Main Modules" parent pom</name>
	<description>All libraries and OSGi bundles - everything EXCEPT nbui projects</description>
	<repositories>
			<!-- Previously Used for JScience and Javolution -->
			<!--
		<repository>
		
			<id>maven.java.net-SNAP</id>
			<name>maven.java.net SNAPSHOTS Repo</name>
			<url>https://maven.java.net/content/repositories/snapshots/</url>
		</repository>		
		-->
		<repository>
			<id>sonatype-public</id>
			<name>sonatype public</name>
			<url>https://oss.sonatype.org/content/groups/public/</url>
		</repository>
		<!-- Needed for "good" log4J bundle (for org.cogchar.bundle.bind.lift) -->
		<repository>
			<id>com.springsource.repository.bundles.external</id>
			<name>Spring EBR External Release Repository</name>
			<url>http://repository.springsource.com/maven/bundles/external</url>
		</repository>

	</repositories>

	
	<modules>	
		<module>../ext.bundle.ops4j.pax.web</module>
		<module>../ext.bundle.fuseki</module>
		<module>../ext.bundle.lift</module>
		
		<module>../org.cogchar.bundle.demo.all</module>
		<!-- Stu configging for "all new puma" build -->
		<module>../org.cogchar.bundle.app.new.puma</module>
        <module>../org.cogchar.bundle.app.vworld.startup</module>
		
		<module>../org.cogchar.bundle.core</module>		
		<module>../org.cogchar.bundle.bind.mechio</module>
		<module>../org.cogchar.bundle.bind.cogbot</module>
		<module>../org.cogchar.bundle.bind.lift</module>
		<module>../org.cogchar.bundle.bind.joseki</module>

		<module>../org.cogchar.bundle.temp.wire</module>

		<module>../org.cogchar.bundle.demo.convo</module>
		<module>../org.cogchar.bundle.demo.dictation</module>
		
		<module>../org.cogchar.lib.onto</module>
		<module>../org.cogchar.lib.core.api</module>
		<module>../org.cogchar.lib.core.impl</module>
		
		<!-- These modules will stay in Cogchar.org permanently. -->
		<module>../org.cogchar.lib.vworld.api</module>
		<module>../org.cogchar.lib.sight.api</module>
		<!-- Proposed:  
		Each other major plugin project gets one API lib in Cogchar.
		However, the code in these APIs should be minimized, in favor of ontology binding 
		through repo-based mechanisms.
		
		The 3 major plugins are currently defined to be
				o.c.l.vworld.api - for Hedspc
				o.c.l.?.api - for Storychat
				o.c.l.sight.api - for Freckler
				
		In contrast, MechIO.org does not have such a plugin, because
		Cogchar actually functions as a plugin to TinkerBot, and wrapper around it.
		-->

		
		<module>../org.cogchar.lib.animoid</module>
		<module>../org.cogchar.lib.convoid</module>
		<module>../org.cogchar.lib.integroid</module>		

		
		<module>../org.cogchar.lib.sonograph</module>
		
		<module>../org.cogchar.lib.outer.behavior</module>
		
		
	<!-- ********************************************************************************
			These 9 modules will move to HeDSpc.org before the release of Cogchar 1.1.0 
	*************************************************************************************
	-->
		<module>../org.cogchar.lib.render.impl</module>
		<module>../org.cogchar.lib.render.bony</module>
		<module>../org.cogchar.lib.render.goody</module>
		<module>../org.cogchar.lib.render.hominoid</module>
		
		<module>../org.cogchar.bundle.render.opengl</module>
		<module>../org.cogchar.bundle.render.resources</module>
		
			<!-- Extra tests and demos, can dissolve into "Test Packages" of the libs -->
			<module>../org.cogchar.demo.render.opengl</module>
				
		<!-- OSGi + Maven wrappers for JME3 + Nifty -->
		<module>../ext.bundle.opengl.jmonkey</module>
		<module>../ext.bundle.opengl.nifty</module>
		<!-- End of modules that are moving to HeDSpc.org -->		

	</modules>
	
	<!-- ***********************************************************************************
	****************************************************************************************
		DO NOT EDIT WITHOUT MAVEN+FELIX SAVVY:  SHARED FELIX LAUNCHER PROFILES 
		This single bundle-launch profile is available to all subprojects. 
		TODO: allow for per-project vmargs customization using properties.
	-->
	<profiles>
		<profile>
			<id>build-for-felix</id>
			<dependencies>
				<dependency>
					<groupId>org.apache.felix</groupId>
					<artifactId>org.apache.felix.main</artifactId>
					<version>4.2.1</version>
					<scope>provided</scope>
				</dependency>
                <!-- To include a shell:
                <dependency>
                    <groupId>org.apache.felix</groupId>
                    <artifactId>org.apache.felix.gogo.shell</artifactId>
                    <version>0.6.1</version>
                </dependency>
                -->
			</dependencies>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-antrun-plugin</artifactId>
						<version>1.6</version>
						<executions>
							<execution>
								<id>compile</id>
								<phase>package</phase>
								<goals>
									<goal>run</goal>
								</goals>
								<configuration>
									<target>
										<pathconvert property="plugins.jars" pathsep="${path.separator}">
											<path refid="maven.runtime.classpath" />
											<map from="${project.build.directory}${file.separator}classes" to="" />
										</pathconvert>
										<pathconvert pathsep=" " property="bundles">
											<path path="${plugins.jars}" />
											<mapper>
												<chainedmapper>
													<flattenmapper />
													<globmapper from="*" to="file:modules/*" casesensitive="no" />
												</chainedmapper>
											</mapper>
										</pathconvert>
										<propertyfile file="${project.build.directory}/config.properties">
											<entry key="felix.auto.start" value="${bundles} file:modules/${project.build.finalName}.jar" />
											<entry key="org.osgi.framework.bootdelegation" value="*" />
										</propertyfile>
										<copy file="${maven.dependency.org.apache.felix.org.apache.felix.main.jar.path}" tofile="${project.build.directory}/felix.jar" />
									</target>
								</configuration>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-assembly-plugin</artifactId>
						<version>2.2</version>
						<executions>
							<execution>
								<id>create-executable-jar</id>
								<phase>package</phase>
								<goals>
									<goal>single</goal>
								</goals>
								<configuration>
									<descriptors>
										<descriptor>${basedir}/src/main/assembly/felix.xml</descriptor>
									</descriptors>
									<finalName>${project.build.finalName}</finalName>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>run-on-felix</id>
			<dependencies>
				<dependency>
					<groupId>org.apache.felix</groupId>
					<artifactId>org.apache.felix.main</artifactId>
					<version>4.2.1</version>
					<scope>provided</scope>
				</dependency>
                <!-- org.apache.felix:org.apache.felix.gogo.shell:0.6.1 useless from Maven since stdin is swallowed -->
			</dependencies>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-antrun-plugin</artifactId>
						<version>1.6</version>
						<configuration>
							<target>
								<property name="vm.args" value="" />
								<pathconvert property="plugins.jars" pathsep="${path.separator}">
									<path refid="maven.runtime.classpath" />
									<map from="${project.build.directory}${file.separator}classes" to="" />
								</pathconvert>
								<makeurl property="urls" separator=" ">
									<path path="${plugins.jars}" />
									<path location="${project.build.directory}/${project.build.finalName}.jar" />
								</makeurl>
								<propertyfile file="${project.build.directory}/run.properties">
									<entry key="felix.auto.start" value="${urls}" />
									<entry key="felix.auto.deploy.action" value="uninstall,install,update,start" />
									<entry key="org.osgi.framework.storage" value="${project.build.directory}${file.separator}felix-cache" />
									<entry key="org.osgi.framework.bootdelegation" value="*" />
                                    <!-- org.w3c.dom.* are missing from default.properties in felix 4.2.1, they are present in 3.0.7 -->
									<entry key="org.osgi.framework.system.packages.extra" value="sun.misc, org.w3c.dom.css, org.w3c.dom.html, org.w3c.dom.stylesheets, org.w3c.dom.traversal, org.w3c.dom.ranges, org.w3c.dom.views, org.w3c.dom.xpath" />
								</propertyfile>
								<makeurl property="run.properties.url" file="${project.build.directory}/run.properties" />
								<java fork="true" jar="${maven.dependency.org.apache.felix.org.apache.felix.main.jar.path}">
									<sysproperty key="felix.config.properties" value="${run.properties.url}" />
									<jvmarg line="${vm.args}" />
								</java>
							</target>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>	
</project>
