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
Newsletter
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Private Remote Maven Repository With Artipie
  • Wasm Inside Neo4j: Building the Example That Didn't Exist
  • OpenAPI From Code With Spring and Java: A Recipe for Your CI
  • Tracking Dependencies Beyond the Build Stage

Trending

  • Metamorphic Testing For LLMs: The Oracle Problem's Most Underused Answer
  • Incident Management and the Rise of AI SRE Agents
  • The Math Behind AI Testing: Why 1,000 Test Cases May Tell You Less Than 100
  • Why AI Hallucinations Are a Quality Engineering Problem
  1. DZone
  2. Coding
  3. Java
  4. The Maven Way to Add Non-Maven JARs to a Maven Project [Snippets]

The Maven Way to Add Non-Maven JARs to a Maven Project [Snippets]

Sometimes we need to add non-Maven controlled JARs into our projects. In this post, we take a quick look at a Maven-based solution for doing this!

By 
Mohammad Nadeem user avatar
Mohammad Nadeem
·
Jul. 18, 17 · Code Snippet
Likes (13)
Comment
Save
Tweet
Share
27.9K Views

Join the DZone community and get the full member experience.

Join For Free

Have you ever asked, "How do I add custom (non-maven) JARs as dependencies to maven projects, in a maven way?"

maven-project-custom-libs


Answer: Easy. Use the maven-install-plugin maven plugin,

Approach

Add the maven JAR plugin with as shown below:

manve-jar-plugin1

Add the dependency:

manve-jar-plugin2

Refer this gist for the complete example.

Apache Maven JAR (file format)

Published at DZone with permission of Mohammad Nadeem. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Private Remote Maven Repository With Artipie
  • Wasm Inside Neo4j: Building the Example That Didn't Exist
  • OpenAPI From Code With Spring and Java: A Recipe for Your CI
  • Tracking Dependencies Beyond the Build Stage

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

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

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook