Maven 2 define a POM property regarding the type of project version

I would like in a maven2 POM to define a property with a different value if I am packaging a SNAPSHOT or a RELEASE (a non SNAPSHOT) of my project. I know that I can write a simple Mojo plugin that defines the property regarding the project.version (contains SNAPSHOT or not), but I cannot imagine that in the Maven's hell of existing plugins there is not already one that I could use. If you know a way of doing this, I would appreciate your help. Matthieu

Maven 2 How to make maven place all jars common to wars inside the same EAR to EAR root?

We have a solution with numerous wars. Wars are similar in the sense they all use hibernate and spring. This means that we have a number of same jars inside each war. This is becoming a problem, because the size of the ear is starting to grow out of proportion. I would like to use Maven to calculate dependencies and to place all jars common to multiple wars to the root of the EAR. I tried organizing my project using j2ee archetype (maven-archetype-j2ee-simple), but all wars are still packaged

Maven 2 Accessing an Artifactory/Maven Repo that requires basic-auth

I have an Artifactory repo that sits behind basic authentication. How would I configure the settings.xml to allow access? <mirrors> <mirror> <id>artifactory</id> <mirrorOf>*</mirrorOf> <url>https://myserver.example.com/artifactory/repo</url> <name>Artifactory</name> </mirror> </mirrors> <servers> <!-- This server configuration gives your personal username/passwor

Maven 2 Recommended solution for splitting up Maven projects?

What is the best way to split up a large enterprise project in Maven? It's easy enough to understand how to partition things vertically like this... You have a DAO project The DAO project is a dependency of the Service project The Service project is a dependency of the web project. Does anybody have input on best practices in partitioning/splitting up really large projects in Maven.m

Maven 2 Maven - Include dependent libs in jar without unpacking dependencies?

We're trying to build a client jar that includes unpacked dependent jar's. And the manifest should have class-path entries to the dependent jars. The snippet below works but the jars are unpacked - how can we stop the jars from being unpacked? <plugin> <artifactId>maven-assembly-plugin</artifactId> <configuration> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef>

Maven 2 Maven: deleted files (antrun) still in final war file

I use the antrun plugin to delete and move some property files depending on the profile that is used: <plugin> <artifactId>maven-antrun-plugin</artifactId> <executions> <execution> <phase>compile</phase> <goals> <goal>run</goal> </goals> <configuration> <tasks> <delete> <fileset dir="${project.build.outputDirectory

Maven 2 maven jdepend fail build with cycles

Is there way to use the jdepend plugin in maven to fail a build when package cycles exist? I know you can do it fairly easily with ant, but I haven't figured out how to do it with maven. thanks, Jeff

Maven 2 How well does m2eclipse deal with maven plugins?

In general, how well does m2eclipse deal with Maven plugins that modify or amend lifecycle phases? In particular, I have a project that has a maven-clean-plugin extension to remove an extra generated directory (not in target/) using the configuration filesets tag. This works when running mvn at the command line but not when doing a clean in Eclipse. Is there any way to get m2eclipse to process that plugin? Another example is flexmojos; there's a lot that can be configured with the flexmojo p

Maven 2 How to build renamed POM xml

I am relatively new to Maven. I actually wanted to know how to build the renamed pom.xml i.e. there is a XML file with the name parent-pom.xml. Shall I directly name it to pom.xml and try building it or is there some other way to do it?

Maven 2 Binary output and testing for Eclipse plugins

I am developing an Eclipse plugin and I use maven to coordinate my source structure. In order to compile the plugin I use the tycho extension for maven. However, I was wondering how to execute unitests. I want to use the surefire plugin for testing as I additionally use a sonar server for source code quality management. Unitests are applyed if I use eclipse-test-plugin as package target. However, I want to make use of the default surefire plugin for applying unitests. Now I figured out that th

Maven 2 Copy artifact in Artifactory to a remote repository

I have the following setup: Development server for continuous build with Hudson, Maven and Artifactory up and running. I am able to build an artifact by Maven, and let Hudson deploy it to Artifactory. However, I would like to do the following: Select an artifact in Artifactory on the local build server. Deploy that artifact to a remote repository without doing a new build. The reason I want to do that is, that the first server is a development server where new artifacts are changed at wi

Maven 2 Jenkins slave throws "Classloading from system classloader disabled" exception

