RE: Better to use variables or hard-coded paths?
property name=hibernate.connection.usernameSAMPLEUSERNAME/property property name=hibernate.connection.passwordSAMPLEPASSWORD/property property name=hibernate.connection.urljdbc:db2://SAMPLEMACHINENAME:SAMPLEPORT/SAMPLEDATABASENAME/property property name=hibernate.connection.driver_classcom.ibm.db2.jcc.DB2Driver/property property name=hibernate.connection.isolation1/property property name=hibernate.dialectorg.hibernate.dialect.DB2Dialect/property !-- We use the old parser to get around an issue with weblogic and ANTLR -- property name=hibernate.query.factory_classorg.hibernate.hql.classic.ClassicQueryTranslatorFactory/property property name=hibernate.generate_statisticstrue/property /session-factory /hibernate-configuration pom.xml build section for both runtime and test build sourceDirectory${basedir}/src/main/java/sourceDirectory testResources !-- This grabs any test specific properties for the test run -- testResource directory${basedir}/src/test/resources/properties/directory includes include**/*.*/include /includes filteringfalse/filtering /testResource !-- This grabs any environment specific test specific files (build env could be dev,test,stage,prod) Should be using profiles here. -- testResource directory${basedir}/src/test/resources/${maven.build.environment}/directory includes include**/*.*/include /includes filteringfalse/filtering /testResource /testResources resources !-- This grabs environment specific properties and should be replaced with profiles. -- resource directory${basedir}/src/main/resources/${maven.build.environment}/directory includes include**/*.*/include /includes filteringfalse/filtering /resource !-- This grabs non environment specific properties including the applicationContext xml files. -- resource directory${basedir}/src/main/resources/properties/directory includes include**/*.*/include /includes filteringfalse/filtering /resource !-- This makes sure all the hbm.xml files are included in the jar. The applicationContext xml files are in resources. -- resource directory${basedir}/src/main/java/directory includes include**/*.hbm.xml/include /includes filteringfalse/filtering /resource /resources /build Scott Ryan Chief Technology Officer Soaring Eagle L.L.C. [EMAIL PROTECTED] www.soaringeagleco.com (303) 263-3044 -Original Message- From: Daniel Serodio [mailto:[EMAIL PROTECTED] Sent: Friday, August 25, 2006 7:33 AM To: Maven Users List Subject: Re: Better to use variables or hard-coded paths? Scott Ryan wrote: We actually use the same application context but use the test resources construct to pull it out of the main build path for use during testing. You just need to include the xml files from the main tree in your resources during testing and it works very nice. We use a different hibernate configuration since in one case we are using a JNDI lookup in production and during testing just a direct jdbc connection. The xml is configured to build the session factory from the data source we define in the properties file. If you like I can send you the maven 1 or 2 config we are using. Can you please send me the m2 config? I don't understand what you mean by pull it out of the main build path. Scott Ryan Chief Technology Officer Soaring Eagle L.L.C. [EMAIL PROTECTED] www.soaringeagleco.com (303) 263-3044 -Original Message- From: Matt Raible [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 23, 2006 10:58 AM To: Maven Users List Subject: Re: Better to use variables or hard-coded paths? On 8/23/06, Daniel Serodio [EMAIL
Re: Better to use variables or hard-coded paths?
Scott Ryan wrote: We actually use the same application context but use the test resources construct to pull it out of the main build path for use during testing. You just need to include the xml files from the main tree in your resources during testing and it works very nice. We use a different hibernate configuration since in one case we are using a JNDI lookup in production and during testing just a direct jdbc connection. The xml is configured to build the session factory from the data source we define in the properties file. If you like I can send you the maven 1 or 2 config we are using. Can you please send me the m2 config? I don't understand what you mean by pull it out of the main build path. Scott Ryan Chief Technology Officer Soaring Eagle L.L.C. [EMAIL PROTECTED] www.soaringeagleco.com (303) 263-3044 -Original Message- From: Matt Raible [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 23, 2006 10:58 AM To: Maven Users List Subject: Re: Better to use variables or hard-coded paths? On 8/23/06, Daniel Serodio [EMAIL PROTECTED] wrote: Matt Raible wrote: I'm customizing my pom.xml so XML files are available on my classpath (at /WEB-INF/*.xml) when testing. My question is (hopefully) simple. Is it better to use: snip/ I think using Hard-coded directories is more Maven-like, while using variables is more Ant-like. I'd stick with the hard-coded directories, or better yet, use Maven's stardard directory layout http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html I am using this layout, I just need to include src/main/webapp in my classpath so I can use /WEB-INF/applicationContext.xml in my tests - w/o having duplicate context files. Thanks for your advice Daniel. Matt HTH, Daniel Serodio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Better to use variables or hard-coded paths?
On 8/23/06, Scott Ryan [EMAIL PROTECTED] wrote: We actually use the same application context but use the test resources construct to pull it out of the main build path for use during testing. You just need to include the xml files from the main tree in your resources during testing and it works very nice. We use a different hibernate configuration since in one case we are using a JNDI lookup in production and during testing just a direct jdbc connection. The xml is configured to build the session factory from the data source we define in the properties file. If you like I can send you the maven 1 or 2 config we are using. I like, please send. Thanks, Matt Scott Ryan Chief Technology Officer Soaring Eagle L.L.C. [EMAIL PROTECTED] www.soaringeagleco.com (303) 263-3044 -Original Message- From: Matt Raible [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 23, 2006 10:58 AM To: Maven Users List Subject: Re: Better to use variables or hard-coded paths? On 8/23/06, Daniel Serodio [EMAIL PROTECTED] wrote: Matt Raible wrote: I'm customizing my pom.xml so XML files are available on my classpath (at /WEB-INF/*.xml) when testing. My question is (hopefully) simple. Is it better to use: snip/ I think using Hard-coded directories is more Maven-like, while using variables is more Ant-like. I'd stick with the hard-coded directories, or better yet, use Maven's stardard directory layout http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html I am using this layout, I just need to include src/main/webapp in my classpath so I can use /WEB-INF/applicationContext.xml in my tests - w/o having duplicate context files. Thanks for your advice Daniel. Matt HTH, Daniel Serodio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Better to use variables or hard-coded paths?
Matt Raible wrote: I'm customizing my pom.xml so XML files are available on my classpath (at /WEB-INF/*.xml) when testing. My question is (hopefully) simple. Is it better to use: snip/ I think using Hard-coded directories is more Maven-like, while using variables is more Ant-like. I'd stick with the hard-coded directories, or better yet, use Maven's stardard directory layout http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html HTH, Daniel Serodio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Better to use variables or hard-coded paths?
On 8/23/06, Daniel Serodio [EMAIL PROTECTED] wrote: Matt Raible wrote: I'm customizing my pom.xml so XML files are available on my classpath (at /WEB-INF/*.xml) when testing. My question is (hopefully) simple. Is it better to use: snip/ I think using Hard-coded directories is more Maven-like, while using variables is more Ant-like. I'd stick with the hard-coded directories, or better yet, use Maven's stardard directory layout http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html I am using this layout, I just need to include src/main/webapp in my classpath so I can use /WEB-INF/applicationContext.xml in my tests - w/o having duplicate context files. Thanks for your advice Daniel. Matt HTH, Daniel Serodio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Better to use variables or hard-coded paths?
I'm customizing my pom.xml so XML files are available on my classpath (at /WEB-INF/*.xml) when testing. My question is (hopefully) simple. Is it better to use: build testResources testResource directorysrc/test/resources/directory /testResource testResource directorysrc/main/webapp/directory includes include**/*.xml/include /includes /testResource /testResources /build Or variables? build testResources testResource directory${project.testResources}/directory /testResource testResource directory${some.variable.ihaventfiguredoutyet}/directory includes include**/*.xml/include /includes /testResource /testResources /build Thanks, Matt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]