SBT - bad revision found - maven

I get an error:
expected='2.0.0-SNAPSHOT found='${jpacontainer.version}'
Vaadin snapshot repository: bad revision found in
http://oss.sonatype.org/content/repositories/vaadin-snapshots/com/vaadin/addon/jpacontainer-addon-agpl-3.0/2.0.0-SNAPSHOT/jpacontainer-addon-agpl-3.0-2.0.0-20120117.082939-16.pom:
expected='2.0.0-SNAPSHOT found='${jpacontainer.version}'
while resolving dependency
val vaadinJPA = "com.vaadin.addon" % "jpacontainer-addon-agpl-3.0" % "2.0.0-SNAPSHOT"
Do you know how to fix this?
This is the POM: https://oss.sonatype.org/content/repositories/vaadin-snapshots/com/vaadin/addon/jpacontainer-addon-agpl-3.0/2.0.0-SNAPSHOT/jpacontainer-addon-agpl-3.0-2.0.0-20120117.082939-16.pom

The POM file is invalid. The POM is a module's meta data file and should list the correct version. This is what is causing your problems.
Snapshots have a tendency to be unstable (not always a good idea to use them).
Options?
Use a different snapshot module version.
If you really need this particular jar then I'd advise downloading it directly as follows:
https://oss.sonatype.org/content/repositories/vaadin-snapshots/com/vaadin/addon/jpacontainer-addon-agpl-3.0/2.0.0-SNAPSHOT/jpacontainer-addon-agpl-3.0-2.0.0-20120117.082939-16.jar
Update
That module is plain broken :-(
The jar can be found when browsing the file storage as follows:
https://oss.sonatype.org/index.html#view-repositories;vaadin-snapshots~browsestorage~/com/vaadin/addon/jpacontainer-addon-agpl-3.0/2.0.0-SNAPSHOT/jpacontainer-addon-agpl-3.0-2.0.0-20120117.082939-16.jar
This explains why the following dependency declaration in Maven might work:
<dependency>
<groupId>com.vaadin.addon</groupId>
<artifactId>jpacontainer-addon-agpl-3.0</artifactId>
<version>2.0.0-SNAPSHOT</version>
</dependency>
Without a proper POM the Nexus index will not be updated properly
https://oss.sonatype.org/index.html#nexus-search;gav~~jpacontainer-addon-agpl-3.0~2.0.0-SNAPSHOT~~
As you can see the jar is missing... So jar is present, repository index is unreliable

Related

Proper way to add ojdbc8.jar to Eclipse/maven project

Just joined a company (and an existing project) and first blocker is getting Eclipse/maven/pom.xml to recognize I do actually have the ojdbc8.jar file on my system. Eclipse/maven/pom.xml disagree. When looking at the pom.xml file, Eclipse says "Missing artifact com.oracle.jdbc:ojdbc8:jar:12.2.0.1"
I have tried adding the jar to the "Referenced Libraries". No joy.
I have tried installing maven and then the jar into the maven repo (see this link) which ran fine, but Eclipse/maven still say the artifact is missing.
I guess because Eclipse uses it's own maven repo, but I don't know how to add a jar file to it, or if that is even the right way to do this. ** After reading some more, it appears I have been misled and Eclipse does not have it's own maven repo?**
I also found this at Oracle's website, but it seems like a lot of steps and I already added the jar to my local repo so I don't expect it to help.
I have tried asking my co-worker. No response...
Anyone know how to do this?
So I found this page
which is completely different from anything else I have read (so far). You add the Oracle jdbc file to your Eclipse preferences. Nothing to do with your project. My pom.xml file is not longer red.
<dependency>
<groupId>com.oracle.jdbc</groupId>
<artifactId>ojdbc8</artifactId>
<version>12.2.0.1</version>
</dependency>

How to fix The POM for XXX:jar:1.0 is missing, no dependency information available

We tried to build our project(Spring Boot 2.0.3 with Maven 3.3.9 dependency management)Jenkins Tool(Linux environment).Its saying build failure showing the following message in console "The POM for org.actus:ACTUS-Core-1.0:jar:1.0 is missing, no dependency information available".ACTUS is our custom java library developed by us and its in the local repository also.
This is the first time we started using Jenkins Tool. There are some other modules which depends on this same ACTUS jar.Those are also failing.I have searched for solution on internet.Some people said,make changes to settings.xml file.But in our development machine ,we cant find any such type of settings.xml file(in .m2)
remaining all dependencies are normal spring boot dependencies only.This is the only one external or custom jar.Using mvn install, we kept in maven local repo.
<dependency>
<groupId>org.actus</groupId>
<artifactId>ACTUS-Core-1.0</artifactId>
<version>1.0</version>
</dependency>
I will try to explain as much I can to solve your problem. I hope you are looking for settings.xml to update your maven Nexus repository. If you don't know about nexus repository, it's kind of public repo where you will get all open source dependency.
In your case, from your organization, you should have a private nexus repository and upload ACTUS-Core jar to there.
Then update your settings.xml file to use your company nexus repository. (Please check comments, it will be available in M2_HOME location)
So while you execute mvn install automatically it will upload in your private repository.
Now, in your pom.xml mention the same nexus repository. (It's optional)
Then, in your Jenkins script, you have updated this nexus repo.
So, the key point is you should have your own repo to upload ACTUS-Core jar and need to access the same while you building in Jenkin tool.
OR ELSE
If you find all the above activities in pain / not possible then I can suggest a short cut solution.
Create a lib folder under your project name ( same hierarchy as src) then add your ACTUS-Core.jar and commit that file along with your source code.
Then, update your pom file like below. It will work.
<dependency>
<groupId>com.test</groupId>
<artifactId>test</artifactId>
<version>11.1</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/fileName.jar</systemPath>
</dependency>

selenium-central-framework in pom.xml

I am not able to find any hint about the issue that I am facing and hence posting my question here. Please apologize if it is something silly.
I have some working experience in selenium webdriver. However in my new project, I was asked to use an existing Selenium framework.
In the pom.xml, I am seeing the below dependency (I have edited xxx to avoid displaying the company name)
<dependencies>
<dependency>
<groupId>com.xxxqa.selenium</groupId>
<artifactId>selenium-central-framework</artifactId>
<version>2.0.18</version>
</dependency>
Question :
I couldn't understand from where that dependancy was taken from ?
Solution Tried :
I have tried searching in the maven repository still couldn't find
anything related to "selenium-central-framework"
I have checked the dependencies of selenium RC, but they seems to be different from the one that is present above.
I have researched whether any local jars were used and were linked
as dependancy. However I understand from maven repository, local
repositories will be linked with the tag "systemPath"
<dependency>
<groupId>ldapjdk</groupId>
<artifactId>ldapjdk</artifactId>
<scope>system</scope>
<version>1.0</version>
<systemPath>${basedir}\src\lib\ldapjdk.jar</systemPath>
</dependency>
</dependencies>
Note that the depedency used in my project doesn't have the tag "systemPath".
Is there anyway the external repositories could be added without mentioning systemPath ??
Please help, what could be that dependency ? How to find more information about it. Thanks a ton for your help.
I suggest you one of these approaches:
Jar file
If you have access to the jar file called : selenium-central-framework-2.0.18.jar, open a command line pointing to the folder of this jar and execute:
mvn install:install-file \
-Dfile=selenium-central-framework-2.0.18.jar \
-DgroupId=com.xxxqa.selenium \
-DartifactId=selenium-central-framework \
-Dversion=2.0.18 -Dpackaging=jar
Source code file
If you have the source code of : selenium-central-framework-2.0.18.jar, open a command line pointing to the folder of this source code and execute:
mvn clean install
After one of these approaches, selenium-central-framework-2.0.18.jar will be available in you local maven repository ($HOME/.m2) and your other java maven projects will be ready to use it as dependency:
<dependency>
<groupId>com.xxxqa.selenium</groupId>
<artifactId>selenium-central-framework</artifactId>
<version>2.0.18</version>
</dependency>
This is a workaround if you don't have a server to host an artifact repository management server like :
https://www.sonatype.com/nexus-repository-sonatype
https://www.jfrog.com/confluence/display/RTF/Maven+Repository
Explanation
Almost all free, public, safe, useful and cool java libraries are hosted in https://mvnrepository.com . So any person in the world can use it in their maven project with this piece in their pom.xml:
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.141.59</version>
</dependency>
But in some cases, publish your source code to https://mvnrepository.com is not an option:
Oracle Driver. This driver (.jar) can only be downloaded from the official Oracle page. Private source code like IBM, Microsfot,etc
Source code of your company that should not be public.
Some super cool library that is only in github but not in the maven central repository.
So in this cases, the best and scalable solution is host and configure some artifact repository management server like :
https://www.sonatype.com/nexus-repository-sonatype
https://www.jfrog.com/confluence/display/RTF/Maven+Repository
This platforms are an emulation of https://mvnrepository.com . So with a minimal configuration:
You can host your special or private jars
Your maven projects could use this jars with the standrad xml dependency in pom.xml.
If you don't have a server to implement one of these platforms, the previous approaches could help you and get the same results

Which Geotools jar contains the "Encoder" class?

I am trying to export a JTS object to a KML file. I found here that this could be done using the Encoder class, however I can't seem to find the jar file that contains the given class.
I am using maven, adding a repository is not an option, I must have all the jars used in the company repository so I would like to install the specific jar as a maven artifact manually.
I looked on the Geotools repository, in org/geotools/xml/9.3/gt-xml and in org/geotools/xml/9.3/gt-xsd-kml but I didn't find it.
Please help me.
I finally found it. The class is in gt-xsd-core.jar. The required maven dependency is
<dependency>
<groupId>org.geotools.xsd</groupId>
<artifactId>gt-xsd-core</artifactId>
<version>9.3</version>
</dependency>
I also needed the KMLConfiguration class, which I found in gt-xsd-kml.jar. The required dependency is
<dependency>
<groupId>org.geotools.xsd</groupId>
<artifactId>gt-xsd-kml</artifactId>
<version>9.3</version>
</dependency>

How to know (pragmatically) correct maven artifact-id group-id for a jar name

Could you please let me know if there is any search service available where I can search maven artifact-id, group-id for a jar pragmatically.
The idea is to build a simple tool (may be a jar running from console) which scans my lib directory (for all jar names) and produces a pom file for them.
As of now when I need to generate the pom xml, I do it manually by searching for artifact-id, group-id on
mvnrepository.com/artifact/commons-collections/commons-collections/3.2.1.
I am just thinking of any service which takes jar name (ex. commons-collections 3.2.1) in request and returns the response like below:
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.1</version>
</dependency>
Any pointers to existing tools would be appreciated.
You could choose maven central search capabilities which would result in a list of artifacts. Furthermore the Nexus for Maven Central has REST API which can be used for such purposes.
Apart from the above such a tool which you have in mind wouldn't work cause it must bear in mind that there are transitive dependencies which is simply to solve not to take into the pom file as a dependency.

Resources