maven-2

What is the difference between "mvn deploy" to a local repo and "mvn install"?

My team uses an internal team maven repo that is shared from a development server using Apache. We also run the Continuum CI server on the same machine. Maven builds in Continuum are run with the "install" goal, which copies the final artifact directly into the shared directory. The question is, what is the difference between adding fil...

Is there a way to tell maven where to place the artifacts ?

I am running both maven inside the m2eclipse plugin, windows command line and my cygwin command line. cygwin's bash shell dumps artifacts into the cygwin /home/me/.m2 directory but m2eclipse & windows shell (on vista) uses /Users/me/Documents/.m2 Is it possible to tell the mvn command to use one central .m2 directory ? Thanks ...

Different spring XML files for development environment vs. deployment when using maven

Summary We have a central LDAP server that our deployed Java web app should connect to. Our JUnit tests depend on specific data in the LDAP repository, so they need to connect to an embedded ApacheDS LDAP server, primed with a sample data set. How do we make sure that the ApacheDS server doesn't start up when we deploy our webapp? De...

Maven archetype to generate simple project including site

Is there a Maven archetype that will generate the same scaffolding as maven-archetype-quickstart, but will in addition create the basic project site layout generated by maven-archetype-site? Or do I always have to run each in sequence? ...

How to toggle between one maven profile and another?

If I have a maven profile activated by the presence of a property, how can I define another profile that is only activated when the other profile is not activated? e.g. <profile> <activation> <property> <name>myproperty</name> <value>value</value> </property> <...

Handling unconventional source directory for a web project in maven

I've inherited a web project (Servlets) which is currently build inside eclipse. I want to add maven around it. But the project's source directory is not following the maven convention. Instead of being inside src/main/java, it's src/package/name/... I don't want to change anything right now because they are working at full speed towar...

Doxygen vs Javadoc

I just realized from an article in CACM that Doxygen works with Java (and several other languages) too. But Java has already the Javadoc tool. Can someone explain what are the pros and cons of either approach? Are they mutually exclusive? Is there a Maven plugin for Doxygen? ...

Could "attach source" be made easier for popular Java libraries?

I run into this obstacle when my debugger steps into some classfile without corresponding source. Finding it is often difficult: You have to search for the site hosting the respective project, and find its ``download source'' page (for instance, last time I searched for the JPA API, and it took me hours to obtain the sources). Or, yo...

how to release a project which depends on a 3rd party SNAPSHOT project in maven

i would like to release a snapshot project 'foo-1.0-SNAPSHOT' using the maven release plugin. The project depends on a 3rd party module 'bar-1.0-SNAPSHOT' which is not released yet. I use the option 'allowTimestampedSnapshots' in my project's pom.xml to allow timestamped snapshots but i assume that the 3rd party module (bar) is not times...

How can I convert a DTD to a Schema as part of a Maven or ANT build?

How can I convert a DTD to a Schema as part of a Maven build? Specifically, I am looking for a Maven plugin to which I can give the URL to a DTD and it will generate an XML Schema Definition file. Failing a good Maven plugin, perhaps I can embed an ANT task into my Maven build ...

How to retrieve maven properties inside a JUnit test?

I'm writing a test for a file parser class. The parse method receives a file name as parameter, and must open it in order to parse it ( duh ). I've writen a test file, that I put into the test/resources directory inside my project directory, and would like to pass this file to test my parse. Since this project is in CVS, and will be man...

How do I copy built artifact to a directory on remote Windows server in maven deploy phase?

Hello, could someone provide working example (full maven plugin configuration) how to copy built jar file to a specific server(s) at the time of deploy phase? I have tried to look at wagon plugin, but it is hugely undocumented and I was not able to set it up. The build produces standard jar that is being deployed to Nexus, but I need t...

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

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 ...

How to use maven to export a project from subversion?

Maven has a plugin called maven-scm-plugin, which can interact with source control systems. According to the documentation, I should be able to export a project like this: mvn scm:export -DconnectionUrl=scm:svn:svn://url... -DexportDirectory=./project-export However when I run this command with maven 2.0.9, I got the following error f...

How to move build task into parent POM

I have a POM for my ejb project. In it I have added a maven-antrun-plugin execution step to build websphere ejb stubs during the verify phase. This works but is quite verbose, and as I need to add similiar steps to a number of other ejb projects I want to move the common section to a parent POM for all our ejbs. My first try was to jus...

Creating documentation with maven

Hi, I'm just in the middle of revisiting maven. Our team had a bad experience when we last looked at this, as it was during the period when maven was rearchitecting from 1.x to 2.x, so a lot of the dependencies we needed hadn't been moved across to the new repositories. However, I have the time to reconsider now. I am interested in usi...

Maven compile with multiple src directories

Is there a way to compile multiple java source directories in a single maven project? ...

How to display credits

I want to give credit to all open source libraries we use in our (commercial) application. I thought of showing a HTML page in our about dialog. Our build process uses ant and the third party libs are committed in svn. What do you think is the best way of generating the HTML-Page? Hard code the HTML-Page? Switch dependency-managemen...

List of dependency jar files in Maven

Using Maven 2, is there a way I can list out the jar dependencies as just the file names? mvn dependency:build-classpath can list the jar files, but that will include the full path to their location in my local repository. What I need is essentially just a list of the file names (or the file names that the copy-dependencies goal copie...

How do I assemble a console application with Maven without unpacking all dependencies?

Suppose I have the following directory layout in a Maven project: src/ |-- main | |-- bin | | |-- run.cmd | | `-- run.sh | |-- etc | | |-- common-spring.xml | | |-- log4j.xml | | `-- xml-spring.xml | `-- java | `-- com ... I would like to build a zip file that, when unzipped, produces something like thi...