maven-2

How to specify maven's distributionManagement organisation wide?

故事扮演 提交于 2019-12-17 17:18:23
问题 I'm trying to figure out how to organize many (around 50+) maven2 projects, so that they can deploy into a central nexus repository. When using the mvn deploy goal, one does need to specify the target in the distributionManagement tag like this: <distributionManagement> <repository> <id>nexus-site</id> <url>http://central_nexus/server</url> </repository> </distributionManagement> Now, i don't want every single pom.xml (of those 50+) to contain this block over and over again. My first though

Handling unconventional source directory for a web project in maven

£可爱£侵袭症+ 提交于 2019-12-17 16:32:31
问题 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 towards a milestone. Can I configure maven to accept src/ as the java source directory ? Thanks 回答1: Just add this to your pom in the build section. <sourceDirectory

running junits and cobertura with maven

人盡茶涼 提交于 2019-12-17 16:16:37
问题 In our project, we run both junits and cobertura using maven. The problem I am facing is that, junit test cases are running twice, once before the jar creation process and then once again for generating cobertura coverage reports. When running cobertura and junits with ant, we run junits only once since, cobertura runs along with junits. Is there a way to configure the above case with maven. I know we can use "maven.test.skip" property to skip junits. But when I do this, I am not able to see

Maven: add a folder or jar file into current classpath

穿精又带淫゛_ 提交于 2019-12-17 16:06:08
问题 I am using maven-compile plugin to compile classes. Now I would like to add one jar file into the current classpath. That file stays in another location (let's say c:/jars/abc.jar . I prefer to leave this file here). How can I do that? If I use classpath in the argument: <configuration> <compilerArguments> <classpath>c:/jars/abc.jar</classpath> </compilerArguments> </configuration> it will not work because it will override the current classpath (that includes all the dependencies) Please help

How to activate profile by means of maven property?

痴心易碎 提交于 2019-12-17 15:55:09
问题 I'm trying to activate a maven profile using a property defined inside pom.xml : <project> [...] <properties> <run.it>true</run.it> </properties> [...] <profiles> <profile> <activation> <property><name>run.it</name></property> </activation> [...] </profile> </profiles> [...] </project> Apparently it doesn't work. However, activation works from the command line: mvn -Drun.it Is it "by design"? If it is, what is a possible workaround? 回答1: Edit, complete rewrite, as i understand the question

How to call testng.xml file from pom.xml in Maven

被刻印的时光 ゝ 提交于 2019-12-17 15:46:27
问题 I'm using Selenium WebDriver, Eclipse, TestNG and Surefire plugin. I am not able to run testng.xml file from pom.xml. While I'm running pom.xml using mvn test it directly run the file which is in the src/test/java . my pom.xml code is <groupId>angel</groupId> <artifactId>Angel</artifactId> <version>1.0-SNAPSHOT</version> <packaging>jar</packaging> <name>Angel</name> <url>http://maven.apache.org</url> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties>

Create complete EAR Project with Maven and Eclipse Helios

旧时模样 提交于 2019-12-17 15:44:37
问题 I read some articles about how to set up eclipse and maven to create a new empty ear project but all solutions weren't complete or are to old. I believe that I need to create three pom.xml files / or three projects: client project with the WEB-APP structure (like a regular dynamic web project). This should result in a WAR file. server project with the ejbs. This should be a JAR file. ear project which joins both projects together. I tried that with help of the integrated maven plugin in

windows 7 maven 2 install

天大地大妈咪最大 提交于 2019-12-17 15:42:44
问题 I'm about to work through a book, "Flex on Java" and it's asked me to install maven 2+ i downloaded maven from the apache site. Added : M2_HOME = C:\apache-maven-2.2.1 and M2 = %M2_HOME%\bin to the environment vars according to the instructions at http://maven.apache.org/download.html then it gets to number 6 which says "In the same dialog, update/create the Path environment variable in the user variables and prepend the value %M2% to add Maven available in the command line." Which

How does the updatePolicy in maven really work?

£可爱£侵袭症+ 提交于 2019-12-17 15:38:56
问题 When I define an updatePolicy in my maven settings it tells maven how often snapshot artifacts shall be downloaded. If I set it to always it of course downloads every time all snapshots. I was wondering what happens if I set it to the default value daily or another longer peroid. Does maven still check whether a new version of the snapshot is available and if so, does it download it although the policy says daily ? I'm looking for the correct settings to avoid redundant downloads and not to

How do I find out Apache Buildr/Maven 2 repo names

左心房为你撑大大i 提交于 2019-12-17 15:35:19
问题 I'm just starting to use Apache Buildr and I'm constantly running into the problem of not knowing what repo urls and versions are available for me to use. For example I want to use Scala 2.8 in a build file, the id i previously used was: 2.8.0-SNAPSHOT But now this is not found. I also want to use the latest version of Apache POI. If I look on the maven2 repo: http://mirrors.ibiblio.org/maven2/ I can see that it only has up to version 3.2. Is there any standard way of finding repos and