I am trying to download the latest build of JFXtras (i want the .jar file) but i can't find it.
For 8.0-r6 i can see some .jar.soc .jar.asc what are those files? https://oss.sonatype.org/content/repositories/snapshots/org/jfxtras/jfxtras-all/
For 8.0-r5 a jar exists but it is empty it has only Meta-Inf http://central.maven.org/maven2/org/jfxtras/jfxtras-all/
How to download the jar or build it?And what are those other files there?I haven't seen them again that's why i am asking..
Problem Converting Project to Maven:
The .jar.asc files contain a PGP signature.
To make maven download the jar from maven central, add the dependency to pom.xml, e.g.
<dependencies>
<dependency>
<groupId>org.jfxtras</groupId>
<artifactId>jfxtras-all</artifactId>
<version>8.0-r5</version>
</dependency>
</dependencies>
Or grab the jars manually from http://central.maven.org/maven2/org/jfxtras/ and add them to your project.
If you want to use the bleeding edge snapshot (currently 8.0r6-SNAPSHOT), you'll need to add the sonatype repository to your pom like
<repositories>
<repository>
<id>snapshots-repo</id>
<name>Sonatype Snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</repository>
</repositories>
And add the current snapshot to the dependencies, e.g.
<dependencies>
<dependency>
<groupId>org.jfxtras</groupId>
<artifactId>jfxtras-all</artifactId>
<version>8.0-r6-SNAPSHOT</version>
</dependency>
</dependencies>
But be aware that they're development versions (unstable), and their availability in that location can be temporary.
To download the -SNAPSHOT jars manually, you go to the sonata snapshot repository, choose the jfxtras package that you want to download, and scroll down to find the jar. They're simply not keeping all the older snapshots.
Related
I have some local jar files in a folder /src/main/resources/foobar under my basepath.
I have them included as dependencies in my POM.xml:
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-models</artifactId>
<version>1.5.4-SNAPSHOT</version>
</dependency>
Now i tried to add them with a local repository:
<repositories>
<repository>
<id>resource-repository</id>
<url>file://${project.basedir}/repo</url>
</repository>
</repositories>
Now still i get the error message that the jars inside this reposirtory not found:
The following artifacts could not be resolved: bar... in file://.../repo was cached in the local repository, resolution will not be reattempted until the update interval of resource-repository has elapsed or updates are forced -> [Help 1]
I have not used the
mvn install:install-file
command for this. And i would be happy if there is a solution where i dont need to do this.
Edit:
The folder structure is:
repo\io\swagger\swagger-models\1.5.4-SNAPSHOT
and Jar inside:
swagger-models-1.5.4-SNAPSHOT.Jar
Funny though i get a warning about a missing POM from this file when running maven install.
You can declare a Repository for your third party dependencies.
The dependencies must be placed inside the repoBase path and the directory for the jar must follow the pattern: "{groupId}/{artifactId}/{artifactVersion}". Inside this folder the jar has to be named "{artifactId}-{artifactVersion}.jar".
Example:
<dependencies>
<dependency>
<groupId>foo</groupId>
<artifactId>bar</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>resource-repository</id>
<url>file:${project.basedir}/repo</url>
</repository>
I have this in my pom (and of course the project-tag and group-id etc.)
I then have a directory repo in my project-directory.
In the path "repo\foo\bar\1.0" i then have a "bar-1.0.jar" file inside this directory. This compiles for me (ok, the jar is empty but this does not matter for an example).
Please note that the url for the repository does not contain the two slashes after the "file:".
I hope this example is a little bit more understandable for anyone who tries to this.
I suggest you to use system tag in your dependency tag. Hope it will work.
I need to include a third party jar to my pom.xml (using Maven 3.2.5 on a Linux environment).
If the jar file is available on the same machine that runs the build I can just declare the dependency in this way:
<dependencies>
<dependency>
<groupId>Foo</groupId>
<artifactId>Foo</artifactId>
<version>Foo-1.0</version>
<scope>system</scope>
<systemPath>/myspace/javalibs/foo-1.0.jar</systemPath>
</dependency>
</dependencies>
But what if the jar is on a different server such as
<repositories>
<repository>
<id>myrepo</id>
<url>http://192.168.0.14/download/java/thirdparty_repo</url>
</repository>
</repositories>
In what element should I specify the name of the jar file?
Remove
<scope>system</scope>
<systemPath>/myspace/javalibs/foo-1.0.jar</systemPath>
from pom and Maven will find the jar in http://192.168.0.14/download/java/maven_repo automatically
Given the following modules in my pom.xml
<modules>
<module>core</module>
<module>middle-layer</module>
<module>top-layer</module>
<modules>
Where top-layer depends on middle-layer which depends on core.
When I run clean install it will build and install core and middle-layer successfully, but not top-layer. It tries to download middle-layer from a remote repository instead of using the freshly built one in the local repository.
I do have a custom remote repository specified in my pom.xml:
<repositories>
<repository>
<id>custom</id>
<url>http://someaddress/maven2/</url>
<snapshots>
<updatePolicy>never</updatePolicy>
</snapshots>
<releases>
<updatePolicy>never</updatePolicy>
</releases>
</repository>
</repositories>
Why does it want to grab middle-layer from the remote repository?
Currently, everything is in SNAPSHOT-mode.
Middle layer dependency:
<dependencies>
<dependency>
<groupId>mygroup</groupId>
<artifactId>core</artifactId>
<version>2.0.1-SNAPSHOT</version>
</dependency>
</dependencies>
Top layer dependency:
<dependencies>
<dependency>
<groupId>mygroup</groupId>
<artifactId>middle-layer</artifactId>
<version>2.0.1-SNAPSHOT</version>
</dependency>
</dependencies>
They all inherent their versions from the parent (currently at 2.0.1-SNAPSHOT) and I'm calling install from the parent pom.
Maven frequently prints messages about downloading things that it is not, in fact, downloading. It is considering the possibility that there is a newer snapshot available remotely than the last one build locally. This is why uploading snapshots is often a really bad idea.
I found the answer.
It was a typical problem between keyboard and chair.
The middle-layer is actually historically a WAR, not a JAR, that is to say: it includes some classes I needed in my top-layer. (It's not really called middle-layer of course).
So top-layer searches for middle-layer.jar and can't find it (because it's a WAR).
So I have to refactor some stuff to get the things I need from middle-layer into a new library JAR and make both middle-layer and top-layer depend on that instead.
Sorry to waste your time. :)
This question already has answers here:
Can I use a GitHub project directly in Maven?
(3 answers)
Closed 2 years ago.
How do I add a Java library from its GitHub repo (the library uses Maven as a build system) as a dependency to my Maven project? Can I do that without downloading and compiling the library?
Now you can import a Java library from a GitHub repo using JitPack.
In your pom.xml:
Add repository:
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
Add dependency
<dependency>
<groupId>com.github.User</groupId>
<artifactId>Repo name</artifactId>
<version>Release tag</version>
</dependency>
It works because JitPack will check out the code and build it. So you'll end up downloading the jar.
If the project doesn't have a GitHub release then its possible to use a commit id as the version.
At the moment there is no way you can do this unless the maintainer of the library provided a way to do this.
So on the title page of the library the should be an instruction containing the repository address like:
<repositories>
<repository>
<id>YOUR-PROJECT-NAME-mvn-repo</id>
<url>https://raw.github.com/YOUR-USERNAME/YOUR-PROJECT-NAME/mvn-repo/</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
</repositories>
And a dependency name:
<dependency>
<groupId>...</groupId>
<artifactId>...</artifactId>
<version>...</version>
</dependency>
This means that all artifact of your project including your dependency will be searched in this repo.
You could also have a glance at pom.xml to check if there was an effort made to deploy artifacts to a remote repo. Typically the keywords are oss.sonatype.org or raw.github.com like in this case.
FYI, here is a way to provide a repo for your gihub artifact: Hosting a Maven repository on github.
Github now supports packages https://help.github.com/en/github/managing-packages-with-github-packages/configuring-apache-maven-for-use-with-github-packages
You can follow the steps above to deploy Jar files to github properly.
Another very nice thing about Jitpack is, it has a lookup button on the main page. And if you type the URL of your GitHub repository, it displays different commits of the source code, and you can select which commit/tag you want. The Jitpack creates pom dependencies for you.
It became dead simple.
I am trying to implement hoptoad in my existing maven project. I ve given the following lines in pom.xml as suggested in http://code.google.com/p/hoptoad/
<project>
<repositories>
<repository>
<id>hoptoad-repository</id>
<name>Hoptoad Repository</name>
<url>http://hoptoad.googlecode.com/svn/maven2</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>code.lucamarrocco</groupId>
<artifactId>hoptoad-notifier</artifactId>
<version>1.8</version>
</dependency>
</dependencies>
</project>
When i try to use the HoptoadNotice in my catch block, i m getting ClassNotFoundException. I am using Eclipse IDE. I am not able to figure out, that the problem is because of inclusion of this code(in pom) or in the IDE. I can understand that the inclusion of these lines alone do not help the code to recognize the jar. So, i tried installing the jar in maven repository. But still it did not help.
Note:- I have not just blindly copied as shown above, directly into the pom.xml. I have included the lines of code wrt <dependencies> and <repositories> blocks.
The maven configuration looks correct.
Make sure that the hoptoad-notifier-1.8.jar is correct deployed.
For an standalone app, this means for example specified in the argument list or the manifiest.
For an web app, it means the jar is copied (by maven, not by you) in the libs folder.