Trouble downloading non-JCenter artifacts from bintray - maven

My organization is attempting to release some open source into this world and we are starting with some of our libraries. Currently what I have is published some artifacts into the organization's location. They are available here and can be seen here:
They are not currently linked to JCenter, because I am OK for now using the explicit repo provided.
However any attempt to resolve them through maven results in:
http://dl.bintray.com/bds/sdk/
[ERROR] Failed to execute goal on project protex-plugin-integration: Could not resolve dependencies for project com.blackducksoftware.plugins:protex-plugin-inte
gration:jar:1.1.1: The following artifacts could not be resolved: com.blackducksoftware.protex:protex-sdk-client:jar:6.4.2, com.blackducksoftware.protex:protex-
sdk-utilities:jar:6.4.2: Could not find artifact com.blackducksoftware.protex:protex-sdk-client:jar:6.4.2 in bintray-bds-sdk (http://dl.bintray.com/bds/sdk) ->
[Help 1]
This is odd to me since the files are definitely visible via said URL.
Is what I am doing impossible and I must submit to JCenter and be accepted first?
The pom contains:
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>bintray-bds-sdk</id>
<name>bintray</name>
<url>http://dl.bintray.com/bds/sdk</url>
</repository>
</repositories>

Your repository is well configured in the POM, but the error reported is true: In the http://dl.bintray.com/bds/sdk/com/blackducksoftware/protex/protex-sdk-client/6.4.2 location you cannot find the protex-sdk-client-6.4.2.jar library; the only existing JAR file has the version missing in its name.
You should review the deployment procedure: For some reason (maybe the finalName, or some other parametrization in the maven-jar-plugin), the library is being published without the version suffix.

Related

Spring boot project not resolving dependencies - Failed to collect dependencies at org.springframework.boot:spring-boot-starter-web:jar:2.1.1.RELEASE

I was having a problem with setting up a spring demo project and did not easily find a solution online. Below lays out the details and I found a way to make it work (I'll add as an answer) for me and maybe it'll help someone else.
I am following the guide for building REST services with spring: https://spring.io/guides/tutorials/bookmarks/
In the guide, it says to go to https://start.spring.io/ and select the following: Web, JPA, H2, and Lombok.
I downloaded, upnzipped, and imported it into my Spring Tool Suite in Eclipse. Right away it can be seen that the project has issues so I right-click the project -> Maven -> Update Project... This did not resolve so next I did was:
Right-click project -> Run As -> Maven install
This results with BUILD FAILURE:
Failed to execute goal on project restDemo: Could not resolve dependencies for project com.example:restDemo:jar:0.0.1-SNAPSHOT: Failed to collect dependencies at org.springframework.boot:spring-boot-starter-web:jar:2.1.1.RELEASE -> org.hibernate.validator:hibernate-validator:jar:6.0.13.Final: Failed to read artifact descriptor for org.hibernate.validator:hibernate-validator:jar:6.0.13.Final: Could not transfer artifact org.jboss.shrinkwrap:shrinkwrap-bom:pom:1.2.3 from/to central (https://repo.maven.apache.org/maven2): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target -> [Help 1]
I am behind a corporate firewall and I figured it had something to do with not being able to get all the dependencies.
I added this to my pom.xml (note url uses http instead of https):
<repositories>
<repository>
<id>spring-releases</id>
<url>http://repo.spring.io/libs-release</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-releases</id>
<url>http://repo.spring.io/libs-release</url>
</pluginRepository>
</pluginRepositories>
Ultimately, I put that in my settings.xml file (found in C:\Users\user\.m2 directory) so that I don't have to add this to all my project pom.xml files.

Spring Asciidoctor Extensions not in correct repo?

Good afternoon guys,
I've been trying to get spring-asciidoctor-extensions to work with my documentation but for some reason maven can't find the dependency.
The error i got after my build attempt:
Failed to execute goal org.asciidoctor:asciidoctor-maven-plugin:1.5.5:process-asciidoc (generate-docs) on project organization: Execution generate-docs of goal org.asciidoctor:asciidoctor-maven-plugin:1.5.5:process-asciidoc failed: Plugin org.asciidoctor:asciidoctor-maven-plugin:1.5.5 or one of its dependencies could not be resolved: Failure to find io.spring.asciidoctor:spring-asciidoctor-extensions:jar:0.1.1.RELEASE in https://repo.maven.apache.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 -> [Help 1]
I checked thier GitHub and looked around to find out that theres nothing in the maven repo (obvious from error) and in this question found that the repo is in https://repo.spring.io/release. Is there a way to reference a dependency to a repo directly? If not what can i do?
You can add the repo.spring.io repository to your pom.xml.
<repositories>
<repository>
<id>spring-repo</id>
<url>https://repo.spring.io/release</url>
</repository>
</repositories>
With that declaration in place you will be able to resolve this dependency:
<dependency>
<groupId>io.spring.asciidoctor</groupId>
<artifactId>spring-asciidoctor-extensions</artifactId>
<version>0.1.1.RELEASE</version>
</dependency>
More details in the docs.
Note: it is not possible to explicitly associate this dependency with that repository. Maven walks through the repositories in order of their declaration until a given dependency is resolved (or not) however if all of your other dependencies are resolved from Maven Central then the only dependency left to be resolved from repo.spring.io will be spring-asciidoctor-extensions.
I ran into this issue as well. My misconception at first was that I expected the dependencies to be resolved from the repositories section. However turns out that it's rather the pluginRepositories section. Like so:
<pluginRepositories>
<pluginRepository>
<id>spring-repo</id>
<url>https://repo.spring.io/release</url>
</pluginRepository>
</pluginRepositories>

Maven: Error resolving version for plugin

I am trying to get Batik working, having not worked with Java much in the last ten years or so and I'm running into problems with Maven being able to find the org.apache.maven.wagon:wagon-ssh-external package.
When I open or try to build the project in Netbeans, it reports the following error:
The project org.freehep:freehep-graphicsio:2.1.1 (/home/glenatron/Projects/batik/freehep-graphicsio/pom.xml) has 1 error
Unresolveable build extension:
Error resolving version for plugin 'org.apache.maven.wagon:wagon-ssh-external' from the repositories [local (/home/glenatron/.m2/repository), freehep-maven (http://java.freehep.org/maven2), central (http://www.ibiblio.org/maven2), Codehaus (http://repository.codehaus.org/), Codehaus Snapshots (http://snapshots.repository.codehaus.org/)]:
Plugin not found in any plugin repository -> [Help 2]
As far as I can tell this is correct, however, I have the following in my pom.xml file for the project:
<repositories>
<repository>
<id>freehep-maven</id>
<name>Maven FreeHEP</name>
<url>http://java.freehep.org/maven2</url>
</repository>
<repository>
<id>maven-apache</id>
<name>Maven Apache</name>
<url>http://repo.maven.apache.org/maven2</url>
</repository>
<repository>
<id>maven1</id>
<name>Maven.org</name>
<url>http://repo1.maven.org/maven2</url>
</repository>
</repositories>
From what I can judge a) that plugin should be available in one of those repositories and b) if they are in the pom.xml file, Maven should be searching them but I can't see any sign of it doing that.
The project I am trying to work with is the FreeHEP EMF driver. The bigger screen solution was to use the unsignposted but much more up to date Github repository version.
It turns out that the solution was in the message after all: Error resolving version for plugin.
So obviously it's not a repository it is a pluginRepository which goes in a different part of pom.xml:
<pluginRepositories>
<pluginRepository>
<id>maven1</id>
<name>Maven.org</name>
<url>http://repo1.maven.org/maven2</url>
</pluginRepository>
</pluginRepositories>
Remove the entries with repo1... cause this is maven Central and used by Maven by default so no need to define it explicit. Furthermore the given freehep.org is also available via Maven Central. So if i see it correct you don't need to define supplemental repositories at all.

How can i use SVN as Maven Repository

I am working on project which has multiple dependencies. Most of the dependencies are available at our centralized maven repository. My project includes some JARs which only specific to my application and unavailable at our Maven repo. Due to some policy/restriction i cant deploy that jars to our maven repository.
When i install these jars in my local repository(i.e.UserHome/.m2/repository) and compile the code its working fine.
Now i want these dependencies in SVN so that we can build the application package using Continuum.(We cant refer local dependency from Continuum server.)
Just to achieve these i copied the locally installed dependency from .m2/repository and committed it in SVN. Then i declared repository in pom.xml like..
<repositories>
<repository>
<id>repo.pu</id>
<name>repo.pu</name>
<url>https://URL/migration2/APP1/src/main/lib/</url>
<layout>default</layout>
</repository>
</repositories>
Now to use dependency from above repo i added code like...
<dependencies>
<dependency>
<groupId>repo.pu</groupId>
<artifactId>Ptestval</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
When i type mvn verify i am getting the below error..
[ERROR] Failed to execute goal on project APP1: Could not resolve dependencies f
or project fileservices.migration2:APP1:jar:1.0: Failed to collect dependencies
for [repo.pu:Ptestval:jar:1.0 (compile)]: Failed to read artifact descriptor for
repo.pu:Ptestval:jar:1.0: Could not transfer artifact repo.pu:Ptestval:pom:1.0
from/to repo.pu (https://URL/migration2/APP1/src/main/lib/): Access denied to:
https://URL/migration2/APP1/src/main/lib/repo/pu/Ptestv
al/1.0/Ptestval-1.0.pom -> [Help 1]
Could you please someone help me to resolve these issue?
EDIT: I created a repository like ..
<repositories>
<repository>
<id>repo.pu</id>
<name>repo.pu</name>
<url>https://SVNUserName:SVNPassword#SVN_URL/BaseProj/ProjA/src/main/lib</url>
<layout>default</layout>
</repository>
</repositories>
This technique works perfectly at my Personal laptop. Maven downloads the listed dependency from repo.
But when tries to use the same in my project on company network it is not working .. It gives the same error which i was getting before using this approach.
Can anyone help me please? What would be problem? Is it a network issue?
Set up a repository manager like Nexus and don't abuse Subversion for something it was not designed for. This is unfortunately done in Google Code.
You must configure your project to use wagon-scm.
See http://maven.apache.org/wagon/wagon-providers/wagon-scm/usage.html

Jenkins builds not honoring third party repositories?

I'm hosting ojdbc14.jar on my network nexus instance, but only local builds seem to pass.
I have this in my pom:
<repositories>
<repository>
<releases>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</releases>
<id>thirdparty</id>
<url>http://server/nexus/content/repositories/thirdparty</url>
</repository>
</repositories>
After completing removing ~/.m2/, a local mvn package will find ojdbc14.jar on nexus. My jenkins builds, conversely, consistently fail on this:
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal
org.csodehaus.mojo:sql-maven-plugin:1.3:execute (sql-ddl) on project mongo-dbunit: Execution
sql-ddl of goal org.codehaus.mojo:sql-maven-plugin:1.3:execute failed: Plugin
org.codehaus.mojo:sql-maven-plugin:1.3 or one of its dependencies could not be resolved: Could not find artifact com.oracle:ojdbc14:jar:10.2.0.4.0 in central
Why?
(http://repo1.maven.org/maven2)
Before you do anything, install Config File Provider Plugin
Then,
Go to Jenkins root page
Choose 'Manage Jenkins'
Choose 'Configuration files'
Choose type 'Maven settings.xml file'
Name it 'custom-maven-settings' and cut and paste contents of your ~/.m2/settings.xml file
Now back to your Maven2/3 job.
In the Build section click Advanced button
In the Maven Settings Configs drop down box choose custom-maven-settings
This setup works with our custom repository.
You have a <repositories> section in your POM, but not a <pluginRepositories>. Maven used to be a lot more sloppy about the difference between compile-time artifact dependencies and plugin dependencies, but in newer versions of Maven they're completely separate.
As others have pointed out, it might be easier to troubleshoot this by running Maven from the command line, outside of Jenkins. Just doing a build on a different machine than the one you are typically developing on will usually bring a lot issues to light.
Here's some documentation on the POM that may or may not be helpful.
I'd check and make sure that the Maven settings are the same on both machines.
Jenkins by default uses the file in $HOME/.m2/settings.xml. It's also possible for a Jenkins job to override this default.

Resources