1. Why does it have to be this particular repository?
javax.inject just contains a handful of classes (well interfaces) related to injection. ServletException is not in there. The JBoss dependency is actually a pom dependency not a jar. This means it contains a reference to other dependencies. You can
look at it and see that it does in fact include javax.inject.
It also includes a number of other dependencies that are used in Java EE including the
servlet one. You don't have to use the JBoss package. But it certainly makes things easier since it is your server.
One thing that surprises me is that they don't use <scope>provided</scope> in those dependencies. You wouldn't want all these dependencies to be in your war or ear file.
2. How can I find out, which repository to use in my dependencies?
Either an example or searching. Your idea to search was fine.
3. What is an easy / right way to create the POM? You can let maven create it for you, but you gotta choose what archetype to use. How do I know, which archetype I need?
It depends on the type of the project. For example for a web application, you might used maven-archetype-webapp. I don't typically use archetypes. I have a parent pom file with the dependencies I commonly need and just inherit it. Which is similar to what you did with JBoss pom except you didn't extend it.
4. Is there a way to automatically adjust an existing POM in an imported project?
I'm not sure what you mean by this.
5. Is there a good explanation about maven / pom, that would answer my question?
I like the
free e-book Better Builds with Maven. It explains the parts of the pom nicely.