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

  • Configurable Feign Client Retry With Reusable Library and DRY
  • Using Lombok Library With JDK 23
  • Two Engines, One Query: DuckDB Inside Neo4j
  • Testing Java and Spring Applications With Kotlin: Low-Risk to Adoption

Trending

  • Decoupling a Data Pipeline From the Tables It Was Never Supposed to Depend On
  • Spring AI on Local LLMs
  • When RabbitMQ Accepts a Message but Does Not Route It to a Queue
  • Event Sourcing in Distributed Systems: Architecture, Consistency, and Fault-Tolerant Projections

Draft This article hasn't been published, so readers can't see it.

In moderation This article is waiting for review, so readers can't see it yet.

Deleted This article has been deleted, so readers can't see it.

  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$$
·
Dec. 04, 13 · Interview
Post on X (opens in a new tab) Share on LinkedIn (opens in a new tab)
11.0K Views

Join the DZone community Save articles, join the discussion, and download Refcards and Trend Reports with a free account.

Join for free Already a member? Log in

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
  • Two Engines, One Query: DuckDB Inside Neo4j
  • Testing Java and Spring Applications With Kotlin: Low-Risk to Adoption

Partner Resources

×

Comments

Loading comments

The comments didn't load

Please try again in a moment.

Likes

Loading

The next likes didn't load. Please try again.

The likes didn't load

Please try again in a moment.

See who liked this

Log in or join DZone for free to see who liked this article.

Log in Join for free
  • 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