maven-2

Setup Java 6 annotation processing configuration for eclipse compiler with maven

杀马特。学长 韩版系。学妹 提交于 2019-12-02 16:48:43
What's the best way to setup the eclipse project compiler configuration for Java 6 annotation processors? My solution is to setup the org.eclipse.jdt.apt.core.prefs and factorypath files manually. This is a bit cumbersome: Reference the processor jar in the factorypath file Configure the eclipse annotation processor output directory (org.eclipse.jdt.apt.genSrcDir property in org.eclipse.jdt.apt.core.prefs ) Add the eclipse annotation processor output directory as source folder One problem is that eclipse generated sources will be compiled with maven. Only maven clean compile is reliable as it

How do I find the latest version of an artifact from a maven repository

痴心易碎 提交于 2019-12-02 16:45:32
As part of an automated deployment I need a script to download the latest version of an artifact from our internal repository. Ideally this script will be with ant or a unix shell script. So for example: I have myArtifact.war and it has versions 1.0 , 1.1 and 2.0 - I need the script given the correct group id and artifact id to retrieve version 2.0 from our maven repository (currently using artifactory). Is there any easy way to do this? Rich Seller You can parse the maven-metadata.xml to see what versions are available, and which version is the "release" version. See this answer about plugin

How to deal with relative path in Junits between Maven and Intellij

末鹿安然 提交于 2019-12-02 16:43:31
I have a maven project with a module /myProject pom.xml /myModule pom.xml /foo bar.txt Consider a Junit in myModule which needs to open bar.txt , with maven the basedir is the module directory. So to open the file bar.txt : new File("foo/bar.txt") This works well when you execute mvn test BUT when you launch the same junit in intellij , it fails because Intellij sets the basedir in the project directory, not the module directory. Intellij tries to open myProject/foo/bar.txt instead of myProject/myModule/foo/bar.txt Is there a way to deal with that ? If you want to keep your code, you can try

How to Deploy my Open Source Projects using Maven's Central Repository? [closed]

喜夏-厌秋 提交于 2019-12-02 16:40:51
Is there anything I could do to get my own open source stuff into Maven's Central repository? I've wondered many times how I could get my own projects into Maven's Central repository. I was asking this myself, especially as I've seen some well known projects hosting their own repository, requiring users to add dependency and repository. At the same time, it's getting difficult for other projects to depend on those projects. As I neither want others to add an additional repository nor to host one myself, I'm looking for other ways. And why aren't some projects using the option to deploy to

How to deploy OSGi apps and dependencies?

半城伤御伤魂 提交于 2019-12-02 16:38:34
OSGi seems to have an excellent benefit of having small deployable artifacts by not wrapping dozens of JAR dependencies into a lib directory. However, I can't find anything that tells me an easy, reliable way to deploy dependencies to a container. For instance, I have an application that uses CXF and several Spring subprojects. If I need to deploy this application to a new Glassfish server, what would be the best way to do so, ensuring that all dependencies get installed? I'm using Maven, and it would seem that there could be some way to have a hook that looks at the META-INF/maven directory

Maven or Ivy for Managing Dependencies from Ant?

时光怂恿深爱的人放手 提交于 2019-12-02 16:36:44
I was wondering about the best way to manage projects dependencies from ant. What are the pros and cons of the Maven Ant task and of Ivy? Chris Since what you're wanting to do is add dependency management to an existing Ant project, that's precisely what Ivy's designed to do. Dependency management is a big part of Maven, but far from all of it. Maven is more of a project-oriented tool that does several other things in addition to dependencies. It would be worth considering if you were planning to migrate to Maven and use additional Maven features as well, but it's a bit much if all you'd use

Filtering Maven files into WEB-INF

痴心易碎 提交于 2019-12-02 16:33:14
I am trying to add some filtering to the application context file, which resides in the WEB-INF directory. I have the file which is to be filtered (xmlgateway-context.xml) in the folder /src/main/resources. I have the properties files (config-e05.properties) in the folder src/main/filters And I have the POM set up as follows: <!-- environment profiles --> <profiles> <profile> <id>e04</id> <properties> <targetenv>e04</targetenv> </properties> </profile> <profile> <id>e05</id> <properties> <targetenv>e05</targetenv> </properties> </profile> </profiles> <!-- build settings (filtering) --> <build>

Wiping out Maven local repository on build machine

孤街浪徒 提交于 2019-12-02 16:09:33
On a CI build server, the local Maven repository fills up the file system repetitively (after a few days). What strategy are others doing to trim the local repository in such a case? -Max The Maven dependency plugin has a purge-local-repository goal that allows you to delete the dependencies for a given project from the local repository, if this is run say once a day on each project the snapshots will not accumulate. Alternatively there's a more scorched-earth approach you could take. As the problem is typically the timestamped snapshot artifacts, you could use the maven-antrun-plugin to

How to display a list of available goals?

断了今生、忘了曾经 提交于 2019-12-02 16:08:36
I'm rather new to Maven and I often find myself wanting to see what's actually there in terms of goals. So, is there a command which lists all available goals for e.g. a given prefix? Since Maven is an open system of plugins, the best answer is probably "Google" ;-). If you mean all build lifecycle phases, they are static, and can be found at http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html and at other places. Then, for a given plugin, the help plugin can be used to get the possible goals and all their parameters: mvn help:describe -DgroupId=org.apache.maven

Integrate Protocol Buffers into Maven2 build

妖精的绣舞 提交于 2019-12-02 16:05:02
I'm experimenting with Protocol Buffers in an existing, fairly vanilla Maven 2 project. Currently, I invoke a shell script every time I need to update my generated sources. This is obviously a hassle, as I would like the sources to be generated automatically before each build. Hopefully without resorting to shameful hackery. So, my question is two-fold: Long shot: is there a "Protocol Buffers plugin" for Maven 2 that can achieve the above in an automagic way? There's a branch on Google Code whose author appears to have taken a shot at implementing such a plugin. Unfortunately, it hasn't passed