DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
View Events Video Library
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Integrating PostgreSQL Databases with ANF: Join this workshop to learn how to create a PostgreSQL server using Instaclustr’s managed service

Mobile Database Essentials: Assess data needs, storage requirements, and more when leveraging databases for cloud and edge applications.

Monitoring and Observability for LLMs: Datadog and Google Cloud discuss how to achieve optimal AI model performance.

Automated Testing: The latest on architecture, TDD, and the benefits of AI and low-code tools.

Related

  • How To Deploy Helidon Application to Kubernetes With Kubernetes Maven Plugin
  • Deploy MuleSoft App to CloudHub2 Using GitHub Actions CI/CD Pipeline
  • Ensuring Reliable Microservice Deployment With Spring Boot Build Info Maven Plugin
  • How To Approach Dependency Management in Java [Video]

Trending

  • Parallel Sort
  • How To Learn Secure Software Development Lifecycle (SDLC)
  • Architecting a Completely Private VPC Network and Automating the Deployment
  • Setting up Request Rate Limiting With NGINX Ingress
  1. DZone
  2. Coding
  3. Java
  4. How to get Maven working through a proxy server

How to get Maven working through a proxy server

Jose Roy Javelosa user avatar by
Jose Roy Javelosa
·
Aug. 15, 11 · Interview
Like (0)
Save
Tweet
Share
56.43K Views

Join the DZone community and get the full member experience.

Join For Free

Maven, is a Yiddish word meaning accumulator of knowledge. Maven is a tool that can now be used for building and managing any Java-based project, something that makes the day-to-day work of Java developers easier.

Maven’s Objectives

  • Making the build process easy
  • Providing a uniform build system
  • Providing quality project information
  • Providing guidelines for best practices development
  • Allowing transparent migration to new features
  • I personally think that mavens greatest contribution to the opensource community is the way it provides developers with  a uniform build system.  Further information about maven can be found at http://maven.apache.org/index.html and tutorials on how to use maven is just a google away.  The only problem that you might encounter with maven is how to get it working through a proxy server.

    To save you time, below is the line of code you’ll append at the end of your maven command so that maven would work properly even if your using a proxy server.

    -DproxySet=true -DproxyHost=ur.proxy.server -DproxyPort=port

    where -DproxyHost value is “YOUR PROXY SERVER” and -DproxyPort is“YOUR PORT NUMBER”

    You can view your proxy settings through

    Internet Explorer >> tools >> internet options >> Connections >> LAN Settings

    Fire Fox >> tools >> options >> ADVANCED TAB >> settings

    If you find yourself using maven from time to time specially to gather dependencies I would suggest you manually edit your maven settings.  There is an existing official tutorial on how to do this at http://maven.apache.org/guides/mini/guide-proxies.html but to save you time, below is a portion of the tutorial which I copied from their site.

    You can configure a proxy to use for some or all of your HTTP requests in Maven 2.0. The username and password are only required if your proxy requires basic authentication (note that later releases may support storing your passwords in a secured keystore – in the mean time, please ensure your settings.xml file (usually ${user.home}/.m2/settings.xml) is secured with permissions appropriate for your operating system).

    The nonProxyHosts setting accepts wild cards, and each host not to proxy is separated by the | character. This matches the JDK configuration equivalent.

    <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 note that currently NTLM proxies are not supported as they have not been tested. You may be able to use the relevant system properties on JDK 1.4+ to make this work.

     

    From http://royjavelosa.wordpress.com/2011/01/30/how-to-get-maven-working-through-a-proxy-server/

    Apache Maven

    Opinions expressed by DZone contributors are their own.

    Related

    • How To Deploy Helidon Application to Kubernetes With Kubernetes Maven Plugin
    • Deploy MuleSoft App to CloudHub2 Using GitHub Actions CI/CD Pipeline
    • Ensuring Reliable Microservice Deployment With Spring Boot Build Info Maven Plugin
    • How To Approach Dependency Management in Java [Video]

    Comments

    Partner Resources

    X

    ABOUT US

    • About DZone
    • Send feedback
    • Careers
    • Sitemap

    ADVERTISE

    • Advertise with DZone

    CONTRIBUTE ON DZONE

    • Article Submission Guidelines
    • Become a Contributor
    • Visit the Writers' Zone

    LEGAL

    • Terms of Service
    • Privacy Policy

    CONTACT US

    • 3343 Perimeter Hill Drive
    • Suite 100
    • Nashville, TN 37211
    • support@dzone.com

    Let's be friends: