When I run
mvn versions:display-dependency-updates
Only some of my dependencies are processed.
For instance I have this dependency.
<dependency>
<groupId>com.github.kagkarlsson</groupId>
<artifactId>db-scheduler-spring-boot-starter</artifactId>
<version>6.2</version>
</dependency>
Im not informed that there is a version 6.6 available. Why is that?
Im using maven 3.6.0
Check if your project pom.xml or your maven settings.xml is not overriding the central repository, if central repo is customized, it may not contain the recent version of this dependency
Related
We are using the dropwizard-flyway library from https://github.com/dropwizard/dropwizard-flyway and want to use flyway Enterprise because we have SQL Server 2012. How can we get the license information into the dropwizard-flyway library?
We are trying out the trial version of flyway Enterprise and noticed that it installs its JARs into the maven repo org\flywaydb\trial.... Does this mean that we have to change our maven dependencies for flyway components from org.flywaydb.* to org.flywaydb.trial.* in order to use the trial version?
For others who may run into the same issue, this is how I eventually fixed it:
Download and unzip the flyway enterprise trial version
Navigate to the directory you unzipped into
Run installToLocalMavenRepo.cmd
Run deployToRemoteMavenRepo.cmd - here you will need your remote repo ID and URL. I found these in my distributionManagement section in my projects POM.XML file.
In your project POM.XML file - add an exclusion for flyway-core to the dropwizard-flyway artifact as follows:
<dependency>
<groupId>io.dropwizard.modules</groupId>
<artifactId>dropwizard-flyway</artifactId>
<version>5.0.7</version>
<exclusions>
<exclusion>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
</exclusion>
</exclusions>
</dependency>
Add a dependency to flyway-core trial version as follows:
<dependency>
<groupId>org.flywaydb.trial</groupId>
<artifactId>flyway-core</artifactId>
<version>5.0.7</version>
</dependency>
You should now be good to go.
I'm trying to write a Jenkins plugin that uses YUI compressor. Is it possible somehow to bundle the yui jar file with/inside my pluigin?
Yes it is possible. You need to add the dependency into the pom.xml file (assuming you are using Maven) and when you build the hpi file it will include it
add
<dependency>
<groupId>com.yahoo.platform.yui</groupId>
<artifactId>yuicompressor</artifactId>
<version>2.4.7</version>
</dependency>
into you dependencies - taken from here http://mvnrepository.com/artifact/com.yahoo.platform.yui/yuicompressor/2.4.7
In a simple java program, How can I download a JAR from a Maven repository ?
The repository can be local as well as remote ? I am using Maven 3.
As noted by #amit your use of Maven-3 is not relevant. Your application is interested in accessing a JAR at runtime. It just so happens that this JAR is available at a Maven repository. Maven is a build-time tool. It cannot help you at runtime.
So if we have interpreted your question correctly, the issue is one of formulating the URL and making an HTTP request. Since you say the JAR is hosted by a Maven repository you know the format of the URL:
http://repository.url/group_id_segments_separated_with_slashes/artifact_id/version/artifact_id-version.jar
You can take advantage of this in your program if you need to access more than one JAR in this fashion.
define the necessary mapping for dependency tags in POM.xml and than provide repository information inside repository tags... for example..
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-server</artifactId>
<version>1.11</version>
</dependency>
and
<repository>
<id>snapshot-repository.java.net</id>
<name>Java.net Snapshot Repository for Maven</name>
<url>https://maven.java.net/content/repositories/snapshots/</url>
<layout>default</layout>
</repository>
see more about this here
I am trying to build a simple webapp that uses spring webflow. I am having trouble retrieving the webflow dependency (I'm using maven 3).
<dependency>
<groupId>org.springframework.webflow</groupId>
<artifactId>spring-webflow</artifactId>
<version>2.3.0-RELEASE</version>
</dependency>
When I run a mvn clean install -X (from the command line), I get the following...
Failed to execute goal on project blah-webapp: Could not resolve dependencies for project cnm3:blah-webapp:war:1
.0-SNAPSHOT: Failure to find org.springframework.webflow:spring-webflow:jar:2.3.0-RELEASE in http://repo1.maven.org/maven2/ was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced
I can see that the jars are available at http://repo1.maven.org/maven2/org/springframework/webflow/spring-webflow/
anyone come across this?
The correct version value is 2.3.0.RELEASE
I'm using IntelliJ IDEA 10.0.2 (with groovy/grails support), maven 2.2.1 and grails 1.3.6.
We have a big maven project, which depends on many other maven projects. Let's say the workspace structure looks as follows:
backend-project (Java project, without further project dependencies)
output-project (Java project, without further project dependencies)
frontend-project (Grails project, which dependes on both, backend and output)
That means, within my frontend-project's pom.xml I have defined 2 Project Dependencies:
e.g.
<dependency>
<groupId>com.company.project</groupId>
<artifactId>backend-project</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.company.project</groupId>
<artifactId>output-project</artifactId>
<version>${project.version}</version>
</dependency>
Let's assume that I change some Java Source within the output or backend project. When I
run the grails application now, then it won't consider the changes. I have to publish the changed artifact locally and then resolve it again by the grails project before running the application in order to take effect.
This tells me that the grails project just depends on the project dependency jars within the maven repository and does not care about any existing project dependency "sources" within the workspace.
Does it have to be that complicated and if so, why?
Note that if my frontend project was a spring web project, the changes will be seen in IDEA and tomcat will even reload the change dynamically.
Note that when IDEA recognizes a mavenized grails project, it won't run the grails project with: "grail run-app" anymore but with a more complicated version of: "mvn grails:exec -Dcommand=run-app". Don't know if this is of any relevance..
Thanks!
Mr. Slash
Maven always picks up the jar files from the repositories (local and then remote etc depending on your pom.xml config).
Think about it: How would your main project know where the backend-project or the output-project files are located?
If you want a direct dependency then remove it from pom.xml and modify the project build path to directly add the projects' outputs to your main projects. In Eclipse open the properties page of the main project => build path => projects => add.