maven-2

How to check pom.xml for updated dependencies

不问归期 提交于 2019-12-03 02:59:25
问题 I am fairly new to Maven and pom.xml. Is there a way I can find out which of my dependencies that are outdated, so that I can update version numbers in my pom.xml. In other languages, for instance, Ruby has the command gem list outdated that gives me a list of dependencies (rubygems) I can update I am using IntelliJ Idea if that can help. 回答1: You can do this with the Versions Maven Plugin. Check the following goals: versions:display-dependency-updates scans a project's dependencies and

Eclipse: Re-run Maven using the -X switch to enable full debug logging

南笙酒味 提交于 2019-12-03 02:57:45
I have a Maven project I'm trying to build/run in Eclipse but I'm getting the error below. How do I do what the error suggests and add the -e or X switches to try to troubleshoot this? [ERROR] Failed to execute goal org.bsc.maven:maven-processor-plugin:2.0.5:process (process) on project glw-crm: Error executing: NullPointerException -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read

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

亡梦爱人 提交于 2019-12-03 02:57:29
问题 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? 回答1: You can parse the maven-metadata.xml to see what

Is there a way to make Maven download snapshot versions automatically?

亡梦爱人 提交于 2019-12-03 02:49:40
So I have a project that depends on a snapshot version of another project. The dependency is: <dependency> <groupId>org.oop</groupId> <artifactId>oop</artifactId> <version>0.9.9-SNAPSHOT</version> </dependency> For the oop project, I did do a 'mvn clean deploy', so the snapshot version should be somewhere in the maven central repository. But when I do a mvn clean install, the snapshot dependency above cannot be resolved and I get this: Missing: 1) org.oop:oop:jar:0.9.9-SNAPSHOT Try downloading the file manually from the project website. Then, install it using the command: mvn install:install

How to deploy OSGi apps and dependencies?

余生长醉 提交于 2019-12-03 02:48: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

How to get Maven project BaseDir() from java Code [closed]

北城以北 提交于 2019-12-03 02:42:06
How to get Maven project basedir() from my Java code? According to Codehaus , there's a maven property ${basedir} If you include a properties file in your resources, which has the ${basedir} placeholder, and enable filtering for the resources plugin , you will find that there's a build time substitution of the basedir into the properties file. You can then load this using a Properties instance in code. in /src/main/resources, create a file called project.properties, containing project.basedir=${basedir} Then, in the POM, enable filtering for /src/main/resources, as outlined in the maven

Wiping out Maven local repository on build machine

旧街凉风 提交于 2019-12-03 02:36:46
问题 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 回答1: 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

How to display a list of available goals?

本小妞迷上赌 提交于 2019-12-03 02:34:52
问题 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? 回答1: 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

How to modularize a (large) Java App?

点点圈 提交于 2019-12-03 02:28:58
问题 I have a rather large (several MLOC) application at hand that I'd like to split up into more maintainable separate parts. Currently the product is comprised of about 40 Eclipse projects, many of them having inter-dependencies. This alone makes a continuous build system unfeasible, because it would have to rebuild very much with each checkin. Is there a "best practice" way of how to identify parts that can immediately be separated document inter-dependencies visually untangle the existing code

Why does a dependency with scope “provided” hide transitive dependencies in Maven?

那年仲夏 提交于 2019-12-03 02:28:48
I have three modules in my Maven project (this is slightly simplified): model contains JPA annotated entity classes persistence instantiates an EntityManager and calls methods on it application creates instances of the classes in model , sets some values and passes them to persistence model and persistence obviously depend on javax.persistence , but application shouldn't, I think. The javax.persistence dependency is moved to a top-level POM's dependencyManagement section because it occurs in a number of submodules where I only reference that entry. What's surprising to me is that I have to