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
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
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

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workkloads.

Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Related

  • Configurable Feign Client Retry With Reusable Library and DRY
  • Using Lombok Library With JDK 23
  • Step By Step Guide To Using Mule ESB
  • While Performing Dependency Selection, I Avoid the Loss Of Sleep From Node.js Libraries' Dangers

Trending

  • The Modern Data Stack Is Overrated — Here’s What Works
  • Java’s Next Act: Native Speed for a Cloud-Native World
  • Breaking Bottlenecks: Applying the Theory of Constraints to Software Development
  • Unlocking AI Coding Assistants Part 3: Generating Diagrams, Open API Specs, And Test Data
  1. DZone
  2. Software Design and Architecture
  3. Integration
  4. Populate Your Maven Repo With Mule ESB Libraries

Populate Your Maven Repo With Mule ESB Libraries

By 
$$anonymous$$ user avatar
$$anonymous$$
·
Dec. 04, 13 · Interview
Likes (0)
Comment
Save
Tweet
Share
10.6K Views

Join the DZone community and get the full member experience.

Join For Free

when you build applications based on mule ee (enterprise edition) and you are using maven to build your projects, you will notice you have dependencies to libraries that are not available in the public maven repos. to add these libraries to your local maven repo the mule distribution comes with a script ‘populate_m2_repo’ which is described here how to use it.

now that is okay if you are the only developer and you are running your continuous integration on your local machine. in my case we are using artifactory as our company maven repository and also our build server is using it as the maven repo. so what i wanted was not to populate my local repository but the artifactory instance with all mule libraries. to do so i did two things:

  • first make sure that maven is authorised to add libraries to artifactory. you can do this by adding the following to your settings.xml:
  • <servers>
      <server>
        <id>artifactory</id>
        <username>admin</username>
        <password>password</password>
      </server>
    </servers>
  • second step is to modify the original ‘populate_m2_repo.groovy’ script. replace the following line:
    mvn(["install:install-file",
    "-dgroupid=${project.groupid}", 
    "-dartifactid=${project.artifactid}", 
    "-dversion=${version}", "-dpackaging=pom", 
    "-dfile=${localpom.canonicalpath}"])
    with
    mvn(["deploy:deploy-file", 
    "-dgroupid=${project.groupid}", 
    "-dartifactid=${project.artifactid}", 
    "-dversion=${version}", 
    "-dpackaging=pom", 
    "-dfile=${localpom.canonicalpath}", 
    "-drepositoryid=arti", 
    "-durl=http://localhost:8080/artifactory/libs-release-local" ])
    and do the same for the line:
    def args = ["install:install-file", 
    "-dgroupid=${pomprops.groupid}", 
    "-dartifactid=${pomprops.artifactid}", 
    "-dversion=${pomprops.version}", 
    "-dpackaging=jar", 
    "-dfile=${f.canonicalpath}", 
    "-dpomfile=${localpom.canonicalpath}"]
    by replacing it with:
    def args = ["deploy:deploy-file", 
    "-dgroupid=${pomprops.groupid}", 
    "-dartifactid=${pomprops.artifactid}", 
    "-dversion=${pomprops.version}", 
    "-dpackaging=jar", 
    "-dfile=${f.canonicalpath}", 
    "-dpomfile=${localpom.canonicalpath}", 
    "-drepositoryid=arti", 
    "-durl=http://localhost:8080/artifactory/libs-release-local" ]
    now you can run the script with:
    ./populate_m2_repo bla
    as you can see it doesn’t really matter what you supply as m2_repo_home here because the libraries are uploaded to artifactory anyway.

    if you want you can replace the hardcoded url for artifactory in the script with the supplied parameter but in my case this solution was sufficient :-)

Apache Maven Library Enterprise service bus

Published at DZone with permission of $$anonymous$$. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Configurable Feign Client Retry With Reusable Library and DRY
  • Using Lombok Library With JDK 23
  • Step By Step Guide To Using Mule ESB
  • While Performing Dependency Selection, I Avoid the Loss Of Sleep From Node.js Libraries' Dangers

Partner Resources

×

Comments
Oops! Something Went Wrong

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

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

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 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!