Getting correct file based on a profile
Hello; I have a problem that I know has been solved by maven. I am trying to determine the best way to solve it. Problem: I have two different profiles created: 1) development 3) production I have a multi-project that looks like: pom.xml core/pom.xml common/pom.xml web/pom.xml In both development and production we need to use the beanRefFactory.xml file. The development one is defined in core/src/main/resources/beanRefFactory.xml and the production one is defined in core/target/src/beanRefFactory.xml This file is placed into our project-core-1.0.jar and controlled in the core\pom.xml file The profiles definitions are controlled in the parent pom.xml file. This is my resource definitions in my core/pom.xml and it is configured for development resources resource directorytarget/src/directory excludes exclude**/*.java/exclude exclude**/beanRefFactory.xml/exclude /excludes /resource resource directorysrc/main/resources/directory includes includebeanRefFactory.xml/include /includes /resource /resources This is how I would define it in Production resources resource directorytarget/src/directory excludes exclude**/*.java/exclude /excludes /resource /resources Questions: --- What is the best way to control this? How do I specify conditional logic in my pom.xml to pull the correct file ? What pom do I put this control in, where profiles are in parent pom.xml or core/pom.xml where I need the control? -- View this message in context: http://www.nabble.com/Getting-correct-file-based-on-a-profile-tp15069346s177p15069346.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
maven-jar-plugin excludes not working
Hello; I am building an executable jar file and I am trying to remove my database.properties file from the jar because I want to control the properties outside of the jar file. In my build I execute mvn package I have the maven-dependency-plugin part of the lifecycle to get all of my .class files into the target/classes directory. In that directory is my database.properties file. Next the directory basically gets jared up via the maven-jar-plugin. I cannot seem to get the jar plugin to remove or not put the database.properties into the jar. Here is my jar plugin definition. Any help would be appreciated. plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-jar-plugin/artifactId configuration archive manifest addClasspathtrue/addClasspath mainClasscom.putnam.fams.batch.BatchProcessMain/mainClass /manifest /archive outputDirectory${project.build.directory}/outputDirectory excludeGroupIdsjunit/excludeGroupIds excludes**/database.properties/excludes /configuration /plugin The database.properties in the target/classes/database.properties directory before jar happens. In the excludes I've tried excludes**/database.properties/excludes excludes**/*database.properties/excludes excludesdatabase.properties/excludes Nothing seems to work. Is this a bug that anyone knows about ? Thanks Peter -- View this message in context: http://www.nabble.com/maven-jar-plugin-%3Cexcludes%3E-not-working-tf4899585s177.html#a14033720 Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
assembly plugin or dependency plugin
Hello; I have a problem creating a batch.jar file for a java application that will run on some UNIX server via a shell script. My maven project is a multiproject with the following subprojects modules modulecommon/module moduleserver/module modulerules/module modulebatch/module moduleweb/module /modules the batch module will run on the server and want is one big JAR file that contains all of the .class files for the project and its dependencies. I would also like to add a Class-Main to the JAR MANIFEST and to have the ability to remove some MANIFEST files from the other jars. Should I be looking at the assembly plugin or the dependency plugin and are there any good examples other than the examples I see in the plugin apache documentation? Thanks for the help. Peter -- View this message in context: http://www.nabble.com/assembly-plugin-or-dependency-plugin-tf4791376s177.html#a13706413 Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
maven-assembly-plugin
Hello; I am trying to build a jar file from our maven2 build. The project is a web project and we have a process that runs on the server as a Java application. I have been fooling around with the maven-assembly-plugin to try to get it to build a batch.jar file that I can use to execute a Java program. My attempts have been futile. I tried building my own assembler file batch-bin.xml and it is not coming together easily for me. I am missing something. My ultimate goal is to have a batch.jar file created with all of the dependencies in the project placed into this jar as .class files NOT jar files. I also want the MANEFEST.MF file created so that I can execute java -jar batch.jar on the command line. Could someone point me to a good example page or mail me an example. I've read the docs sonatype and apache.maven site on assembly and I am not getting it. Thank you Peter -- View this message in context: http://www.nabble.com/maven-assembly-plugin-tf4692100s177.html#a13410974 Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Capturing the Build Date
Hello; I am trying to capture the build date or date at which the application got build and jared up into a properties file called application.properties. I want to take this and display it on the web application for the about.html. I have found most of the information I am looking for like the user who built it the OS build on using the Java System properties.I cannot seem to find a way to capture the build date. I am sure this is easy to do and could do it in ant, but I would rather use the maven features. This is my properties file that I have set up as a resource and filtered on. # Build Environment Info fams.build.date=${build.date} fams.build.timezone=${user.timezone} fams.build.region=${user.region} fams.build.time=${user.time} fams.build.os.name=${os.name} fams.build.os.arch=${os.arch} fams.build.os.version=${os.version} Here is my maven pom.xml definition. !-- Application Build Informaiton to be displayed in the GUI -- resource directorysrc/main/resources/directory includes includeapplication.properties/include /includes filteringtrue/filtering /resource Any help would be appreciated. Thanks -- View this message in context: http://www.nabble.com/Capturing-the-Build-Date-tf4530478s177.html#a12928449 Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]