maven-2

m2eclipse not finding maven dependencies, artifacts not found

I'm using m2eclipse as my maven 2 plugin for eclipse. I'm brand new to maven, so my mistake might be simple, although searching has not yielded any solutions for me. I can run maven from the command line and it build successfully. However if I import as an existing maven project, or use mvn eclipse:eclipse and then import I get the ar...

Is it possible to build a zip-distribution that would contain a jar-with-dependencies?

Hi, I would like to produce a binary zip distribution of my project that would contain an uber jar and a set of scripts. Right now, I am using two descritors, first one for the uber jar, and the second for the zip that contains the uberjar + extra scripts and documentation. The problem is that both of these get deployed to maven repo, w...

Maven profile for single module

I have a multi module maven project, which builds successfully, I'd like to build just one of the modules I have. How would I do that with profiles ? I could do it from console in two ways, one way is go to the child module and mvn package or I could use reactor to build just one module. Can I do the same thing with profiles? By modifyi...

Passing JDBC url from Maven to hibernate.cfg.xml

I have a hibernate.cfg.xml with the JDBC Url configured thus: <property name="hibernate.connection.url">jdbc:mysql://${server.hostname}:3306/dsm?zeroDateTimeBehavior=convertToNull&amp;jdbcCompliantTruncation=true&amp;autoReconnect=true</property> Those & are required (instead of just &) in order to avoid the exception: The reference t...

Eclipse, maven and wtp

Hi there, I've installed the m2eclipse plugin with WTP integration in my eclipse workbench. When I use to run the project on a server, the dependencies which has to be provided at runtime (e.g. spring) are not deployed. Is this working like intended? Maybe some of you can provide me the right way. ...

Java environmental variable woes, maven also

So I re-installed java in a directory that doesn't have any spaces in it, as I was having issues with it before. Java JDK is installed in: E:\downloads\java\jdk I created a User variable: JAVA_HOME E:\downloads\java\jdk And my Path looks like: %JAVA_HOME%\bin;%M2%; Now opening a NEW cmd prompt: c:\java 'java' is not recognized...

user specific maven settings in repository

http://maven.apache.org/settings.html As per documentation the user specific settings can be either copied to the .m2 folder or under the maven installation. If a developer changes a machine or gets a new user id, such properties have to be copied manually to these newer machines. Would it be possible to store user specific setting info...

maven conditional dependencies

We would like to bundle library dependencies from (Alfresco or Jackrabbit or ...) based on the customer choice. The number of dependencies actually varies based on the chosen vendor. How do we provide hooks at the maven level, so that the final product just includes the dependent jars as per customer selection. ...

Maven2 not compiling source

Hi, I am new to Maven2 and have been having an issue with the compiling of the source for a RAR. Maven currently copies all the information located at my sourceDirectory instead of compiling it even though the console states that the source is being compiled. If I navigate to the sourceDirectory I find all my source files with no compile...

Managing native libraries with Maven

Hi. Is it possible to manage native libraries (.so) under maven? We use some jars with dependences on external native libs, so I'm looking for some way to mavenize them. Thanks. ...

A Maven2 mojo that uses Hibernate: how to control logging?

I have a maven2 plugin that calls hibernate as configured in a Spring context. Hibernate, of course, logs. I'm trying to control the logging. 0 [main] INFO org.hibernate.cfg.Environment - Hibernate 3.2.6 So, I explicitly put slf4j into the plugin's dependencies, along with the log4j package. And I configure Spring to use log4j, ...

How to add a file to a war with Maven

Hi all, I have developed a maven plugin that downloads the release notes from JIRA. It's bound by default to the 'generate-sources' phase and creates a 'release.txt' file in the build folder (${project.build.directory}). My question: how can I add this file in the 'WEB-INF' folder of the war file built by Maven ? I know I can use the ...

A maven mojo to create os links (ln -s or junctions)

Hi all. Do you know any maven plugin/mojo able to do junction points or links ? ...

Issue in executing Spring Web project in Eclipse on Tomcat server

Hi All, I have a Spring web project that uses Maven to compile/build. There is no issue in building the project. I am trying to run the project in Eclipse (3.3.2) on Tomcat (v6) server. As part of Spring project, I have a spring-servlet.xml file in WEB-INF directory. This file includes another resource xml file that has datasource conf...

How to copy specified files whitout folder structure using overlays?

I would like copy just "file.xml" without folder structure using overlays like this: <overlays> <overlay> <groupId>com.mygroup</groupId> <artifactId>my_comp</artifactId> <includes> <include>WEB-INF/folder1/folder2/file.xml</include> </includes> <targetPath>WEB-INF/otherFolder</targetPath> ...

Error when adding Jar to Maven project

I've added a jar to the 'Referenced Libraries' section in Eclipse, which now allows me to see objects from this jar when coding. However when I build with maven, I keep getting The import ____ cannot be resolved errors. How do I fix this? Do I have to add in the pom.xml? I'm trying use smartgwt.jar. Also - What would be the 'proper' wa...

Problems by import of a multiple modules maven 2 project into eclipse workspace

Hey, I was wondering if someone has experienced the same problem as me and can help me. I have a maven project which contains 6 modules. Some of modules are depending on each other. The project is written in Java and builds to jars, wars and aar. I've been trying to import it to Eclipse with the m2eclipse plug-in. It seems to work fine ...

Maven best practice for generating multiple jars with different/filtered classes ?

I developed a Java utility library (similarly to Apache Commons) that I use in various projects. Additionally to fat clients I also use it for mobile clients (PDA with J9 Foundation profile). In time the library that started as a single project spread over multiple packages. As a result I end up with a lot of functionality but not real...

Maven best practice for generating artifacts for multiple environments [prod, test, dev] with CI/Hudson support ?

I have a project that need to be deployed into multiple environments (prod, test, dev). The main differences mainly consist in configuration properties/files. My idea was to use profiles and overlays to copy/configure the specialized output. But I'm stuck into if I have to generate multiple artifacts with specialized classifiers (ex: "...

Maven : Determine parent POM

Hi there, I have a whole bunch of mavenised projects, and I want to check that each project has the correct version of a parent pom. One way could be to checkout each project in turn, and then have a script that reads the parent section. Or is these some way of determining this from looking at the repository? Has anyone else had to ...