I have project with few modules. One of them is "core" which compiles into jar and I'm using it as dependency for all other modules.
pom.xml for "core" module:
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>my-project</artifactId>
<groupId>com.myproject</groupId>
<version>1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<version>1.0</version>
<artifactId>my-core-project</artifactId>
<packaging>jar</packaging>
<dependencies>
<!-- Test Dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
pom.xml for app module
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>my-project</artifactId>
<groupId>com.myproject</groupId>
<version>1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>war</packaging>
<artifactId>my-project-app</artifactId>
<version>1.0</version>
<dependencies>
<!-- ... -->
<dependency>
<groupId>com.myproject</groupId>
<artifactId>my-core-project</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
</project>
Second module is App Engine module. So I can run in console mvn install
for my core module and than run mvn appengine:devserver
for app module and it will work. But I want to run app module from IDE. I have installed App Engine plugin for Intelij, and add configuration to run my app module, but the problem is that run fails with error
Error:(10, 15) java: package org.junit does not exist
Tests are inside core project, and structure of core module is like this
.
├── my-core-project.iml
├── pom.xml
├── src
│ ├── main
│ │ ├── java
│ │ └── resources
│ └── test
│ ├── java
│ └── resources
How can I run app module from IDE?