2

I've got a Maven plugin that depends on slf4j for logging. The default behavior is too chatty for my liking but I can't figure out how to add my logback.xml to the plugin's classpath.

<plugin>
  <dependencies>
  </dependencies>
</plugin>

allows you to add dependencies to the plugin's classpath, but how do you add local (resource) directories?

2
  • Can you tell us which plugin? Commented Apr 13, 2012 at 17:43
  • @khmarbaise: It shouldn't matter, but in my case it's jooq.org Commented Apr 13, 2012 at 18:31

2 Answers 2

1

You have to wrap your logback.xml into a proper Maven artifact (i.e. a jar) and install it to local repository or deploy to your shared repository, or use systemPath in your dependency declaration to point to a jar placed somewhere inside of your project, which is highly not recommended.

The reason for this is reusability of your build. Think how others would be able to reproduce it.

Sign up to request clarification or add additional context in comments.

2 Comments

Are you honesty telling me that I need to create an entire artifact to contain logback.xml? There would be not reusability problem if I was allowed to add the project's resources directory to the plugin's classpath.
It will take you less then a minute to create a jar with your logback.xml in it. There are a lot of happening in Maven under the hood, so adding project folders to plugin classpath is not exactly fit into the Maven plugin model. Unlike a folder, an artifact is a versioned entity, maybe it is unimportant in your case, but it is critical for an overall Maven's plugin classpath resolution.
0

You don't. You must package them up as an artifact and add it as a dependency.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.