Commits

Vineet Reynolds committed 4a5f478

Modified the project POMs to use Maven properties instead of machine-dependent values.

Comments (0)

Files changed (4)

galleria-ear/pom.xml

 				<artifactId>maven-glassfish-plugin</artifactId>
 				<version>2.1</version>
 				<configuration>
-					<user>admin</user>
-					<passwordFile>C:/glassfish3/glassfish/domains/production-domain/config/local-password</passwordFile>
-					<glassfishDirectory>C:/glassfish3/glassfish/</glassfishDirectory>
+					<user>${galleria.glassfish.productionDomain.user}</user>
+					<passwordFile>${galleria.glassfish.productionDomain.passwordFile}</passwordFile>
+					<glassfishDirectory>${galleria.glassfish.productionDomain.glassfishDirectory}</glassfishDirectory>
 					<components>
 						<component>
 							<name>${project.artifactId}</name>
 						</component>
 					</components>
 					<domain>
-						<name>production-domain</name>
-						<adminPort>9048</adminPort>
-						<httpPort>9080</httpPort>
-						<httpsPort>9081</httpsPort>
+						<name>${galleria.glassfish.productionDomain.domainName}</name>
+						<adminPort>${galleria.glassfish.productionDomain.adminPort}</adminPort>
+						<httpPort>${galleria.glassfish.productionDomain.httpPort}</httpPort>
+						<httpsPort>${galleria.glassfish.productionDomain.httpsPort}</httpsPort>
 					</domain>
 					<debug>true</debug>
 					<echo>true</echo>
 			<url>http://download.java.net/maven/2</url>
 		</pluginRepository>
 	</pluginRepositories>
-	<profiles>
-		<profile>
-			<id>remote-debug</id>
-			<build>
-				<plugins>
-					<plugin>
-						<groupId>org.glassfish.maven.plugin</groupId>
-						<artifactId>maven-glassfish-plugin</artifactId>
-						<version>2.1</version>
-						<configuration>
-							<user>admin</user>
-							<passwordFile>C:/glassfish3/glassfish/domains/production-domain/config/local-password</passwordFile>
-							<glassfishDirectory>C:/glassfish3/glassfish/</glassfishDirectory>
-							<components>
-								<component>
-									<name>${project.artifactId}</name>
-									<artifact>${project.build.directory}/${project.build.finalName}.ear</artifact>
-								</component>
-							</components>
-							<domain>
-								<name>production-domain</name>
-								<adminPort>9048</adminPort>
-								<httpPort>9080</httpPort>
-								<httpsPort>9081</httpsPort>
-								<jvmOptions>
-		                            <option>-Xdebug</option>
-		                        </jvmOptions>
-							</domain>
-							<debug>true</debug>
-							<echo>true</echo>
-							<terse>false</terse>
-							<autoCreate>false</autoCreate>
-						</configuration>
-					</plugin>
-				</plugins>
-			</build>
-		</profile>
-	</profiles>
 </project>

galleria-ejb/pom.xml

 		</dependency>
 	</dependencies>
 	<build>
+		<testResources>
+			<testResource>
+				<directory>src/test/resources</directory>
+				<filtering>true</filtering>
+			</testResource>
+		</testResources>
 		<plugins>
 			<plugin>
 				<artifactId>maven-ejb-plugin</artifactId>
 						<exclude>**/*IntegrationSuite.java</exclude>
 						<exclude>**/*IntegrationTest.java</exclude>
 					</excludes>
-					<argLine>-javaagent:${jacoco.agent.path}=destfile=${jacoco.file.path}</argLine>
 				</configuration>
 			</plugin>
 			<plugin>
 							intensive. -->
 						<include>**/*IntegrationSuite.java</include>
 					</includes>
-					<argLine>-javaagent:${jacoco.agent.path}=destfile=${jacoco.file.path}</argLine>
 				</configuration>
 				<executions>
 					<execution>
 					Use an separate Derby instance for unit testing.
 					Ensure that the values here match with the ones used in persistence-test.xml. 
 					-->
-					<url>jdbc:derby://localhost:1527/GALLERIATEST;create=true</url>
-					<userid>APP</userid>
-					<password>GALLERIA</password>
+					<url>${galleria.derby.testInstance.jdbcUrl}</url>
+					<userid>${galleria.derby.testInstance.user}</userid>
+					<password>${galleria.derby.testInstance.password}</password>
 					<delimiter>;</delimiter>
 					<delimiterType>normal</delimiterType>
 				</configuration>
 						</goals>
 						<phase>process-test-resources</phase>
 					</execution>
+					<execution>
+						<id>update-IT-database</id>
+						<goals>
+							<goal>update</goal>
+						</goals>
+						<phase>pre-integration-test</phase>
+					</execution>
 				</executions>
 				<dependencies>
 					<dependency>
 	</repositories>
 	<profiles>
 		<profile>
-			<id>integration-test</id>
+			<!-- Used to add the jacoco agent to the surefire and failsafe JVM commandline 
+				only for gathering data for Sonar. -->
+			<id>sonar</id>
 			<build>
 				<plugins>
 					<plugin>
-						<groupId>com.dbdeploy</groupId>
-						<artifactId>maven-dbdeploy-plugin</artifactId>
-						<version>3.0M3</version>
+						<artifactId>maven-surefire-plugin</artifactId>
+						<version>2.7.1</version>
 						<configuration>
-							<scriptdirectory>${basedir}/src/main/sql</scriptdirectory>
-							<driver>org.apache.derby.jdbc.ClientDriver40</driver>
-							<!-- Use a separate Derby instance for integration testing -->
-							<url>jdbc:derby://localhost:1527/GALLERIATEST;create=true</url>
-							<userid>APP</userid>
-							<password>GALLERIA</password>
-							<delimiter>;</delimiter>
-							<delimiterType>normal</delimiterType>
+							<includes>
+								<!-- Used to include JUnit 4 Test Suites in the unit-testing phase -->
+								<include>**/*Suite.java</include>
+								<!-- Used to include test classes in the unit-testing phase -->
+								<include>**/*Test.java</include>
+								<include>**/*TestCase.java</include>
+							</includes>
+							<excludes>
+								<!-- Used to ignore IntegrationTest classes in the unit-testing phase -->
+								<exclude>**/*IntegrationSuite.java</exclude>
+								<exclude>**/*IntegrationTest.java</exclude>
+							</excludes>
+							<argLine>-javaagent:${jacoco.agent.path}=destfile=${jacoco.file.path}</argLine>
+						</configuration>
+					</plugin>
+					<plugin>
+						<artifactId>maven-failsafe-plugin</artifactId>
+						<version>2.9</version>
+						<configuration>
+							<includes>
+								<!-- Used to include IntegrationSuite classes during integration testing; 
+									avoiding the use of the default naming convention. Includes only suite classes 
+									for now as the startup of the embedded Glassfish container is CPU and disk 
+									intensive. -->
+								<include>**/*IntegrationSuite.java</include>
+							</includes>
+							<argLine>-javaagent:${jacoco.agent.path}=destfile=${jacoco.file.path}</argLine>
 						</configuration>
 						<executions>
 							<execution>
-								<id>update-database</id>
 								<goals>
-									<goal>update</goal>
+									<goal>integration-test</goal>
+									<goal>verify</goal>
 								</goals>
-								<phase>pre-integration-test</phase>
 							</execution>
 						</executions>
-						<dependencies>
-							<dependency>
-								<groupId>org.apache.derby</groupId>
-								<artifactId>derbyclient</artifactId>
-								<version>10.8.1.2</version>
-							</dependency>
-						</dependencies>
 					</plugin>
 				</plugins>
 			</build>
 		</profile>
 		<profile>
+			<!-- Used to update the production instance with any changes detected by 
+				dbdeploy. This profile is to be used by a build script to push database deltas 
+				into production. -->
 			<id>production</id>
 			<build>
 				<plugins>
 						<configuration>
 							<scriptdirectory>${basedir}/src/main/sql</scriptdirectory>
 							<driver>org.apache.derby.jdbc.ClientDriver40</driver>
-							<!-- Use a separate Derby instance for integration testing -->
-							<url>jdbc:derby://localhost:1527/GALLERIA;create=true</url>
-							<userid>APP</userid>
-							<password>GALLERIA</password>
+							<!-- Use a separate Derby instance for production deployments -->
+							<url>${galleria.derby.productionInstance.jdbcUrl}</url>
+							<userid>${galleria.derby.productionInstance.user}</userid>
+							<password>${galleria.derby.productionInstance.password}</password>
 							<delimiter>;</delimiter>
 							<delimiterType>normal</delimiterType>
 						</configuration>

galleria-ejb/src/test/resources/META-INF/persistence-test.xml

 		<class>info.galleria.domain.Photo</class>
 		<class>info.galleria.domain.User</class>
 		<properties>
-			<property name="javax.persistence.jdbc.url" value="jdbc:derby://localhost:1527/GALLERIATEST"/>
-			<property name="javax.persistence.jdbc.user" value="APP"/>
-			<property name="javax.persistence.jdbc.password" value="GALLERIA"/>
+			<property name="javax.persistence.jdbc.url" value="${galleria.derby.testInstance.jdbcUrl}"/>
+			<property name="javax.persistence.jdbc.user" value="${galleria.derby.testInstance.user}"/>
+			<property name="javax.persistence.jdbc.password" value="${galleria.derby.testInstance.password}"/>
 			<property name="javax.persistence.jdbc.driver" value="org.apache.derby.jdbc.ClientDriver"/>
 			<property name="hibernate.show_sql" value="true"/>
 			<property name="javax.persistence.validation.group.pre-persist" value="info.galleria.domain.PersistenceConstraint"/>

galleria-jsf/pom.xml

 		</dependency>
 		<!-- Dependencies for code coverage in Arquillian using JaCoCo -->
 		<dependency>
-			<groupId>org.jboss.arquillian.protocol</groupId>
-			<artifactId>arquillian-protocol-servlet</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>org.jboss.arquillian.extension</groupId>
-			<artifactId>arquillian-jacoco</artifactId>
-			<scope>test</scope>
-			<version>${arquillian.jacoco.version}</version>
-		</dependency>
-		<dependency>
 			<groupId>org.jacoco</groupId>
 			<artifactId>org.jacoco.core</artifactId>
 			<version>${jacoco.version}</version>
 	</repositories>
 	<profiles>
 		<profile>
+			<!-- Use a separate profile for starting and stopping Glassfish as the start-glassfish 
+				and stop-glassfish goals should not be run when tests are skipped. -->
 			<id>integration-test</id>
 			<build>
 				<plugins>
 						<artifactId>maven-glassfish-plugin</artifactId>
 						<version>2.1</version>
 						<configuration>
-							<user>admin</user>
-							<passwordFile>C:/glassfish3/glassfish/domains/domain1/config/local-password</passwordFile>
-							<glassfishDirectory>C:/glassfish3/glassfish/</glassfishDirectory>
+							<user>${galleria.glassfish.testDomain.user}</user>
+							<passwordFile>${galleria.glassfish.testDomain.passwordFile}</passwordFile>
+							<glassfishDirectory>${galleria.glassfish.testDomain.glassfishDirectory}</glassfishDirectory>
 							<domain>
-								<name>domain1</name>
-								<adminPort>4848</adminPort>
-								<httpPort>8080</httpPort>
-								<httpsPort>8443</httpsPort>
+								<name>${galleria.glassfish.testDomain.domainName}</name>
+								<adminPort>${galleria.glassfish.testDomain.adminPort}</adminPort>
+								<httpPort>${galleria.glassfish.testDomain.httpPort}</httpPort>
+								<httpsPort>${galleria.glassfish.testDomain.httpsPort}</httpsPort>
 							</domain>
 							<debug>true</debug>
 							<echo>true</echo>