Use Maven v3.8.6 if you can Abhinav
Delany

On Thu, 22 Dec 2022 at 14:17, Abhinav Sharma <abhisharma9...@gmail.com>
wrote:

> Hi,
> I am using maven 3.8.2 with java 11 in my system, with remotes configured
> for jfrog artifactory.
>
> With both mirror and proxy added, mvn is ignoring the proxies and failing
> to resolve any dependency. How do I set proxies for maven mirrors as well?
>
> Without a mirror, the maven assembly plugin is not looking in the
> configured jfrog repositories for the dependencies. It starts looking at
> some random repo.
>
> [INFO] maven-assembly-plugin:3.3.0:single (make-assembly)sample-project ---
> Downloading from jvnet-nexus-staging:
> http://maven.java.net/content/repositories/staging/
> <
> http://maven.java.net/content/repositories/staging/com/infosys/fbp/platform/fbp-parent-pom/1.5-SNAPSHOT/maven-metadata.xml
> >com/example/sample-project/0.0.1-SNAPSHOT
> <
> http://maven.java.net/content/repositories/snapshots/com/infosys/fbp/platform/fbp-parent-pom/1.5-SNAPSHOT/maven-metadata.xml
> >/maven-metadata.xml
> <
> http://maven.java.net/content/repositories/staging/com/infosys/fbp/platform/fbp-parent-pom/1.5-SNAPSHOT/maven-metadata.xml
> >
> Downloading from releases.java.net:
> http://maven.java.net/content/repositories/releases/
> <
> http://maven.java.net/content/repositories/releases/com/infosys/fbp/platform/fbp-parent-pom/1.5-SNAPSHOT/maven-metadata.xml
> >com/example/sample-project/0.0.1-SNAPSHOT
> <
> http://maven.java.net/content/repositories/snapshots/com/infosys/fbp/platform/fbp-parent-pom/1.5-SNAPSHOT/maven-metadata.xml
> >/maven-metadata.xml
> <
> http://maven.java.net/content/repositories/releases/com/infosys/fbp/platform/fbp-parent-pom/1.5-SNAPSHOT/maven-metadata.xml
> >
> Downloading from shapshots.java.net:
>
> http://maven.java.net/content/repositories/snapshots/com/example/sample-project/0.0.1-SNAPSHOT/maven-metadata.xml
> <
> http://maven.java.net/content/repositories/snapshots/com/infosys/fbp/platform/fbp-parent-pom/1.5-SNAPSHOT/maven-metadata.xml
> >
>
>
> I am expecting to access jfrog maven virtual repo with mirror enabled
> behind the company proxy, or force assembly plugin to look into the
> repositories defined in settings.xml.
>
> I am using settings.xml file similar to this:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.2.0
> http://maven.apache.org/xsd/settings-1.2.0.xsd"; xmlns="
> http://maven.apache.org/SETTINGS/1.2.0";
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
>   <servers>
>     <server>
>       <username>username</username>
>       <password>password</password>
>       <id>central</id>
>     </server>
>     <server>
>       <username>username</username>
>       <password>password</password>
>       <id>snapshots</id>
>     </server>
>   </servers>
>   <mirrors>
>     <mirror>
>       <mirrorOf>*</mirrorOf>
>       <name>project-repo</name>
>       <url>https://company.jfrog.io/artifactory/project-repo</url>
>       <id>project-repo</id>
>     </mirror>
>   </mirrors>
>   <profiles>
>     <profile>
>       <repositories>
>         <repository>
>           <snapshots>
>             <enabled>false</enabled>
>           </snapshots>
>           <id>central</id>
>           <name>project-repo</name>
>           <url>https://company.jfrog.io/artifactory/project-repo</url>
>         </repository>
>         <repository>
>           <snapshots />
>           <id>snapshots</id>
>           <name>project-repo</name>
>           <url>https://company.jfrog.io/artifactory/project-repo</url>
>         </repository>
>       </repositories>
>       <pluginRepositories>
>         <pluginRepository>
>           <snapshots>
>             <enabled>false</enabled>
>           </snapshots>
>           <id>central</id>
>           <name>project-repo</name>
>           <url>https://company.jfrog.io/artifactory/project-repo</url>
>         </pluginRepository>
>         <pluginRepository>
>           <snapshots />
>           <id>snapshots</id>
>           <name>project-repo</name>
>           <url>https://company.jfrog.io/artifactory/project-repo</url>
>         </pluginRepository>
>       </pluginRepositories>
>       <id>artifactory</id>
>     </profile>
>   </profiles>
>   <activeProfiles>
>     <activeProfile>artifactory</activeProfile>
>   </activeProfiles>
>  <proxies>
>     <proxy>
>         <id>jfrog-proxy</id>
>         <active>true</active>
>         <protocol>https</protocol>
>         <host>proxyhost</host>
>         <port>proxyport</port>
>       </proxy>
> </proxies>
> </settings>
>

Reply via email to