maven-2

What is the difference between artifactId and groupId in pom.xml?

别说谁变了你拦得住时间么 提交于 2019-12-04 16:04:01
问题 How would you explain it to a newbie web developer or programmer with some real world organization example (like say facebook company or Google company)? 回答1: From maven.apache.org, Naming Conventions: artifactId is the name of the jar without version. If you created it then you can choose whatever name you want with lowercase letters and no strange symbols. If it's a third party jar you have to take the name of the jar as it's distributed. eg. maven , commons-math groupId will identify your

How to make maven use system proxy settings

点点圈 提交于 2019-12-04 15:16:23
问题 I'm using Ubuntu with Gnome where I can set network proxy settings (with authentication). The question is: how I can run maven in command line and make it use this proxy? 回答1: There is a java.net.useSystemProxies system property that can be set to true (on Windows and Linux platforms) to tell the JVM to use the system proxy settings. From the Java Networking and Proxies guide: Before we see in details how to write such a ProxySelector , let's talk about the default one. J2SE 5.0 provides a

APT and AOP in the same project, using Maven

岁酱吖の 提交于 2019-12-04 14:56:50
I have to use Annotation Processing (apt) and AspectJ in the same Maven project. Both work for themselves, but I need to create aspects based on code created by apt. So I would need binary weaving (the original source files are extended by apt). How can I enable binary weaving within a maven project? I know the only standard option is to supply a dependency using the weaveDependencies parameter, but this is awful. Is there any other way? OK, I could embed the AspectJ ant tasks using the Maven Antrun Plugin but I'd hate to resort to that. I am apparently the only one who can answer my own

Using maven2 to build autotools-based C/C++ package

孤人 提交于 2019-12-04 14:42:45
I am working on a collection MATLAB, Java, and C/C++ components that all inter-operate, but have distinctly different compilation/installation steps. We currently don't compile anything for MATLAB, use maven2 for our Java build and unit tests, and use autotools for our C/C++ build and unit tests. I would like to move everything to a single build and unit test system, using maven2, but have not been able to find a plugin that will allow the C/C++ codestream to remain autotools-based and simply wrap it in a maven build. Having to rip out autotools support and recreate all the dependencies in

Use an alternative Maven Profile during test phase

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-04 14:02:44
问题 I'm trying to build an application starting from an Appfuse Archetype, but I get some strange problems. For once I'd like to use a hsqldb for automated unit tests and integration tests, and a mysql db for my manual testing so that I can easily manipulate the data when I need to, so it would be nice to automatically switch profiles during the testing phases. Is there a way to do that? 回答1: I'm not sure if this is exactly what you are asking for, but you can do the following to setup multiple

How to handle maven versions in a multi module project?

时间秒杀一切 提交于 2019-12-04 13:49:42
问题 I have a maven project infrastructure like this: /trunk/all/pom.xml /trunk/all/libs/lib1/pom.xml /lib2/pom.xml ... /trunk/all/projects/p1/pom.xml /p2/pom.xml ... You see, I have a lot of libraries and a lot of projects using these libraries. All this is combined to one multi module project, because I like to import the top project into eclipse and have all my libraries and projects available at once only do a single mvn test to compile and test all my code after I've done some global

Maven: How to check if an artifact exists?

允我心安 提交于 2019-12-04 13:43:58
How do I check from within a Mojo if an artifact already exists in the local repository? I'm installing large binaries into the local Maven repository and I need to know if they already exist before attempting to download them. Solved with the help of http://docs.codehaus.org/display/MAVENUSER/Mojo+Developer+Cookbook /** * The local maven repository. * * @parameter expression="${localRepository}" * @required * @readonly */ @SuppressWarnings("UWF_UNWRITTEN_FIELD") private ArtifactRepository localRepository; /** * @parameter default-value="${project.remoteArtifactRepositories}" * @required *

How to configure a longer version Number in artifactory

橙三吉。 提交于 2019-12-04 13:35:08
The version-numbers for our jars have to be longer them x.x.x. We would rather need x.x.x.x to integrate some old-fashioned self-made mechanism. This is, because we tag our software with x.x.x and as soon as we have a delivery to a customer one specific jar has to be build exactly at this point of time to fit to another backend, which communicates with our program. For that reason this one jar has the version 2.3.4.1, when generated and in next delivery of the same Version it is build and named 2.3.4.2. Now artifactory cannot handle this an doesn't save more than x.x.x.2 in some cases. So we

How to use a maven 1 repository with maven 2?

纵饮孤独 提交于 2019-12-04 13:23:28
I am having problem building my project (using maven 2) which references some jars from a maven 1 repository. The scenario: My company has a private maven 1 repository that has the following info: <url>http://my-company-maven1-repo/maven-repository<url> It has the layout of: maven-repository |_repository |_ .... |_ .... |_vectorgraphics |_jars |_freehep_swing-2.0.3.jar |_freehep_io-2.0.2.jar What I have tried: 1. Following the guide here: relevant maven official docs My mvn2 pom.xml: <repository> <snapshots> <enabled>true</enabled> </snapshots> <id>my-repo</id> <-- I made up a temporary id

Maven and native libraries

▼魔方 西西 提交于 2019-12-04 13:09:06
I use maven in my java project, and I don't understand how to add in native libraries. In my non-maven project I did it via CLASSPATH. I use NetBeans and maven in my current java project. If you just want to add the native libraries to the class path, try to put them in src/main/resources . Update: You can specify where resources exist in the 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/xsd/maven-4.0.0.xsd"> <build> ... <resources> <resource> <filtering