Note that there are some explanatory texts on larger screens.

plurals
  1. POMaven depend specific classes
    text
    copied!<p>In the following senario</p> <p>I'm wrapping an <strong>external</strong> jar file (read a dependency I've no control over) and wrapping this in a service to be exposed over RMI.</p> <p>I'd like my <strong>service interface</strong> to also be exported as a maven dependency however as it will be returning classes defined in the dependency this means that the dependency itself will be used as a dependency of my service interface. </p> <p>Unfortunatly the origional jar file contains many classes that are not relevant to my exposed service.</p> <p><em>Is it possible to depend on just a few classes in that jar file in maven (possibly by extracting and repackaging the few classes that are relevant)?</em></p> <ul> <li>uberbig_irrelevant.jar <ul> <li>com.uberbig.beans &lt;-- Need this package or a few classes in it.</li> <li>com.uberbig.everythingElse</li> </ul></li> </ul> <p>Service project includes all of uberbig jar. But exposes a service BeanService which has a call which returns an insance of com.uberbig.beans.IntrestingLightWeightSerialiasbleBean.</p> <p>Service interface project needs to have a bean definition that looks like</p> <pre><code>interface BeanFetcher { public IntrestingLightWeightSerialiasbleBean fetchBeanById(long beanId); } </code></pre> <p>So ideally my serviceInterface jar file would only include the BeanFetcher interface. The definition of IntrestingLightWeightSerialiasbleBean and any direct dependencies of IntrestingLightWeightSerialiasbleBean.</p> <p>The project is for use internally and won't be publically exposed so there should be no problems repackaging so long as the repackaged bean definitions are binary and searially compatable with the external jar file.</p> <p>Any Suggestions?</p> <p>Possibly related question <a href="https://stackoverflow.com/questions/6373534/maven-depend-on-project-no-jar-but-classes">Maven depend on project - no jar but classes</a></p> <p>Maybe I could use something from the dependency:copy section of the <a href="http://maven.apache.org/plugins/maven-dependency-plugin/usage.html" rel="nofollow noreferrer" title="maven-depenency-plugin">maven-dependency-plugin</a> but I haven't figured out how to do that. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload