Re: JUnit and getResourceAsStream
Lennart Martens wrote: Hi, It probably boils down to either not having the necessary file ('foo.xml') in the Junit classpath or a config problem. [snip] It's definitely Friday - sorry - that was a stupid mistake! Thanks, ct - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
JUnit and getResourceAsStream
I've got a unit test that needs to read a data file, i.e. InputStream in = getClass().getResourceAsStream("foo.xml"); Within Eclipse the file is found, however when running the test from within Maven the resource is not found (i.e. in is null). Any ideas? ct - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How can I specify the that $HOME should be in the classpath
[EMAIL PROTECTED] wrote: With maven you declare your dependency on specific files (jars etc) rather than anything found in a directory. Yep. Does this help? If not, give us some more info on what you need to do. Not really. It my fault for not giving a full picture of what I'm trying to do. Here's the story. There are various property and xml files that my project requires at runtime. Examples include log4j.xml, hibernate.xml etc. These files do not live in the source tree (src/java) so as to prevent developers commiting their preferences to CVS. Instead, each developer must put, for example, log4j.xml in their $HOME directory and tweak it according to their taste. So the problem I have is that I would like maven to include $HOME in the path when it's running unit tests (in order to ensure that the various property/xml files are loaded). Since we also use Eclipse, it would be convenient if $HOME could be expressed as a so that the Eclipse plugin would add it to the project classpath. In this way the same properties would apply regardless of whether the unit tests are being run from the command line or within Eclipse. I guess this is related to the whole are of runtime dependencies. Any ideas? Thanks, ct - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How can I specify the that $HOME should be in the classpath
Hi, I'm wondering how I can specify that $HOME should be added to the classpath before running unit tests and when generating the project files using the eclipse plugin. Thanks, ct - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: target/test-classes and Eclipse plugin
Ben Walding wrote: I believe I fixed this in CVS some time ago, there is a release coming out shortly that will include this fix. Cheers Ben. I'm afraid to work from CVS at the moment (too much at stake) so I'll wait for the release. Thanks, ct - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
target/test-classes and Eclipse plugin
Hi, For some reason the following dependency is being generated by Maven when I invoke "maven eclipse" When I refresh in Eclipse it (Eclipse) complains as follows: "Missing required library: 'my_project/target/test-classes' If I manually remove the above XML from the Eclipse .classpath file and refresh, everything works fine. My questions is how do I stop the Maven Eclipse plugin from generating that dependency in the first place. Thanks a million, ct - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Cascading dependencies
Brett Porter wrote: Not yet. Search the archives and JIRA for "transitive dependencies". Cheers Brett. ct - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Cascading dependencies
Hi, I've got two projects (two different cvs modules): - Project A (library to be used by other projects) - Project B is a webapp Project B has a dependency on Project A. Project A has dependencies on a number of third-party libraries. When I do a 'maven war' on Project B, is it possible to have maven bundle all of Project A's third-party libraries into the resulting war file? Thanks a million, ct - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Maven and XDoclet templates (repost with clarification)
Konstantin Priblouda wrote: I would need to look into plugin.jelly to tell you that. It would be faster, if you do it yourself... I'll bet you it's not - my knowledge of Jelly is minimal. [ I do not memorize files with over 10K lines... ] The plugin.jelly for maven-xdoclet (well at least the one from beta-10) only has 9960 lines ;-) Thanks anyway, ct - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Maven and XDoclet templates (repost with clarification)
Konstantin Priblouda wrote: It depends whether you use plugin goals or set up ant targets in maven.xml If you use xdoclet:webdoclet then you can specify properties in project.properties / build.properties like: maven.xdoclet.webdoclet.jsptaglib.0=false So, how should the property be named in project.properties in order to get the httpPort to evaluate to 80? Thanks, ct - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Maven and XDoclet templates (repost with clarification)
I'm using XDoclet to generate my web.xml and it's working just fine. However, I'd now like to parameterise the web.xml generation using XDoclet templates within files in my merge dir. For example, listenPort_http Will result in the following being generated to web-xml: listenPort_http 80 If I've set httpPort=80 somewhere. I've no problem setting this from ant, but can someone let me know how to this from Maven (project.properties or maven.xml?). Thanks, ct - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Maven and XDoclet templates
Hi, I'm using XDoclet to generate my web.xml and it's working just fine. However, I'd now like to parameterise the web.xml generation using XDoclet templates. For example, listenPort_http Will result in the following being generated to web-xml: listenPort_http 80 If I've set httpPort=80 somewhere. I've no problem setting this from ant, but can someone let me know how to this from Maven (project.properties or maven.xml?). Thanks a million, ct - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
classpath for JUnit and Eclipse plugin
Hi, I've got a bunch of unit tests in a project and some of them need a database to run. I'd like to be able to add my home directory to the classpath so that log4j.properties and hibernate.properties are picked up. Is there any way to add ${user.home} to the classpath so that 1. It will be in the classpath when 'maven test' is executed 2. So that the eclipse plugin adds it to the list of directories to put in the eclipse classpath for the project. Thanks, ct - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
unit test resources
Hi, I've written a number of unit tests for a project and some of these tests require data files (*.dat) in order to run. I'm having trouble getting Maven to put these .dat files into target/test-classes/com/foo/bar as part of the build process. Thus the tests are failing when I run: maven jar Can anyone tell me the syntax to use in the part of the pom so that **/*.dat are copies from src/test to target/test-classses Thanks, ct - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]