When running a Maven2 job on a slave instance (Master on AIX 5.3; slave on Windows 2008(R2)), I get the following message (complete stack trace pasted in below): "java.lang.ClassNotFoundException: Classloading from system classloader disabled". This happens with the first job after the slave instance is started (it's running as a Windows service). After that, I get a "java.lang.NoClassDefFoundError: Could not initialize class hudson.maven.MavenModuleSetBuild" error. If I create a freestyle job,

Maven 2 SVN Backed Maven Repo

We are using SVN as a Maven Repositary. We knew that it isn't advisable to have SVN backed maven repository, but still we have to go with it due to limitation within our organization. SVN backed repository used currently is partially implemented.We have developers working from two different geographical location. Problem we face now is whenever a developer adds a artifact to maven repo(svn repository) all other developers have to update the local svn view manually to get the newly added artifact

Maven 2 How to make release version of maven-metadata.xml to be HIGHEST version number?

I have a project A which needs AAA:BBB as a dependency. < dependency> < groupId>AAA< /groupId> < artifactId>BBB< /artifactId> < version>RELEASE< /version> < /dependency> After deploying a branch version(say, 0.2.1-4) of AAA:BBB, release version number is the latest deployed version number (0.2.1-4), not the HIGHEST number(0.3.3). maven-metadata.xml: < metadata > < groupId >AAA< /groupId > < artifactId>BB

Maven 2 Maven webstart plugin not finding dependencies

Hoping someone can help me with this strange one. I’m trying to run the webstart plugin but it doesn’t seem to be able to find the main class within the jar being produce. The pom is as simple as it can get, and the class Test exists, and is being compiled and placed in the jar. Can someone please point me in the right direction? <project> <modelVersion>4.0.0</modelVersion> <name>Desktop Components</name> <groupId>com.test</groupId> <artif

Maven 2 How do I remove a Hudson Upstream Project relation?

I used to have one job, which I split into two. For some reason, the new split-off job treats the first as an Upstream Project. I'd like to remove this relation, but can't find the configuration for it on disk, or in the Hudson UI (ver. 1.312) Note: the new job, like the old one, is maven2. There is no reference/relation between the POMs at all. How can I remove the Upstream Project relation, or at least find where it is declared on disk?

Maven 2 JAVA_HOME gets mangled by Maven

I'm retrofitting bunch of existing Java projects with unified Maven build. Since each project is mature and has established Ant based build all I'm using maven-antrun-plugin to execute existing build.xml as follows: <plugin> <artifactId>maven-antrun-plugin</artifactId> <executions> <execution> <phase>compile</phase> <configuration> <t

Maven 2 maven assemblies. Putting each dependency with transitive dependencies in own directory?

I have a maven project which consists of a few modules. This is to be deployed on a client machine and will involve installing Tomcat and will make use of NSIS for installer. There is a separate application which monitors tomcat and can restart it, perform updates, etc. So, I have the modules setup as follows: project +-- client (all code, handlers, for the war) +-- client-common - (shared code, shared between monitor and client) +-- client-web - (the war, basically just uses war has a

Maven 2 axis2 maven example

I try to use axis2 (1.5.1) version to generate java codes from wsdl files, but I can't figure out what is the correct pom.xml <build> <plugins> <plugin> <groupId>org.apache.axis2</groupId> <artifactId>axis2-wsdl2code-maven-plugin</artifactId> <version>1.5.1</version> <executions> <execution> <goals> <go

Maven 2 maven antrun copy resources to base target directory

I'm learning how to use maven for my standalone java apps but I don't understand how to do a recursive copy of all directories from /src/main/resources to /taget directory. I tried using antrun and resources plugin, but resources are copied to /target/classes and not to /target. What is wrong here? <build> <pluginManagement><plugin> <artifactId>maven-antrun-plugin</artifactId> <version>1.4</version> <executions> <execut

Maven 2 How to use javadoc:aggregate properly in multi-module maven project?

This is my parent pom.xml file (part of it) in a multi-module project: ... <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> </plugin> </plugins> </build> ... This plugin is inherited in all sub-modules and I don't think it's a correct approach. When I'm running mvn javadoc:aggregate the documentation is generated in tar

Maven 2 Maven dependancy on another non-repository project?

I have 2 completely separate projects where one depends on the other. I've very recently mavenized the main project but can mavenise the dependency if absolutely necessary. Originally these were Netbeans projects, with the main project having several modules. What I liked is that I could declare the dependency as a dependent project. This allowed me to use the most recent code as it changes a lot (the project is in its infancy). NetBeans would put the dependent project on the classpath when run

Maven 2 Multi-webapp Maven 2 project -- how to build a single webapp?

I have the following source layout: . ├── pom.xml ├── modules (has pom) │ ├── module1 (has pom) │ └── module2 (has pom) │ └── moduleN (has pom) └── webapp1 (has pom) └── webapp2 (has pom) webapp1 and webapp2 depends on all of the modules (the modules being DAO, services, etc). At the moment, I build everything from the root and mvn package gives me two WAR files. How do I build only webapp1 or webapp2? If I cd into webapp1 and run mvn package it says it can't download moduleX.jar (th

Maven 2 Maven: Using inherited property in dependency classifier causes build failure

Given three POM files: C depends on B. B inherits from A. I can build A and B C fails to build because of its dependency on B. The full source-code and build output is included below for your review. Here is A's POM: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId&

Maven 2 Running Netbeans Maven Scala application from command line

I have a Scala project based on the "a simple scala project (1.2)" archetype that I've imported into Netbeans 6.9.1 as a maven project wtih existing pom. I can successfully run this project from inside Netbeans, but can't figure out how to run it from the command line. I saw a couple similar questions, but wasn't able to apply them to my situation successfully. When it runs in the IDE, the command that executes is: mvn -Dexec.classpathScope=runtime -Dexec.args=-classpath %classpath com.senti

Maven 2 building a jar and including it in a zip with maven-assembly-plugin

I have a mavenized java project (Maven2) which I want to build into a jar, which is easy enough by supplying the jar-with-dependencies descriptorRef in the pom.xml. However I also need to deploy my project in a zip with some .exe and .bat files, among others, from a bin folder that call the jar. (I am using Tanuki but it does not matter for the use case I think) In other words, I need a build in which first my sources (and dependencies) are packaged into a jar and that jar is then put into a z

Maven 2 Should Maven multiple module projects have a src directory in the parent?

The Maven Checkstyle Plugin - Multimodule Configuration Guide has a src directory in the parent project. I have no idea what would go in here since I thought any src directories would go in the modules themselves. So, should Maven multiple module projects have a src directory in the parent? And if so, what would go in there that wouldn't belong in a sub-module? Thanks!

Maven 2 Adding Dependencies in pom.xml

I am creating a project which will have oracle 10g/11g at its back end. For that I need ojdbc.jar. The problem is whenever I add ojdbc14.jar and save in pom.xml (I use m2eclipse plugin)it gives me a weird error 'Missing artifact com.oracle:ojdbc14:jar:10.2.0.4.0:compile'. whenever I remove this jar file from pom.xml the error disappears. I don't get why this is happening ?? What is the solution for this ???

Maven 2 EclipseLink Maven Repository not working correctly?

I'm trying to get the EclipseLink libraries from the given Maven repositories. I read the tips given in Where did the EclipseLink/Maven repository go to? on stackoverflow and tried to integrate the Maven repositories posted there into my settings.xml. I added those links to my settings.xml and also tried my pom.xml but when trying to update the indexes I only get Resource nexus-maven-repository-index.properties does not exist from all of them. Here's what I've configured in my setting

Maven 2 How to configure Maven-exec plugin with java classpath

i am trying to run the maven-exec plugin with referring the jar file as classpath like this <configuration> <executable>java</executable> <longClasspath>true</longClasspath> <commandlineArgs>-classpath jarfile; Sample </commandlineArgs> </configuration> but my classpath is not set properly thus thrown an classNotFoundException. How to configure this?

Maven 2 Maven not picking up property defined in settings.xml in .m2

I have defined the property like so: <profile> <id>dand</id> <properties> <workSpace>s:/_java/</workSpace> </properties> ...repos </profile> <activeProfiles> <activeProfile>dand</activeProfile> </activeProfiles> I am attempting to access the property with <outputDir>${workSpace}/src/main/java</outputDir>

Maven 2 Maven assembly of assemblies

I have a multi-module maven 2 project which uses assemblies (via maven-assembly-plugin at the package phase) to package each module in a certain way. I am then trying to use another module to combine these assemblies into a distributable "installer" package. For the installer module I can see the default jar from my other projects but nothing I do seems to give me access to the extra assemblies. It seems from the documentation that this should be possible so I assume I'm either doing somethi

Maven 2 Recompile Dependencies in Maven 2

In the pom for a webapp, I'm looking for a way to recompile the local source code for two dependencies, then copy those jars over to the webapp's WEB-INF/lib directory. Is there a Maven 2 plugin that would allow me to do this, or some better approach using Maven 2?

Maven 2 Auto deploy on save Netbeans entreprise project using maven

I have a NetBeans mavenized project Contaning: web project (war) ejb project (jar) parent project maven project After every change I must clean an build the maven project and Run the Parent project How canI configure my projects to auto deploy on save ? the configuration file(nb-configuration.xml) is as follows : <?xml version="1.0" encoding="UTF-8"?> <project-shared-configuration> <!-- This file contains additional configuration written by mo

Maven 2 Ejb3 JNDI name with openEJB & maven

My maven 2 project (under windows) simple contains an ejb package demo; import javax.ejb.Stateless; @Stateless public class MyEjb { public String sayHello() { return "Hello World from MyEjb"; } } a test class package demo; import java.util.Properties; import javax.naming.InitialContext; public class TestMyEjb { public static void main(String[] args) throws Exception { Properties p = new Properties(); p.put("java.naming.factory.initial","org.apache.o

Maven 2 Maven Multi-Module builds not honoring failsafe-maven-plugin?

I recently discovered that Hudson was not the problem. In actuality it was Maven itself as the multi-module build was causing the build failure, not Hudson. I just hadn't noticed where the issue actually existed. Leaving the original question here. I'm using the failsafe-maven-plugin to run some integration tests. The difference between failsafe and surefire is that failsafe allows failures and does not fail the build. On my nightly builds there are occasions that a service the integrati

Maven 2 maven report on licenses your project depends on

I've got a big multi-module project, and I'd like to generate a report that shows all the licenses of all the things the project depends on. I looked at tattletale, but it doesn't seem to do the trick. And I can easily find a plugin that will squirt a license into the top of each source file, but this exact thing is defying my googling.

Maven 2 Maven dependency management

Our project has a dependency like <dependency> <groupId>apollo.components.cots</groupId> <artifactId>cots-wfs</artifactId> </dependency> And as far as I understand, maven2 will get the latest artifact for cots-wfs, say <version>2.3-20101111.000000-13</version> The problem is, when we branch the project, the dependency stays the same, and when other developers release a new cots-wfs say <version>2.3-20101222.000000-13</versi

Maven 2 Ignoring report generation for specific classes in cobertura maven plugin

I've been using Cobertura plugin for report generation and instrumentation (with surefire). Here is the issue I am facing: I am unable to make the plugin ignore report generation for specific classes in my project. PF below the related excerpt from pom.xml, I have added the ignore tag, but that just ignores instrumentation for the ignored classes. I want the report for specific projects to not be generated at all. Firstly, due to my limited knowledge of both Maven and Conberture, I want

Maven 2 Filter filenames in Maven

I'd like to be able to filter filenames as well as file contents in Maven. The below snippet enables filtering on file contents, but I need to be able to rename files too. The usage scenario is that I'd like all static resources in my webapp to be numbered, so they can be treated as different versions by Amazon's CloudFront. Naturally managing the numbers manually would be impractical, so I'd like the build process to do this. For instance a file called logo_VERSION.jpg would end up being

Maven 2 Maven : How to use Maven for generating Spring and CXF Support Application

I need to create a Simple web Application with Spring and CXF Setup I am using apache-maven-3.0.3 Support for this. Please tell me what me what number to enter in mvn command prompt , to generate those required artifacts for this. I tried this way , it only generated the Java Interface and Implementation class HelloWorld 2. HelloWorldImpl and two xml files inside WEB-INF beans 2. web But i don't know why no jar files have been got created. I tried this way Choose a number o

Maven 2 Maven: trigger task to upload dependency into Nexus if dependency is not there at the build time

I have Maven2 project. This project have 1 internal dependency which stored in internal (for our company) Sonatype Nexus. I setup the dependency version in pom.xml as parameter which I provide via Jenkins. Sometimes I do not have proper dependency version in Nexus so my build can fail on donwload dependency step. I want to add ability to trigger special task (script) if dependency is not found to upload this dependency into Nexus and continue the build. Can I do so? I think about fake build f

Maven 2 Java deprecated API using Xlint:deprecation

I want to remove all use of deprecated API's in my code. But for few API's I get this message upon compiling. [Some input files use or override a deprecated API. Recompile with -Xlint:deprecation for details.] With what maven command can I use to get the details of the deprecated API? What should my approach be to finding the deprecated API?

  1    2   3   4   5   6  ... 下一页 最后一页 共 9 页