android - Maven 3 "uber jar" how to embed a jar within a jar? -


this has been killing me day. working on android / java in eclipse.

this want do

  • i want embed 1 of libraries - databaselibrary

  • within of libraries - logiclibrary

crucially - without exposing of methods in databaselibrary 3rd party has access logiclibrary.


i have tried including using proguard-maven-plugin this

 <configuration>                 <assembly>                  <inclusions>                      <inclusion>                          <groupid>xxx</groupid><artifactid>databaselibrary</artifactid><library>true</library>                      </inclusion>                  </inclusions>              </assembly>  

however includes methods databaselibrary , exposed them 3rd party.

i want logiclibrary able call against databaselibrary without 3rd party ever seeing it.

i have searched on web , seems called uber jar need do. have tried few methods such maven-assembly-plugin mentioned here https://stackoverflow.com/a/1834905/1312937

maven embed dependency artifact code in jar

however have got no this, looks maven 2 answer maybe there different need maven 3?

can tell me if uberjar correct way me achieve aims? if there alternate patterns please let me know, im not tied maven.

i think uber jar wrong route. instead accomplish goal of hiding methods databaselibrary make them accessible logic declare methods "protected" limits visibility package level. given make sure classes needed talk between jars within same package (though in seperate jars). force 3rd party vendor use public methods available them.

- databaselibrary   |- com.mycompany       |- databaseclass  -logiclibrary   |- com.mycompany       |- logicclass    public class databaseclass{     protected void dosomething(){     }  }   public class logicclass{     public void dosomething(){        databaseclass dbclass = new databaseclass();        dbclass.dosomething();     }  } 

now you're 3rd party vendor see logicclass.dosomething()

see also: http://docs.oracle.com/javase/tutorial/java/javaoo/accesscontrol.html


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

qt - Errors in generated MOC files for QT5 from cmake -