I am not a lawyer, so take this with a huge disclaimer.
There are 3 fundamental types of open source licenses:
* permissive (Apache, MIT, BSD etc.)
* weak copy left (LGPL, GPL with linking exception, MPL etc.)
* strong copy left (GPL, AGPL)
With permissive licenses you can freely mix the open
source and your proprietary code. There may be a requirement
to mention the open source and its license, but that should
not be a problem.
With weak copy left there is a divide - you have
one bucket of proprietary code and another bucket of
open source code. The open source code and whatever
modifications you make to it must stay under the open
source license.
With strong copy left everything combined incl. your
code comes under the open source license. Combined
means linking or referencing. So you cannot keep your
code proprietary and link with open source under a
strong copy left license.
Within each license there are small variations.
LGPL requires that a problem using a LGPL library is
linked in a way so the library can be updated independently
of the program. Not a problem in Java, but for native code
that means dynamic linking.
GPL only matters if you distribute your code - for internal
use there is no impact.
AGPL matters if you either distribute your code or
expose it to other as a service (SaaS model).
If you use N open source pieces then you obviously need
to comply with each of the N licenses.
Lots of software is under MPL including FireFox,
H2, RabbitMQ and LibreOffice. MPL is perfectly legal.
The problem with MPL 1.x is that it per FSF is
incompatible with GPL - you cannot mix MPL 1.x software
and GPL software due to conflicting license requirements.
That was "fixed" in MPL 2.0, so it can be mixed with GPL.
Arne