My test Sonatype Nexus Repository Manager OSS 3.24.0-02 is not caching components/artifacts in the proxy repo

As stated in my title.
My test Sonatype Nexus Repository Manager OSS 3.24.0-02 is not caching components/artifacts in the proxy repo.

I setup a test instance to try to see how the repo manager would work without internet connectivity.

steps I did:

setup new instance
setup a proxy repo pointing to maven central
ran “mvn -X -e package” with my pom.xml pointing to my proxy repo.

pom.xml:

junit junit 4.12 compile maven_proxy http://172.X.X.X:8081/repository/maven_proxy/ maven_proxy http://172.X.X.X:8081/repository/maven_proxy/ maven_proxy http://172.X.X.X:8081/repository/maven_proxy/

The maven command runs successfully, I see the logs stating that its pointing to my proxy repo.
However when I go to the repo manager and check the proxy repo its still empty.

My thought would be once I run the above mvn command the junit contents would be available in the proxy repo, then I would remove internet access to the nexus server and try to re-run the mvn command and see the effects and make note. My company is moving to a secured network where we wont have internet access and I was tasked to see how that would affect nexus.

But I’m new to nexus overall, so I feel like im missing something.

Any help/guidance would be appreciated

Its generally recommended to modify the settings.xml - Maven Repositories

Aside from reminding you that maven has a local cache in ~/.m2/repository I can’t really suggest anything other than verify from the request logs that it spoke to Nexus.

Sorry I forgot to add that to original post.

Here is my settings.xml:

maven_proxy maven_proxy http://:172.X.X.X:8081/repository/maven_proxy/ default always

Any other file I could check?

I’m going to parse through the nexus logs and see what I can find

That isn’t a settings.xml file… see here: Maven Repositories

[root@nexus-offiline-test ~]# cat /usr/apache-maven-3.5.2/conf/settings.xml

<?xml version="1.0" encoding="UTF-8"?> maven_proxy XXXX XXXX
<!-- Another sample, using keys to authenticate.
<server>
  <id>siteServer</id>
  <privateKey>/path/to/private/key</privateKey>
  <passphrase>optional; leave empty if not used.</passphrase>
</server>
-->
maven_proxy * maven_proxy http://172.X.X.X:8081/repository/maven_proxy/ jdk-1.4
  <activation>
    <jdk>1.4</jdk>
  </activation>

  <repositories>
    <repository>
      <id>maven_proxy</id>
      <name>maven_proxy</name>
      <url>http://:172.X.X.X:8081/repository/maven_proxy/</url>
      <layout>default</layout>
      <snapshotPolicy>always</snapshotPolicy>
    </repository>
  </repositories>
</profile>


<!--
 | Here is another profile, activated by the system property 'target-env' with a value of 'dev',
 | which provides a specific path to the Tomcat instance. To use this, your plugin configuration
 | might hypothetically look like:
 |
 | ...
 | <plugin>
 |   <groupId>org.myco.myplugins</groupId>
 |   <artifactId>myplugin</artifactId>
 |
 |   <configuration>
 |     <tomcatLocation>${tomcatPath}</tomcatLocation>
 |   </configuration>
 | </plugin>
 | ...
 |
 | NOTE: If you just wanted to inject this configuration whenever someone set 'target-env' to
 |       anything, you could just leave off the <value/> inside the activation-property.
 |
<profile>
  <id>env-dev</id>

  <activation>
    <property>
      <name>target-env</name>
      <value>dev</value>
    </property>
  </activation>

  <properties>
    <tomcatPath>/path/to/tomcat/instance</tomcatPath>
  </properties>
</profile>
-->

You need a “mirrorOf” declaration, otherwise default repositories defied in the super pom will be used.

  <mirrors>
    <mirror>
      <!--This sends everything else to /public -->
      <id>nexus</id>
      <mirrorOf>*</mirrorOf>
      <url>http://localhost:8081/repository/maven-public/</url>
    </mirror>
  </mirrors>

This is what I have for the mirrorOf.
Are you saying its incorrect?

<mirror>
      <id>maven_proxy</id>
      <mirrorOf>*</mirrorOf>
      <name>maven_proxy</name>
      <url>http://172.X.X.X:8081/repository/maven_proxy/</url>
    </mirror>

Do I need to enable a particular task?

Currently I haven’t enabled any. So the only ones active are the default ones.