-2

I wants to build my anndroid project with maven.

There are 3 projects


Project - A (jar file )

Project - B (jar file )

Project - C (sdk package)


Project C is depended on B

Project B is depended on A

With maven I wants to release two flavor of by build

1st flavor : Release JAR from B (which contain code from B & A)

2nd flavor : Release SDK from C (which contain code from C & B & A)

Can I control this behaviors from MAVEN.

1 Answers1

1

For the "1st flavor", you can use the maven-assembly-plugin with the predefined desriptor jar-with-dependencies that will embed all the dependencies into your project's jar, but pay attention to the transitive dependencies that could be embedded into it also. Otherwise you can also use the maven-shade-plugin which is having options that you could be interested in like minimizeJar and an easier way to configure of includes and excludes (see doc here).

For the "2nd flavor", the use of the maven-assembly-plugin would fit well with its bin descriptor or by defining your own descriptor if you need to include other files (see the descriptor format here). You can find a few examples on how to configure and use the maven-assembly-plugin for that on SO (you can also look at the questions I already answered about this plugin)

Fabien
  • 859
  • 6
  • 15