When creating a shared library, what should the common logic application's pom.xml required dependencies' scopes be?

Prepare for the MuleSoft Developer 2 Certification Exam. Access practice quizzes featuring flashcards and multiple choice questions with explanations. Get confident and ready for your certification success!

Multiple Choice

When creating a shared library, what should the common logic application's pom.xml required dependencies' scopes be?

Explanation:
When building a shared library, dependencies that the Mule runtime supplies should use the provided scope. This makes the libraries available to compile the shared library, but instructs Maven not to package them into the library artifact because the runtime will provide them at deployment. Using compile would bundle those dependencies into the library jar, leading to duplication and possible version conflicts with the Mule runtime. Using runtime wouldn’t satisfy the need for these dependencies during compilation, and Test is only for test code, not for the library’s normal execution.

When building a shared library, dependencies that the Mule runtime supplies should use the provided scope. This makes the libraries available to compile the shared library, but instructs Maven not to package them into the library artifact because the runtime will provide them at deployment. Using compile would bundle those dependencies into the library jar, leading to duplication and possible version conflicts with the Mule runtime. Using runtime wouldn’t satisfy the need for these dependencies during compilation, and Test is only for test code, not for the library’s normal execution.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy