3

I recently faced issues building my project due to "HTTPS Required" error. This issue was solved by modifying my pom.xml as described here, adding the following:

    <pluginRepositories>
        <pluginRepository>
            <id>central</id>
            <name>Central Repository</name>
            <url>https://repo.maven.apache.org/maven2</url>
            <layout>default</layout>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <releases>
                <updatePolicy>never</updatePolicy>
            </releases>
        </pluginRepository>
    </pluginRepositories>
    <repositories>
        <repository>
            <id>central</id>
            <name>Central Repository</name>
            <url>https://repo.maven.apache.org/maven2</url>
            <layout>default</layout>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
    </repositories>

However, it is a hassle to update every pom.xml, for every project I have.

I have tried adding that same code snippet to my settings.xml, to no avail.

I am aware newer versions of Maven resolve this issue. However, due to work constraints, I'm unable to update my environment.

I have currently installed Java 8, and Maven, as bundled by Netbeans 8.2 Installer.

Is there something I can add to my settings.xml to avoid modifying every pom.xml I work on? If absolutely necessary, is there a way I can update just my maven version, knowing I have whatever is installed along with Netbeans?

Hope this isn't a duplicate, I have searched several entries, all to no avail.

SonneRevsson
  • 75
  • 2
  • 8
  • Can you update just the `maven`? You can install standalone `maven` and set NetBeans 8.2 to use it. Please, see the answer https://stackoverflow.com/a/60044668/5681468 – Dmitry.M Feb 06 '20 at 09:22

1 Answers1

7

If you are using NetBeans 8.0 (8.1,8.2) with bundled maven also you could edit settings.xml. For example, for bundled maven with NetBeans 8.1, the file should be in directory C:\Program Files (x86)\NetBeans 8.1\java\maven\conf.

Just add another mirror with https protocol like that.

<mirrors>
    <mirror>
      <id>mirrorId</id>
      <mirrorOf>central</mirrorOf>
      <name>Central Repository</name>
      <url>https://repo.maven.apache.org/maven2</url>
    </mirror>
  </mirrors>

If you have many pom.xml files editing repository settings in one place is better. Also, consider updating to NetBeans 11.0 LTS or latest Maven.

Dmitry.M
  • 2,833
  • 1
  • 17
  • 30
  • This did solve my issue, thanks! On an unrelated topic (but since you commented): considering NetBeans was transferred to Apache, at the office we are considering our option for updating: Netbeans 11 (Apache), or JDeveloper(Oracle). Would you say the transition to Netbeans 11 is seamless? Would you recommend it? – SonneRevsson Feb 06 '20 at 17:06
  • @Incarion, I suppose it would be off-topic here. Please consider about asking it on softwarerecs.stackexchange.com – Dmitry.M Feb 06 '20 at 17:31