AppEngine.iml pom.xml both list dependencies, what goes in which?
-
20-12-2019 - |
Frage
steps: New Project, Generate AppEngine
examine -AppEngine.iml and pom.xml in AppEngine module,
Following the https://developers.google.com/appengine/docs/java/endpoints/getstarted/backend/write_api
I added these imports:
import com.google.api.server.spi.config.Api;
import javax.inject.Named;
import java.util.ArrayList;
this would not compile (javax.inject not found) so I modified d20-AppEngine.iml which did not help:
<orderEntry type="library" name="Maven: javax.inject:javax.inject:1" level="project" />
so I added to pom.xml:
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
</dependency>
and it compiles.
What is the happening with the .iml file and the pom.xml file? When would I add Maven information versus Gradle dependencies in pom.xml
thanks
Lösung
.iml
file is specific to Intellij. When describing dependencies you should only use the pom.xml
or the equivalent of gradle.
The IDEA project files like .iml
are generated off the pom.xml
. This is a good thing because if you are working with another developer they can use an IDE of their choice. There is no special IDE properties they have to set.