Dependencies are resolved only on my mac machine and not on the Windows one for the same project - maven

I have a couple of dependencies that resolve when I use IntelliJ Idea with my mac machine but for some strange reason they cannot be resolved when I am running the same project with IntelliJ Idea again on my windows machine.
Here are the two dependencies:
<dependencies>
<dependency>
<groupId>com.opengamma.platform</groupId>
<artifactId>og-client</artifactId>
<version>2.1.0</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>com.opengamma.platform</groupId>
<artifactId>og-server</artifactId>
<version>2.1.0</version>
<type>pom</type>
</dependency>
</dependencies>
I even tried to run mvn clean install on the project directory on the windows machine and the build stops with this error:
[WARNING] The POM for com.opengamma.platform:og-client:pom:2.1.0 is missing, no
dependency information available
Downloading: http://repo.maven.apache.org/maven2/com/opengamma/platform/og-serve
r/2.1.0/og-server-2.1.0.pom
[WARNING] The POM for com.opengamma.platform:og-server:pom:2.1.0 is missing, no
dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.611 s
[INFO] Finished at: 2014-07-26T22:03:08+02:00
[INFO] Final Memory: 8M/115M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project Project3: Could not resolve dependenci
es for project com.skiabox.apps:Project3:jar:1.0-SNAPSHOT: The following artifac
ts could not be resolved: com.opengamma.platform:og-client:pom:2.1.0, com.openga
mma.platform:og-server:pom:2.1.0: Failure to find com.opengamma.platform:og-clie
nt:pom:2.1.0 in http://repo.maven.apache.org/maven2 was cached in the local repo
sitory, resolution will not be reattempted until the update interval of central
has elapsed or updates are forced -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[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 rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyReso
lutionException

It appears to me that you are looking for the OG dependencies in
http://repo.maven.apache.org/maven2
However, OpenGamma currently does not put their dependencies there. Instead, try looking here:
http://maven.opengamma.com/nexus/content/groups/public/
I added this to my top-level pom.xml
<repositories>
<repository>
<id>maven-opengamma</id>
<name>Public online OpenGamma repository</name>
<url>http://maven.opengamma.com/nexus/content/groups/public/</url>
</repository>
</repositories>
Hope this helps.
Eric

Related

google cloud shell not able to get maven dependency for spring-cloud-gcp-starter-secretmanager

I am trying to add secrets to spring boot app.
so added to pom.xml
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-gcp-starter-secretmanager</artifactId>
<version>3.4.0</version>
</dependency>
Maven version is
xyz_pqr#cloudshell:~/projects/spring-petclinic (xyzprj)$ ./mvnw --version
Apache Maven 3.8.2 (ea98e05a04480131370aa0c110b8c54cf726c06f) Maven home:
/home/xyz_pqr/.m2/wrapper/dists/apache-maven-3.8.2-bin/1um3pu5poco57pibs3g92d6vrf/apache-maven-3.8.2
Java version: 17.0.4, vendor: Debian, runtime:
/usr/lib/jvm/java-17-openjdk-amd64 Default locale: en_US, platform
encoding: ANSI_X3.4-1968 OS name: "linux", version: "5.15.65+", arch:
"amd64", family: "unix" xyz_pqr#cloudshell:~/projects/spring-petclinic
(xyzprj)$
It gives the issue
Failed to execute goal on project spring-petclinic: Could not resolve dependencies for project org.springframework.samples:spring-petclinic:jar:3.0.0-SNAPSHOT: Could not find artifact org.springframework.cloud:spring-cloud-gcp-starter-secretmanager:jar:3.4.0 in spring-snapshots (https://repo.spring.io/snapshot)
The complete error is
[INFO] ------------< org.springframework.samples:spring-petclinic
------------ [INFO] Building petclinic 3.0.0-SNAPSHOT [INFO] --------------------------------[ jar ]--------------------------------- Downloading from spring-snapshots:
https://repo.spring.io/snapshot/org/springframework/cloud/spring-cloud-gcp-starter-secretmanager/3.4.0/spring-cloud-gcp-starter-secretmanager-3.4.0.pom
Downloading from spring-milestones:
https://repo.spring.io/milestone/org/springframework/cloud/spring-cloud-gcp-starter-secretmanager/3.4.0/spring-cloud-gcp-starter-secretmanager-3.4.0.pom
Downloading from central:
https://repo.maven.apache.org/maven2/org/springframework/cloud/spring-cloud-gcp-starter-secretmanager/3.4.0/spring-cloud-gcp-starter-secretmanager-3.4.0.pom
[WARNING] The POM for
org.springframework.cloud:spring-cloud-gcp-starter-secretmanager:jar:3.4.0
is missing, no dependency information available Downloading from
spring-snapshots:
https://repo.spring.io/snapshot/org/springframework/cloud/spring-cloud-gcp-starter-secretmanager/3.4.0/spring-cloud-gcp-starter-secretmanager-3.4.0.jar
Downloading from spring-milestones:
https://repo.spring.io/milestone/org/springframework/cloud/spring-cloud-gcp-starter-secretmanager/3.4.0/spring-cloud-gcp-starter-secretmanager-3.4.0.jar
Downloading from central:
https://repo.maven.apache.org/maven2/org/springframework/cloud/spring-cloud-gcp-starter-secretmanager/3.4.0/spring-cloud-gcp-starter-secretmanager-3.4.0.jar
[INFO]
------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO]
------------------------------------------------------------------------ [INFO] Total time: 3.274 s [INFO] Finished at: 2023-01-14T23:34:50Z
[INFO]
------------------------------------------------------------------------ [ERROR] Failed to execute goal on project spring-petclinic: Could not
resolve dependencies for project
org.springframework.samples:spring-petclinic:jar:3.0.0-SNAPSHOT: Could
not find artifact
org.springframework.cloud:spring-cloud-gcp-starter-secretmanager:jar:3.4.0
in spring-snapshots (https://repo.spring.io/snapshot) -> [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 the following articles:
[ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
xyz_pqr#cloudshell:~/projects/spring-petclinic (xyzprj)$
The issue is with document at Secret Management
it says
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-gcp-starter-secretmanager</artifactId>
</dependency>
but should be
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>spring-cloud-gcp-starter-secretmanager</artifactId>
</dependency>
so replace org.springframework.cloud with com.google.cloud

maven dependency versionioning issue

I am trying to add the dependency as below to use the version mentioned or the latest.I am expecting maven to take the dependencies with version >= 0.0.1 but maven is failing to resolve the dependencies.If i mention the exact version the dependencies are getting downloaded.
Iam using maven 3.5
<dependency>
<groupId>com.company.esb.fuse</groupId>
<artifactId>common</artifactId>
<version>[0.0.1,)</version>
<scope>provided</scope>
</dependency>
maven logs:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building source out Write 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.401 s
[INFO] Finished at: 2018-01-22T17:26:21+01:00
[INFO] Final Memory: 14M/245M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project source: Could not resolve dependencies for project com.company.esb.source.out:source:war:0.0.1-SNAPSHOT: Failed to collect dependencies at com.company.esb.fuse:common:jar:[0.0.1,): No versions available for com.company.esb.fuse:common:jar:[0.0.1,) within specified range -> [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 the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
Above details are not sufficient to determine the exact problem. But according to your maven logs,
No versions available for com.company.esb.fuse:common:jar:[0.0.1,)
Note that it says com.company, not com.compant as you typed in this question.
check your pom.xml first and put correct groupId.
If you are still getting the same error, check your local .m2 folder and confirm that you have at least one artifact with a version which is in the declared range.
UPDATE : the error may be in the maven-metadata file. check maven-metadata-local.xml file placed inside .m2/repository/com/company/esb/fuse/common. All versions should be there under <versions> tag.

Failure to find com.oracle.state-management:state-management-parent:pom:1.0.0-SNAPSHOT

I can't remember what I did to cause this problem. When I try to run mvn clean install, I get the following output:
mvn clean install
[INFO] Scanning for projects...
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building search Maven Webapp 1.0
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for org.slf4j:slf4j-api:jar:12.1.2 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.895 s
[INFO] Finished at: 2014-05-29T21:55:34+02:00
[INFO] Final Memory: 6M/154M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project search: Could not resolve dependencies for project com.ws:search:war:1.0: Failed to collect dependencies at com.oracle.weblogic:weblogic-server-pom:pom:12.1.2-0-0 -> com.oracle.weblogic:com.oracle.state-management.e
xecutor-internal-api_12.1.2:jar:12.1.2: Failed to read artifact descriptor for com.oracle.weblogic:com.oracle.state-management.executor-internal-api_12.1.2:jar:12.1.2: Failure to find com.oracle.state-management:state-management-parent:pom:1.0.0-SNAPSHOT in http://10.68
.20.32:8081/artifactory/libs-snapshot was cached in the local repository, resolution will not be reattempted until the update interval of snapshots has elapsed or updates are forced -> [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 the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
The attempt to find com.oracle.state-management.executor-internal-api_12.1.2:jar:12.1.2 (Note the version: 12.1.2) fails because it originates from the dependency com.oracle.state-management.executor-internal-api_12.1.2 (version 12.1.2 too) while this dependency's pom has the following portion:
<parent>
<artifactId>state-management-parent</artifactId>
<groupId>com.oracle.state-management</groupId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>
What surprises me is that there is another version for this dependency (com.oracle.state-management.executor-internal-api_12.1.2) which is 12.1.2-0-0, I believe that this is the right version to refer to, not 12.1.2
What I think supports my assumption is that the output mentions that it failed to find sfl4j dependency with the version 12.1.2 !!
[WARNING] The POM for org.slf4j:slf4j-api:jar:12.1.2 is missing, no dependency information available
I refer to weblogic's dependency this way
<dependency>
<groupId>com.oracle.weblogic</groupId>
<artifactId>weblogic-server-pom</artifactId>
<version>12.1.2-0-0</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
How can I fix that ?
For some unearthly reason, weblogic's dependency
<dependency>
<groupId>com.oracle.weblogic</groupId>
<artifactId>weblogic-server-pom</artifactId>
<version>12.1.2-0-0</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
had the following version for it's dependencies
<dependency>
<groupId>com.oracle.weblogic</groupId>
<artifactId>weblogic</artifactId>
<version>[12.1.2,12.1.3)</version>
</dependency>
To resolve this, I replaced all [12.1.2,12.1.3) occurrences with 12.1.2-0-0 and now I can install my project again.
I would really appreciate it if someone tells me why was the POM generated this way ?!

Selenium2 Build Error in Maven apache-maven-3.0.5

I came across following error in Maven when run the command
C:\Users\Man\SelProj>mvn clean install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building SelProj 1.0
[INFO] ------------------------------------------------------------------------
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.4.1/maven-clean-plugin-2.4.1.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.735s
[INFO] Finished at: Sun Apr 21 15:25:23 EST 2013
[INFO] Final Memory: 6M/106M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.4.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:m
aven-clean-plugin:jar:2.4.1: Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.4.1 from/to central (http://repo.maven.apache.org/maven2): Connection to
http://repo.maven.apache.org refused: connect: Address is invalid on local machine, or port is not valid on remote machine -> [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 the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
C:\Users\Man\SelProj>
My POM.xml file as follows, I placed the POM file in the folder where I am running the >mvn clean install cmmand
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>SelProj</groupId>
<artifactId>SelProj</artifactId>
<version>1.0</version>
<dependencies>
<!-- Selenium2 dependency -->
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.32.0</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-chrome-driver</artifactId>
<version>2.5.0</version>
</dependency>
</dependencies>
</project>
What could be the reason. I am running this on windows 8 (64 bit)
I also had same issue. Try to use just >mvn install command without clean.
Since you can access it via the web browser, I understand that there is no any issue about the internet connection.
There are 2 significant possible root causes as the following: -
1. The proxy
If you are behind the proxy, please add the proxy configuration to the settings.xml e.g.
<settings>
.
.
<proxies>
<proxy>
<active>true</active>
<protocol>http</protocol>
<host>proxy.somewhere.com</host>
<port>8080</port>
<username>proxyuser</username>
<password>somepassword</password>
<nonProxyHosts>www.google.com|*.somewhere.com</nonProxyHosts>
</proxy>
</proxies>
.
.
</settings>
Please see Maven - Guide to using proxies for further information.
2. The Anti-Virus / Firewall Issue
Firewall and Anti-virus sometimes prevent Java from running properly, or Windows Firewall (and various other Firewalls) actively prevent Java.exe from reaching out to the Internet to "download stuff" which is a key part of Maven. You may need to configure the Firewall or Anti-virus to add exceptions to allow such actions.
Please see Maven - Maven on Windows for further information.
I hope this may help.

How to run a snapshot plugin

When I attempt to run below maven plugin using this command :
com.wordpress.pomfromjarmavenplugin:generate:0.0.1-SNAPSHOT:generatepom
I get this error :
Downloading:
https://oss.sonatype.org/content/repositories/snapshots/com/wordpress/pomfromjarmavenplugin/generate/0.0.1-SNAPSHOT/generate-0.0.1-SNAPSHOT.pom
[WARNING] The POM for
com.wordpress.pomfromjarmavenplugin:generate:jar:0.0.1-SNAPSHOT is
missing, no dependency information available [INFO]
------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO]
------------------------------------------------------------------------ [INFO] Total time: 1.862s [INFO] Finished at: Fri Nov 09 11:15:47 GMT
2012 [INFO] Final Memory: 5M/15M [INFO]
------------------------------------------------------------------------ [ERROR] Plugin
com.wordpress.pomfromjarmavenplugin:generate:0.0.1-SNAPSHOT or one of
its dependencies could not be resolved: Failed to read artifact
descriptor for
com.wordpress.pomfromjarmavenplugin:generate:jar:0.0.1-SNAPSHOT: Could
not find artifact
com.wordpress.pomfromjarmavenplugin:generate:pom:0.0.1-SNAPSHOT in
apache.snapshots
(https://oss.sonatype.org/content/repositories/snapshots/) -> [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 the following articles:
[ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
Problem seems to be that all of the pom files have timestamps associated with them :
https://oss.sonatype.org/content/repositories/snapshots/com/wordpress/pomfromjarmavenplugin/generate/0.0.1-SNAPSHOT/
How can I run this plugin ? Do I need to wait until the plugin is released or somehow instruct maven to run the latest version of the snapshot ?
Add these lines to your pom:
<pluginRepositories>
<pluginRepository>
<id>oss.sonatype</id>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</pluginRepository>
</pluginRepositories>
Then your command should work:
mvn com.wordpress.pomfromjarmavenplugin:generate:0.0.1-SNAPSHOT:generatepom
Or add these lines to your pom:
<build>
<plugins>
<plugin>
<groupId>com.wordpress.pomfromjarmavenplugin</groupId>
<artifactId>generate</artifactId>
<version>0.0.1-SNAPSHOT</version>
</plugin>
</plugins>
</build>
And then issue:
mvn generate:generatepom

Resources