title: Maven project with native dependency and copying files
body: <p>I have the following scenario:</p>
  
  <p>mylib is a library (for which I have the sources, so I'd like to put them into a Maven project mylib:mylib for example). This library has a jar dependency for which I only have the jar, and it is not to be found in the Maven repository (and I do NOT want to install it there either). To make it compile, something like this would work: add the jar file to the mylib project in a "lib" folder, e.g. "lib/thirdpartylib.jar" and in mylib's pom.xml, add a dependency with self-chosen group/artifact/version and a "<code>&lt;scope&gt;system&lt;/scope&gt;&lt;systemPath&gt;${project.basedir}/lib/thirdpartylib.jar&lt;/systemPath&gt;</code>" entry. The mylib project will compile fine.</p>
  
  <p>Note that mylib also has a runtime dependency to a dll file, say thirdparty.dll. But for compilation this is not important.</p>
  
  <p>However, now what I am wondering how to achieve the following:</p>
  
  <p>Any other projects, e.g. project "X", that <strong>uses</strong> mylib, will need the</p>
  
  <pre><code>- mylib.jar
  - thirdpartylib.jar
  - thirdpartylib.dll
  </code></pre>
  
  <p>,</p>
  
  <p>and it'll have to set the java.library.path to the directory (e.g. ".") such that the thirdparty jar and dll are found by the executing VM. </p>
  
  <p>My concern is this: I would like the thirdparty jar/dll things to be the responsibility of the mylib project. I.e. I want to define the knowledge, that you need to copy the thirdparty jar and dll to the target folder and that java.library.path refers to them, to be part of the mylib project (the mylib pom knows how the thing is to be used in other projects). Yet, I want this knowledge (i.e. copy instructions, regardless how they are exactly done in Maven) to be transitively handed over to any other project using mylib, like X for example. Is that somehow possible?</p>
  
  <p>[My hack solution for now would be that I have a copy of the thirdparty things in X, but even then I dunno how to copy/deal with the dll file, so I'd have to write a readme saying that the dll file has to be copied to the bin folder of the executing VM).</p>
  
  <p>Any suggestions are appreciated!</p>