There is a detailed explanation of why Naboo was invaded, after the film credits.
Moviegoers are told very little about why Naboo was invaded, but the few facts we get are credible, albeit too sparse to test with the criteria for just wars.