Re: Building for different environments - how do _you_ do it?
Another possibility, if you're not in a J2EE container and don't necessarily have access to JNDI (or don't want to rely on server config vs. a self-contained JAR/WAR) is to package all the environment configurations together and use something like Spring and an environment variable to filter a context or properties file. I've found this to be very useful, as the same artifact can be deployed in dev, prod, staging, qa, etc. without having to re-build and risk potential differences in the artifacts. Dave On Tue, Jun 3, 2008 at 2:22 PM, Paul Davis [EMAIL PROTECTED] wrote: The best thing is to NOT create a different build for different environments. When environment specific stuff is needed (EARs and WARs) look up the info from JNDI and put that configuration on the server. Then if something needs to change, you don't need to create a new build. If you have to do it, you could probably create a profile for each environment setting a variable. Then the files specific to that environment could be filtered based on the value of that variable. You'd just specify the profile to use when creating the build. On Tue, Jun 3, 2008 at 11:14 AM, EJ Ciramella [EMAIL PROTECTED] wrote: So how are other people building for both dev and other environments? For example, how does one support multiple environments like the following: 1 - Dev integration 2 - QA stack 1 3 - QA stack 2 4 - QA stack 3 5 - Staging 6 - Prod 7 - local developer builds How do other people support variables that can be the same from local builds through production but support the option to change them at the last minute? Are people building multiple version of say an ear deployment to support all the different environments?
Re: Multiple Profiles build in one go
Maybe you could write a shell script to do this for you? This is sort of a hack, but I don't know of any clean way to do it using Maven. I have a similar problem with client-specific properties included in one of the projects and the filtering done by a profile/command argument. To build all of them I do something like this in a bash script: for n in profile1,profile2,profile3,etc.; do mvn clean package -Dprofile=$n -f project/pom.xml; # copy project/target/artifact.jar to some temporary directory, e.g.: copy project/target/artifact.jar tempDir/$n/ done; # assemble your final tar/zip for shipment tar cf final.tar tempDir On Nov 8, 2007 3:25 AM, Usman Chaudhry [EMAIL PROTECTED] wrote: Hi, I have setup a maven project with a jar file as an artifact. I am also using assembly plugin to assemble my shipments which include not only jar built also some other artifacts like readme, release notes and some configuration files. I have created three profiles for my three different enviornments i.e CIT, ST and PR. Each profile has a different set of configuration values which I was able to achieve with filters. Now the problem where I am stuck is that, for some reason, I need to generate 3 jar files (for 3 different environments) in one go and then assemble them in one shipment. Ideally I would like to have another profile named ALL_ENVIRONMENTS which somehow should invoke build/package process for rest of the individual profiles to generate 3 jars with different configuration. My shipment folder should look like this: -Shipment --CIT ---jar file ---config files --ST ---jar file ---config files --PR ---jar file ---config files --some instruction documents. I would like to generate this assembly and all the artifacts with one maven assembly command from command line. Is this possible? Can someone advise on this? Regards, Usman Chaudhry - 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: Question about native library path
The reason the *user's* list exists is to discuss using Maven, not to lecture people about adding features that may or may not exist. If a person wants to find out if features exist, or has a question about usage, they should not be lectured about adding the features themselves. A simple, I don't think this feature exists suffices. I am -- and I'm sure the vast majority of others are -- quite aware that this is an open source project and I can contribute, but during the normal course of a work day my employer pays me to make software for them, not drain resources to modify open source projects that are designed to support our infrastructure. When I ask questions on OS project lists, I try to contribute by answering a question or two that I'm able to answer, as adding features to the projects is simply not something I'm able to rationalize to my employers. On Nov 2, 2007 4:22 PM, Wayne Fay [EMAIL PROTECTED] wrote: Any time, Dave! Some people simply need a little nudge in the right direction. It seems like a lot of people on this list either don't realize or forget that Maven is Open Source Software. You're a developer, right?? If you want a feature and it isn't obviously available, go write some code!! Maven plugins are (generally) trivial to modify or even create from scratch to deal with a particular issue. The only way that Maven gets any better is by the contributions of people (like yourself) -- some in the core dev team and others who are simply motivated users who want to get their work done. In the (short) amount of time we've spent discussing this issue, you could have already written and tested your addition to the Eclipse plugin, and you'd be on dealing with the next issue in your project. Wayne On 11/2/07, Dave Feltenberger [EMAIL PROTECTED] wrote: Thank you for pointing out that if a feature doesn't exist I'm free to add the necessary features myself, Wayne. On Nov 2, 2007 2:16 PM, Wayne Fay [EMAIL PROTECTED] wrote: Its possible this functionality is not currently available. Take a look at the source code, add in your needed features, and contribute it back for future inclusion in the next release of the Eclipse plugin. Wayne On 11/2/07, Dave Feltenberger [EMAIL PROTECTED] wrote: All, Does anybody know if it's possible (and if so, how) to add the native library location to a classpath entry? Specifically the Eclipse .project classpath attribute org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY. I'd like to have some dlls in my library path without having to add additional JVM arguments everytime I create a launcher (and without having to specify it JVM-wide or something). The closest thing I could find in the project documentation was classpathContainers, but that's not exactly it. Here's an example of what I'd want the end result to be: classpathentry exported=true kind=lib path=M2_REPO/org/ecliplse/swt/swt/3.323/swt.jar attributes attribute name=org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY value=MySwtProject/target/swt-native-libs/ /attributes /classpathentry And I can't figure out how to add the additional attributes without doing it manually in Eclipse everytime. Thanks. Dave - 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] - 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: War packaging and how to change dependencies directory
Configure the dependencies plugin to copy your two dependencies to a temporary directory. plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-dependency-plugin/artifactId executions execution phaseprocess-classes/phase goals goalcopy-dependencies/goal /goals configuration outputDirectory ${dependencyTemp}/services /outputDirectory includeArtifactIds yourTwo,artifactIds /includeArtifactIds /configuration /execution /executions /plugin In the war plugin configuration, add something like this: plugin artifactIdmaven-war-plugin/artifactId configuration warSourceExcludes yourTwo*,artifactIds* /warSourceExcludes ... webResources resource directory ${dependencyTemp} /directory ... /resource /webResources /configuration /plugin On Nov 6, 2007 5:04 AM, Saloucious [EMAIL PROTECTED] wrote: Ok thanks, unfortunately, this trick not allows me to manage my 2 dependencies as maven dependencies. Saritha SV wrote: Hi Sorry for the wrong info .I just plainly forgot that. Another work around which can be done with war plugin is to include the dependency as a web resource entry like : build plugins plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-war-plugin/artifactId configuration webResources resource directoryresource2/directory /resource /webResources /configuration /plugin /plugins /build And manually include the jar file in your project . create a resource2 directory . create services directory . Include the dependency inside that after creating the dir structure for artifact id . Try including the jar files in the foll: structure : -pom.xml -resource2 - services -create directories full group id of the dependency ( like ant/ ant/1.4 etc ) - finally place the jar file And the directory resource2 is pointed out as a webresource in pom.xml and thus the generated war file will have the structure : -WEB-INF -services -full directory for the dependency as you have created in services folder in project. - jar file Thanks Saritha SV On 11/5/07, Dimitris Kapanidis [EMAIL PROTECTED] wrote: Saritha SV wrote: Hi Inorder to exclude dependencies you can specify scope as provided for the dependencies . And to include these dependencies in a different folder please try : javaModule groupIdgrupid of dependency/groupId artifactIdartifact id of dependency/artifactId bundleDir/service(try giving the path where you need the dependency)/bundleDir /javaModule Include this in the modules tag in maven-war-plugin. The modules parameter exists only on mave-ear-plugin as far as I know. Thanks Saritha On 11/5/07, Saloucious [EMAIL PROTECTED] wrote: Hi, I'm packaging a war and all dependencies go into WEB-INF/lib, but i would like to exclude 2 of them and but them into a services dir. The target layout I'm after is: WAR root | |---WEB-INF | |---lib (with dependencies) | |---services (with my 2 excluded dependencies) Is it possible to do that ? Thanks -- View this message in context:
Re: Maven/Subversion/Eclipse/Subclipse Configuration
I agree with you, Vanja. And if the developers on the project are definitely using Eclipse, you can create a Maven Builder for Eclipse that hooks into the Eclipse build lifecycle. See the additionalBuildCommands tag here: http://maven.apache.org/plugins/maven-eclipse-plugin/eclipse-mojo.html. You'd then check in the Builder/External Launcher configuration file to SVN, and when a developer checks the project out and runs mvn eclipse:eclipse on the project, the .project file will reflect the new builder. Then you can build (or filter resources) on incremental builds or full clean/builds in Eclipse without having to invoke Maven directly. On Nov 6, 2007 9:08 AM, Vanja Petreski [EMAIL PROTECTED] wrote: Check config file for the subversion. There you can find global-ignores option, where you can set filtering for target and other non-maven files (like IDE specific files). I am following the procedure: 1) Create Maven project structure 2) Import to the Subversion (with mentioned global-ignores) 3) Now everybody can checkout 4) Every developer now can choose IDE (for example mvn eclipse:eclipse) I don't use Eclipse plugins for Maven at all, because no one is good enough for me. I am using Subclipse as the SVN client, but import and checkout I am doing manually (using svn command). Regards, Vanja On Nov 6, 2007 2:13 PM, Simon Taylor [EMAIL PROTECTED] wrote: Were configuring our first Maven project and wondering if we have the right approach. Were using Maven2, Subversion accessible via WebDAV, Eclipse with both Subclipse and Maven2Eclipse plugin. We created a new Maven2 project in Eclipse. We have an existing project structure that we want to convert to Maven 2 and check in to the repository so we can then check it out and work on it in Eclipse. In eclipse it seems you can only check out from the repository As a new project - if we do this then we don't get the Maven2 structure. One alternative is to create the Maven2 project structure import the src code from the filesystem and then commit the whole project to Subversion - but ths also commits the target dir and all the compiled classes which to my mind shouldn't live in the repository. Whats the right way to use Maven2, Subversion and Eclipse. Thanks Simon Simon Taylor Service Tools Solutions (STS) Engineer Nortel Email [EMAIL PROTECTED] Office +44.1279 402291 (ESN 6 742 2291) Mobile +44.7740.533743 (ESN 748 3743) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Question about native library path
All, Does anybody know if it's possible (and if so, how) to add the native library location to a classpath entry? Specifically the Eclipse .project classpath attribute org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY. I'd like to have some dlls in my library path without having to add additional JVM arguments everytime I create a launcher (and without having to specify it JVM-wide or something). The closest thing I could find in the project documentation was classpathContainers, but that's not exactly it. Here's an example of what I'd want the end result to be: classpathentry exported=true kind=lib path=M2_REPO/org/ecliplse/swt/swt/3.323/swt.jar attributes attribute name=org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY value=MySwtProject/target/swt-native-libs/ /attributes /classpathentry And I can't figure out how to add the additional attributes without doing it manually in Eclipse everytime. Thanks. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Question about native library path
Thank you for pointing out that if a feature doesn't exist I'm free to add the necessary features myself, Wayne. On Nov 2, 2007 2:16 PM, Wayne Fay [EMAIL PROTECTED] wrote: Its possible this functionality is not currently available. Take a look at the source code, add in your needed features, and contribute it back for future inclusion in the next release of the Eclipse plugin. Wayne On 11/2/07, Dave Feltenberger [EMAIL PROTECTED] wrote: All, Does anybody know if it's possible (and if so, how) to add the native library location to a classpath entry? Specifically the Eclipse .project classpath attribute org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY. I'd like to have some dlls in my library path without having to add additional JVM arguments everytime I create a launcher (and without having to specify it JVM-wide or something). The closest thing I could find in the project documentation was classpathContainers, but that's not exactly it. Here's an example of what I'd want the end result to be: classpathentry exported=true kind=lib path=M2_REPO/org/ecliplse/swt/swt/3.323/swt.jar attributes attribute name=org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY value=MySwtProject/target/swt-native-libs/ /attributes /classpathentry And I can't figure out how to add the additional attributes without doing it manually in Eclipse everytime. Thanks. Dave - 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]
Problem attaching assembly to multi-module pom project
All - I'm still experiencing the error described here: http://jira.codehaus.org/browse/MASSEMBLY-117 It says it was fixed in 2.2-beta-1, which I've verified is the only version in repository\org\apache\maven\plugins\maven-assembly-plugin (i.e. I'm using the plugin that was supposed to have fixed it). I'm getting the following error: Failed to create assembly: Artifact: my-group:my-web-app:war:1.0-SNAPSHOT (included by module) does not have an artifact with a file. Please ensure the package phase is run before the assembly is generated. Any ideas? Thanks. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to use mvn eclipse:eclipse
Yes, unfortunately the Eclipse plugin isn't smart enough to put a blank .project and .classpath file in the typepom/type project(s). Copy the .project from one of the sub-modules, change the project name, and remove all the project references. Then do the same with the .classpath, removing the classpath entries from it. On 10/4/07, LukeLallu [EMAIL PROTECTED] wrote: I created a EAR Project using the following cammand mvn -U archetype:create -DgroupId=com.mycompany.app -DartifactId=my-ear-app -Dpackagename=com.mycompany.app -DarchetypeArtifactId=maven-archetype-j2ee-simple Then I ran mvn eclipse:eclipse I wanted to open as an Exsisting project(my-ear-app) in WSAD but .project files are created within my sub - modules inside my-ear-app and not in my-ear-app folder, so how to see the whole of EAR in WSAD with all the modules. Regards Luke -- View this message in context: http://www.nabble.com/How-to-use-mvn-eclipse%3Aeclipse-tf4566235s177.html#a13033901 Sent from the Maven - Users mailing list archive at Nabble.com. - 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]
Multi-module build failing to resolve classifier
All - I have a multi-module build (maybe 15 modules in all), and one of the projects is failing to resolve a dependency on an artifact with a classifier. WebServiceProject - WAR artifact - client stubs (using a classifier) ProjectConsumingWebService - depends on WebServiceProject-client When I do a build of the entire project, ProjectConsumingWebService is failing to resolve the client dependency. But when I run a bulid of *only* the ProjectConsumingWebService, it works fine. Anyone have any ideas? I've seen this bug: http://jira.codehaus.org/browse/MECLIPSE-287 But it appears to be specific to the Eclipse Plugin. Thanks. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Multi-module build failing to resolve classifier
Actually, I should clarify: ProjectConsumingWebService does NOT fail to resolve the dependency - at least, Maven doesn't complain that it can't find it - but it is not adding it to the build path, because I get compilation errors related to missing classes that are in the client classifier. On 10/2/07, Dave Feltenberger [EMAIL PROTECTED] wrote: All - I have a multi-module build (maybe 15 modules in all), and one of the projects is failing to resolve a dependency on an artifact with a classifier. WebServiceProject - WAR artifact - client stubs (using a classifier) ProjectConsumingWebService - depends on WebServiceProject-client When I do a build of the entire project, ProjectConsumingWebService is failing to resolve the client dependency. But when I run a bulid of *only* the ProjectConsumingWebService, it works fine. Anyone have any ideas? I've seen this bug: http://jira.codehaus.org/browse/MECLIPSE-287 But it appears to be specific to the Eclipse Plugin. Thanks. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Filtering resources in Assembly plugin
I think I found a bug in the assembly plugin. When I specify a single file in my assembly, like so: files file sourcesrc/main/resources/faxing.sh/source outputDirectory//outputDirectory filteredtrue/filtered /file /files it is filtered properly using the projectbuildfilters. But if I specify a fileset, like so: fileSets fileSet directorysrc/main/resources/directory outputDirectory//outputDirectory includes include*.sh/include /includes filteredtrue/filtered /fileSet /fileSets the resources are *not* filtered. This isn't intentional, is it? Dave On 9/21/07, Dave Feltenberger [EMAIL PROTECTED] wrote: All, I'm having an issue filtering resources with the assembly plugin. In the documentation at: http://maven.apache.org/plugins/maven-assembly-plugin/examples/single/filtering-some-distribution-files.html there is an example of using the assembly plugin. Here is the part in the pom that says how to specify the filter file: plugin artifactIdmaven-assembly-plugin/artifactId configuration filters filtersrc/assemble/filter.properties/filter /filters descriptors descriptorsrc/assemble/distribution.xml/descriptor /descriptors /configuration /plugin When I add a filters tag in my pom in the location specified above, I get the following error: [INFO] Error configuring: org.apache.maven.plugins:maven-assembly-plugin. Reason: ERROR: Cannot override read-only parameter: filters in goal: assembly:assembly I've tried lots of permutations: adding the filters tag to the projectbuild structure, configuring it to run the attached goal, etc., and nothing will work. When I specify the filters in the build tag, I get no error, but it also doesn't filter. Is this an error in the documentation or an issue with 2.2-beta1? Or am I just doing something incorrectly? Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Filtering resources in Assembly plugin
All, I'm having an issue filtering resources with the assembly plugin. In the documentation at: http://maven.apache.org/plugins/maven-assembly-plugin/examples/single/filtering-some-distribution-files.html there is an example of using the assembly plugin. Here is the part in the pom that says how to specify the filter file: plugin artifactIdmaven-assembly-plugin/artifactId configuration filters filtersrc/assemble/filter.properties/filter /filters descriptors descriptorsrc/assemble/distribution.xml/descriptor /descriptors /configuration /plugin When I add a filters tag in my pom in the location specified above, I get the following error: [INFO] Error configuring: org.apache.maven.plugins:maven-assembly-plugin. Reason: ERROR: Cannot override read-only parameter: filters in goal: assembly:assembly I've tried lots of permutations: adding the filters tag to the projectbuild structure, configuring it to run the attached goal, etc., and nothing will work. When I specify the filters in the build tag, I get no error, but it also doesn't filter. Is this an error in the documentation or an issue with 2.2-beta1? Or am I just doing something incorrectly? Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Eclipse and Maven best practice
That's interesting - why separate locations? To avoid having to refresh in Eclipse when a maven build is run? On 9/13/07, Jim Sellers [EMAIL PROTECTED] wrote: I've had the most success with using maven and eclipse by: 1) having both systems build to a separate locations 2) using command line to run maven and when I need to sync up metadata using eclipse:eclipse then hitting refresh in eclipse. 3) for any eclipse specific data (.classpath, .mymetadata, etc), having those are part of the .cvsignore (not checked into source control) Not against anyone who has worked on the m2e or q4e plug-ins, but when I tried any plug-ins that were available close to a year ago (?) I had troubles. I still have not found a reason to move away from the command line. Jim On 9/13/07, Wayne Fay [EMAIL PROTECTED] wrote: I'm recently involved in an SAP NWDS (NetWeaver Dev Studio) project at work. NWDS is really just Eclipse 2.1 with some SAP-specific stuff added. Among the things they took away in this customized Eclipse is the ability to add plugins etc the usual way through the menu system. I'm wondering if anyone else is stuck using NWDS and if there's any chance to use m2e or q4e etc with this tool? Wayne On 9/13/07, Alexander Sack [EMAIL PROTECTED] wrote: Is there any reason why you don't use a Maven/Eclipse plugin such as m2eclipse and now q4e? They integrate fully into Eclipse's build and do autodependency management. Also have you setup a CLASSPATH Container variable within Eclipse in order to use your local M2 repository? See here: http://maven.apache.org/plugins/maven-eclipse-plugin/reactor.html And for plugins: http://m2eclipse.codehaus.org/ http://code.google.com/p/q4e/ -aps On 9/13/07, zm [EMAIL PROTECTED] wrote: Hi, Can anyone help me with the best way to setup a Maven/Eclipse environment? I know there is a goal to produce an eclipse project with the pom, but I'm trying to understand how to create one at hand, customise and include it's dependencies. I have created 2 projects, appTest and appCommon. The main project is appTest that depends on appCommon. The source directories are the default Maven (src/main/java) and that directory is configured as source in eclipse, so it can compile the code. Then I've configured a specific directory build (same level as the src above), that eclipse will use to put the compiled classes (this folder will be ignored for SVN/CVS integration). Everything looks great, and works nicelly. Or so it seems ... No let's say I put a dependency on version Log4J 1.0. I make some code accessing it, then eclipse will just mark it as invalid, since the Log4J is not in it's classpath. Maven, on the other end, downloads it from central repository and compiles successfully. Now what would be the best way to put it to compile in eclipse? The way I see it, I can include it in the project's classpath, and point it to the local repository jar that maven just downloaded. Would this be the best option? -- View this message in context: http://www.nabble.com/Eclipse-and-Maven-%22best-practice%22-tf4436040s177.html#a12655883 Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- What lies behind us and what lies in front of us is of little concern to what lies within us. -Ralph Waldo Emerson - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Eclipse and Maven best practice
I haven't had the time/inclination to try out q4e yet. I didn't like m2 when I tried it a few weeks ago, though. I'd be interested to see what people think of q4e so far... On 9/14/07, Rodrigo Madera [EMAIL PROTECTED] wrote: Since you brought that up, let me take advantage of this oportunity to ask users: I have always used m2. How would that compare to q4e? Thanks, Rodrigo On 9/14/07, Dave Feltenberger [EMAIL PROTECTED] wrote: That's interesting - why separate locations? To avoid having to refresh in Eclipse when a maven build is run? On 9/13/07, Jim Sellers [EMAIL PROTECTED] wrote: I've had the most success with using maven and eclipse by: 1) having both systems build to a separate locations 2) using command line to run maven and when I need to sync up metadata using eclipse:eclipse then hitting refresh in eclipse. 3) for any eclipse specific data (.classpath, .mymetadata, etc), having those are part of the .cvsignore (not checked into source control) Not against anyone who has worked on the m2e or q4e plug-ins, but when I tried any plug-ins that were available close to a year ago (?) I had troubles. I still have not found a reason to move away from the command line. Jim On 9/13/07, Wayne Fay [EMAIL PROTECTED] wrote: I'm recently involved in an SAP NWDS (NetWeaver Dev Studio) project at work. NWDS is really just Eclipse 2.1 with some SAP-specific stuff added. Among the things they took away in this customized Eclipse is the ability to add plugins etc the usual way through the menu system. I'm wondering if anyone else is stuck using NWDS and if there's any chance to use m2e or q4e etc with this tool? Wayne On 9/13/07, Alexander Sack [EMAIL PROTECTED] wrote: Is there any reason why you don't use a Maven/Eclipse plugin such as m2eclipse and now q4e? They integrate fully into Eclipse's build and do autodependency management. Also have you setup a CLASSPATH Container variable within Eclipse in order to use your local M2 repository? See here: http://maven.apache.org/plugins/maven-eclipse-plugin/reactor.html And for plugins: http://m2eclipse.codehaus.org/ http://code.google.com/p/q4e/ -aps On 9/13/07, zm [EMAIL PROTECTED] wrote: Hi, Can anyone help me with the best way to setup a Maven/Eclipse environment? I know there is a goal to produce an eclipse project with the pom, but I'm trying to understand how to create one at hand, customise and include it's dependencies. I have created 2 projects, appTest and appCommon. The main project is appTest that depends on appCommon. The source directories are the default Maven (src/main/java) and that directory is configured as source in eclipse, so it can compile the code. Then I've configured a specific directory build (same level as the src above), that eclipse will use to put the compiled classes (this folder will be ignored for SVN/CVS integration). Everything looks great, and works nicelly. Or so it seems ... No let's say I put a dependency on version Log4J 1.0. I make some code accessing it, then eclipse will just mark it as invalid, since the Log4J is not in it's classpath. Maven, on the other end, downloads it from central repository and compiles successfully. Now what would be the best way to put it to compile in eclipse? The way I see it, I can include it in the project's classpath, and point it to the local repository jar that maven just downloaded. Would this be the best option? -- View this message in context: http://www.nabble.com/Eclipse-and-Maven-%22best-practice%22-tf4436040s177.html#a12655883 Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- What lies behind us and what lies in front of us is of little concern to what lies within us. -Ralph Waldo Emerson - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- If Jack Bauer had been a Spartan, the movie would have been called 1.
Re: Eclipse and Maven best practice
I'll have to give this a try. I agree having Eclipse do a rebuild is painful sometimes, especially if there are a lot of projects. I never really thought about having two separate output directories, for some reason. One more experiment to add to the to-do list... On 9/14/07, Jim Sellers [EMAIL PROTECTED] wrote: I've used separate locations for a few reasons: 1) in web apps to keep the default location (WEB-INF/classes) 2) in eclipse it'll build to one location, in maven it builds to 2 (classes, test-classes) and I wanted to keep that behaviour 3) if I run mvn clean or mvn site (etc), I don't have to do a full clean when I just back into eclipse 4) I like to have the tools keep as close to their default behaviour as possible so that the ideas from either tool don't leak into the other. 5) because I enjoy pain? You're right: it's mostly to avoid having to refresh eclipse and have it totally rebuild everything. ;-) Jim On 9/14/07, Dave Feltenberger [EMAIL PROTECTED] wrote: That's interesting - why separate locations? To avoid having to refresh in Eclipse when a maven build is run? On 9/13/07, Jim Sellers [EMAIL PROTECTED] wrote: I've had the most success with using maven and eclipse by: 1) having both systems build to a separate locations 2) using command line to run maven and when I need to sync up metadata using eclipse:eclipse then hitting refresh in eclipse. 3) for any eclipse specific data (.classpath, .mymetadata, etc), having those are part of the .cvsignore (not checked into source control) Not against anyone who has worked on the m2e or q4e plug-ins, but when I tried any plug-ins that were available close to a year ago (?) I had troubles. I still have not found a reason to move away from the command line. Jim On 9/13/07, Wayne Fay [EMAIL PROTECTED] wrote: I'm recently involved in an SAP NWDS (NetWeaver Dev Studio) project at work. NWDS is really just Eclipse 2.1 with some SAP-specific stuff added. Among the things they took away in this customized Eclipse is the ability to add plugins etc the usual way through the menu system. I'm wondering if anyone else is stuck using NWDS and if there's any chance to use m2e or q4e etc with this tool? Wayne On 9/13/07, Alexander Sack [EMAIL PROTECTED] wrote: Is there any reason why you don't use a Maven/Eclipse plugin such as m2eclipse and now q4e? They integrate fully into Eclipse's build and do autodependency management. Also have you setup a CLASSPATH Container variable within Eclipse in order to use your local M2 repository? See here: http://maven.apache.org/plugins/maven-eclipse-plugin/reactor.html And for plugins: http://m2eclipse.codehaus.org/ http://code.google.com/p/q4e/ -aps On 9/13/07, zm [EMAIL PROTECTED] wrote: Hi, Can anyone help me with the best way to setup a Maven/Eclipse environment? I know there is a goal to produce an eclipse project with the pom, but I'm trying to understand how to create one at hand, customise and include it's dependencies. I have created 2 projects, appTest and appCommon. The main project is appTest that depends on appCommon. The source directories are the default Maven (src/main/java) and that directory is configured as source in eclipse, so it can compile the code. Then I've configured a specific directory build (same level as the src above), that eclipse will use to put the compiled classes (this folder will be ignored for SVN/CVS integration). Everything looks great, and works nicelly. Or so it seems ... No let's say I put a dependency on version Log4J 1.0. I make some code accessing it, then eclipse will just mark it as invalid, since the Log4J is not in it's classpath. Maven, on the other end, downloads it from central repository and compiles successfully. Now what would be the best way to put it to compile in eclipse? The way I see it, I can include it in the project's classpath, and point it to the local repository jar that maven just downloaded. Would this be the best option? -- View this message in context: http://www.nabble.com/Eclipse-and-Maven-%22best-practice%22-tf4436040s177.html#a12655883 Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- What lies behind us and what lies in front of us is of little concern
Re: Re: Maven Antrun Plugin - specific target call
Can't you just pass in a -D argument and execute the argument that's passed in? e.g. mvn install -DantTarget=targetToCall then in the antrun execution: ant antfile=src/main/ant-builds/buildJnlps.xml target=${antTarget} / On 9/11/07, Wayne Fay [EMAIL PROTECTED] wrote: I would just move those targets out to a build.xml file so you can call them directly with Ant. Then set Maven up so it calls the targets in the build.xml file rather than embedding the Ant stuff in your pom. Wayne On 9/11/07, Ritz, Martin [EMAIL PROTECTED] wrote: I have already two profiles... I dont want to blow up my pom too much! Is there no other easier way to call specific targets? Martin Profiles will solve your problem. Wayne On 9/11/07, Ritz, Martin [EMAIL PROTECTED] wrote: Hi, I have some ant targets integrated in my pom.xml. I declared an ant build script which is therefor called from maven. Now I dont want to perform every ant target on every build. Is there a way to call only specific ant-targets from the command line (maybe by calling the target or the id)? --- kind regards Martin Ritz BTC AG - Unit Software Engineering mailto:[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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Re: Maven Antrun Plugin - specific target call
Because ant can inherit the classpaths/dependencies. Presumably he *is* utilizing the lifecycle, and attaching this ant config to one of the phases, but has a need to call specific ant tasks only sometimes. Was there something I missed that made you think he was calling maven only to call ant, and that he had no interest in utlizing the lifecycle? I assumed this was a somewhat special case and that it wasn't just using Maven to wrap an ant build process - that I agree would be silly. On 9/11/07, Wayne Fay [EMAIL PROTECTED] wrote: That just sounds more complicated than it needs to be. Calling Maven just so it will call Ant for me is too indirect when I can just call Ant directly, right? What's the advantage when it works fine with ant target and I have no interest in utilizing the Maven lifecycle for this particular Ant target/call? Wayne On 9/11/07, Dave Feltenberger [EMAIL PROTECTED] wrote: Can't you just pass in a -D argument and execute the argument that's passed in? e.g. mvn install -DantTarget=targetToCall then in the antrun execution: ant antfile=src/main/ant-builds/buildJnlps.xml target=${antTarget} / On 9/11/07, Wayne Fay [EMAIL PROTECTED] wrote: I would just move those targets out to a build.xml file so you can call them directly with Ant. Then set Maven up so it calls the targets in the build.xml file rather than embedding the Ant stuff in your pom. Wayne On 9/11/07, Ritz, Martin [EMAIL PROTECTED] wrote: I have already two profiles... I dont want to blow up my pom too much! Is there no other easier way to call specific targets? Martin Profiles will solve your problem. Wayne On 9/11/07, Ritz, Martin [EMAIL PROTECTED] wrote: Hi, I have some ant targets integrated in my pom.xml. I declared an ant build script which is therefor called from maven. Now I dont want to perform every ant target on every build. Is there a way to call only specific ant-targets from the command line (maybe by calling the target or the id)? --- kind regards Martin Ritz BTC AG - Unit Software Engineering mailto:[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] - 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: Running heavy tests in the build lifecycle
I think Arnaud's advice is right if you're going to keep one project for everything - set up the profiles. You may need to re-arrange the source tree a little bit, though - looks like you have several different source trees, one for each category of tests. I'm not sure how the surefire plugin will respond to having multiple source trees (the config section only takes one location), so if it complains, you'll probably need to move everything into e.g. src/test/java (/functional, /unit, etc.). Alternatively the separate project approach would let you configure the surefire plugin for each type of unit test. You can by default skip unit tests in the functional/integration/etc. projects with skiptrue/skip in the configuration of the plugin. If you make them child projects to the main, you can even inherit all the project properties/dependencies/etc. and have a really simple pom for each category of tests. Something like: computas-Eass-Main/pom.xml (type pom) \-- computas-Eass/pom.xml (where all your source code is) \-- functional-Tests/pom.xml (inherits from Main/parent project to share all deps etc., set to skip unit tests by default) \-- unit-Tests/pom.xml (also inherits parent properties, but set to run tests by default) etc. This will still relate the project/tests hierarchically and is (I think) fairly elegant as it allows fine-tuning of when to run which type of test and won't duplicate any effort (you're inheriting the parent project's properties). Dave On 9/4/07, Insitu [EMAIL PROTECTED] wrote: Kjetil Kjernsmo [EMAIL PROTECTED] writes: Looking through the source tree, I see that we do allready have a naming convention, but in terms of directory naming: test: functional/ integration/ performance/ unit/ where a test may have a path like: test/integration/source/com/computas/eass/server/persistence/TestServiceProvider.java where the test/integration/source is not part of the package name. The tests to be run in the test phase are in unit/, the tests for the integration test phase is also well named. I suppose this is somewhat contrary to convention, so the question is if I should rename things or configure things to use these subdirs? You could also create a separate project for the heavy-handed ones and only build that test suite manually as needed. Right. My boss mentioned that, but I felt that it was a bit inelegant, and he is not very experienced with Maven either. Wouldn't it be nice to have a separate lifecycle phase for stuff like this? Maybe you could use two features peculiar to maven to achieve what you want within the confine of a single project (although I think moving integration tests out to another project is a good idea): 1. define a profile for each different kind of test you want to run: perf, func, unit... 2. in each profile, configure different set of test executions. this can be done by configuring surefire plugin (see http://maven.apache.org/plugins/maven-surefire-plugin/, it has a zillion parameters to play with). If you use testNG, you can define different test groups to be executed in each profile, if you use Junit, you can include/exclude test files (you can also do that with testNG of course). 3. configure the basic execution of surefire (ie. the one that gets executed always) to just run unit tests. Then running your tests is a matter of invoking maven with the right profile(s): mvn -Pfunc-test or mvn -Pperf-test or even mvn -Pfunc-test -Pperf-test HTH -- OQube software engineering \ génie logiciel Arnaud Bailly, Dr. \web http://www.oqube.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Maven Plugins for Eclipse
All, Do you have recommendations on a good Maven2 plugin for Eclipse? I just tried M2 Eclipse from Codehaus (http://m2eclipse.codehaus.org) and it seems a little klunky - my Eclipse projects have build errors (they didn't prior to the plugin, and compiling using the poms from the command line works fine) and trouble staying synchronized. Are there others you've tried and like? I actually prefer using External Launchers and/or the command line, but I'm trying to sell a Maven upgrade to co-workers who are very reliant on and set in their ways in Eclipse, so I need to make the transition as painless for them as possible. Thanks. Dave
Child poms and eclipse projects
Hi - I have the following flat project layout: workspace/parent-proj/pom.xml workspace/child1/pom.xml (artifactId = child-project-1) workspace/child2/pom.xml (artifactId = childProject2) workspace/child3/pom.xml etc. When I run mvn eclipse:eclipse on the parent-proj, it writes out the project files properly, with one exception: it's using the artifactId as the project directory name for each artifact. So say child1 depends on artifactId childProject2, but the directory that artifact is in is actually child2. Well the eclipse .project file has a reference to childProject1. Is there any way to tell the plugin to use the correct directory name, or am I forced to always use the same directory name as the artifactId? I can do the latter, but it's not very practical - I'd rather configure the eclipse plugin in the parent pom or something. The Eclipse projects are inconsistently named, but I want to keep the artifactIds consistent. With the incorrect directory name, Eclipse shows errors in the Problems tab and won't recompile during debug sessions etc. as a result. Thanks in advance. Dave
Re: Getting the source code for a dependency
Hi Alex, I know if you use the Eclipse plugin, you can put this in your parent pom: ... plugins plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-eclipse-plugin/artifactId configuration downloadSourcestrue/downloadSources downloadJavadocstrue/downloadJavadocs /configuration /plugin /plugins ... And then run mvn eclipse:eclipse (or don't add the plugin tag, and run mvn eclipse:eclipse -DdownloadSources=true -DdownloadJavadocs=true). Then you'll be able to see the source for those that can be found. Dave On 8/24/07, Alex Worden [EMAIL PROTECTED] wrote: Hi, Please can someone tell me if there is a way to ask Maven 2 to download the source code for a dependency... and if so, where will it put it? Also it would be useful to know if there is any definitive way to determine which dependency a referenced class comes from. For instance, I'm looking for the documentation on of: org.springframework.transaction.annotation.Transactional so I can read what the @Transactional annotation means My guess is that it is downloaded in the pom.xml config section: dependency groupIdorg.springframework/groupId artifactIdspring-core/artifactId version2.0.1/version scopetest/scope /dependency but.. there is no way of determining this. I can only guess that I have to use a utility to trawl through all the jars in the .m2/repository to find this class. That aside... my main question is this: Is there some xml element I can add to dependency that will download the source code for this version of the JAR? Many thanks, Alex
Question about filtering
Hi - I'm working on a project that has the need to do the following, and I can't think of an elegant way of achieving it using Maven without having to call out to Ant: We have several clients, each of which get a customized Java Web Start / .jnlp file. There are only 5 clients now, but the number could explode very quickly, so automation is key. The jnlp files are almost identical, with only a few things changed. In the current Ant build system -- which I'm replacing with Maven2 -- one template.jnlp file is copied n times, one for each client. Each client has its own properties file that is used to filter the jnlp. So basically we start with: template.jnlp client1.properties client2.properties client3.properties And end up with: client1.jnlp (with the filtered properties in it) client2.jnlp (ditto) client3.jnlp (ditto) etc. It's not practical to create a new POM/artifact for each new client, since there may be so many so soon. The only thing I know how to do is to add multiple properties files and multiple files to filter, but that's done at more of a global level - the filter attributes in the jnlp files will be the same since they'll come from the same template, so I need to do them one .properties and .jnlp at a time. This is what I have so far that works for only one client at a time (copy the template to a new file in generate-resources phase, then do the filtering during the regular life cycle). I'm considering changing this to do more work in the Ant taks - looping through a list, creating each .jnlp, filtering, etc. -- but I feel like I'm breaking some kind of best practice or re-creating a wheel someone on the list may have already created by going down that path. ... build filters filtersrc/main/filters/${client.filter}.properties/filter /filters resources resource directory${temp.resources.dir}/directory includes include${client.filter}.jnlp/include /includes filteringtrue/filtering /resource /resources /build ... plugins plugin inheritedtrue/inherited artifactIdmaven-antrun-plugin/artifactId executions execution phasegenerate-resources/phase configuration tasks mkdir dir=${temp.resources.dir} / copy file=${jnlp.template.file} tofile=${temp.resources.dir}/${client.filter}.jnlp / /tasks /configuration goals goalrun/goal /goals /execution /executions /plugin /plugins Any help would be greatly appreciated! Thanks. Dave