maven-2

Is there a way to separate long running (e.g. stress tests) out so they're not run by default in Maven 2?

血红的双手。 提交于 2019-12-02 19:43:31
We've had an ongoing need here that I can't figure out how to address using the stock Maven 2 tools and documentation. Some of our developers have some very long running JUnit tests (usually stress tests) that under no circumstances should be run as a regular part of the build process / nightly build. Of course we can use the surefire plugin's exclusion mechanism and just punt them from the build, but ideally we'd love something that would allow the developer to run them at will through Maven 2. Normally you would add a profile to your maven configuration that runs a different set of tests:

unit testing EJBs with Maven 2 and Glassfish 3

瘦欲@ 提交于 2019-12-02 19:38:49
I've been trying to set my application up so that I can unit test it's EJBs all day but I can't seem to get past what seems like a really simple problem. I have a standard Maven web application set up in NetBeans 6.9. I've automatically generated a unit test for one of the EJBs but whenever I go to run it I get the error message: Testcase: initializationError(com.example.ExampleTest): Caused an ERROR Absent Code attribute in method that is not native or abstract in class file javax/ejb/embeddable/EJBContainer java.lang.ClassFormatError: Absent Code attribute in method that is not native or

Maven release via Hudson

ⅰ亾dé卋堺 提交于 2019-12-02 19:34:04
I'm setting up Hudson to use the batch-task plugin to do maven releases to our internal repository. I'm doing it via: mvn --batch-mode release:prepare mvn --batch-mode release:perform I'm interested in other methods people have used and the pros and cons of those methods. Also, any gotchas people have come across. I have tended to do the releases always by hand for a few reasons. First if you have to roll back it's easier when you can go back to the original release location and do it. Secondly because you need to resolve all snapshot dependencies as part of the process. Our development

AspectJ weaving maven modules

只愿长相守 提交于 2019-12-02 19:32:48
I have a project that has multiple maven modules, one of which, contains my aspects. How can I take the aspects and weave multiple maven modules? The documentation for the AspectJ Maven plugin is a little sparse and haven't been able to find many examples. I have tried putting the aspectj plugin in the parent pom but it doesn't seem to apply the advice for the modules underneath it. I also tried specifying the aspectsDirectory property but it didn't seem to have any affect. Perhaps I did it wrong? I think the mechanism is explained pretty well on this page: Using Aspect Libraries Basically:

Nexus supports Mass upload of artifacts?

て烟熏妆下的殇ゞ 提交于 2019-12-02 19:16:47
I wanted to know if we can have mass upload of artifacts to the repository in Nexus. You can do it in a variety of ways: Use the Nexus artifact upload page (note this only works for multiple artifacts with the same groupId and artifactId). Set up a script, with multiple invocations of the maven-deploy-plugin's deploy-file goal , one for each artifact. If you have access to the file system, you can copy the files directly into [sonatype-work]/storage/[repository-name] . If you do this, set up scheduled tasks to rebuild the metadata and reindex the repository. Use the Nexus Repository Conversion

How to create empty folders with maven archetype?

不问归期 提交于 2019-12-02 19:16:06
There is an existing issue for this approach, located on Codehaus JIRA #ARCHETYPE-57 , but all instructions listed in this ticket failed for me. Also the blog post of marekdec How to get maven archetype to generate empty directories fails for me. The trick within the archetype.xml with the trailing / doesnt works for me: <resources> <resource>src/main/webapp/</resource> Unable to find resource 'archetype-resources/src/main/webapp/' Also the fileSet directory in archetype-metadata.xml does not work for me: <fileSet filtered="true" encoding="UTF-8"> <directory>src/main/webapp/</directory> <

Maven - Detect Multiple Versions of the Same Dependency

我怕爱的太早我们不能终老 提交于 2019-12-02 19:13:12
I just experienced a case of two direct dependencies of my maven project having two different versions of a particular transitive dependency. In my particular case I had direct dependencies on the following: <dependency> <groupId>org.jclouds.driver</groupId> <artifactId>jclouds-sshj</artifactId> <version>${jclouds.version}</version> </dependency> and <dependency> <groupId>org.mule.modules</groupId> <artifactId>mule-module-jersey</artifactId> <version>${mule.version}</version> </dependency> Both of these dependencies had a (deep) transitive dependency on com.sun.jersey:jersey-core, but with

eclipse debugger: attaching source-code of maven dependencies?

落花浮王杯 提交于 2019-12-02 19:11:26
I'd like to use the source code of maven-managed dependencies when debugging our webapp in myEclipse 8. I have managed to attach the sources to the libraries in the "Maven Managed Dependencies" classpath container, i.e. when I open a class file from a dependency (e.g. using Ctrl-Shift-T), I see the source code. However, when I define a server connector for my tomcat, deploy the wepapp to it, and launch it in debug mode and execution halts on a breakpoint in that same class, the editor pane only displays the text "source not found", and a button to edit the "source lookup path". I have

Where is log output written to when using Robolectric + Roboguice?

佐手、 提交于 2019-12-02 18:43:36
I'm using Robolectric to test Android. I'm running my tests via maven, e.g. mvn -Dtest=LogTest test If I have code that writes to the logs, such as Log.d("TAG", "blah"); or using Roboguice's Ln Ln.d("blah"); I don't see any output in maven's surefire logs (text files). Ideally, I actually want simple log statements to go to the console. I can write to the console by using System.out.println("blah") , but of course I'd rather use the supported logging APIs. So my question is, why am I not seeing log output at all, and how can I get the log messages written to the console? I am running

Making HTTP post request (with an input type=“file”) from within Maven, using command line parameters if possible

本小妞迷上赌 提交于 2019-12-02 18:29:59
问题 I would like to convert this bash script: #!/bin/bash if ! [ $# == 2 ]; then echo Usage: update-module admin-password module-file exit 1 fi if ! [ -f $2 ]; then echo Error: module file $2 does not exist exit 1 fi curl -c /tmp/cookie.txt -d uname=admin -d pw=${1} http://localhost:8080/openmrs/loginServlet curl -b /tmp/cookie.txt -F action=upload -F update=true -F moduleFile=\@$2 http://localhost:8080/openmrs/admin/modules/module.list rm -rf /tmp/cookie.txt > /dev/null 2>&1 into something that