I have two modules: StorageHelper and RostislavUtil . The problem is that one module does not see the packages and classes of another! Dependence on the second module is, the second module sees its class. Moreover, IDEA itself invites me to add a module depending on it, and when I agree, everything starts all over again.

enter image description here


pom.xml of StorageHelper 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"> <modelVersion>4.0.0</modelVersion> <artifactId>StorageModule</artifactId> <version>1.0</version> <name>StorageModule</name> <parent> <groupId>com.dugin.rostislav</groupId> <artifactId>OSLoaderServer</artifactId> <version>1.0</version> <relativePath>../pom.xml</relativePath> </parent> <dependencies> <dependency> <groupId>com.dugin.rostislav</groupId> <artifactId>RostislavUtil</artifactId> <version>1.0</version> </dependency> <dependency> <groupId>com.j256.ormlite</groupId> <artifactId>ormlite-core</artifactId> <version>4.47</version> </dependency> <dependency> <groupId>com.j256.ormlite</groupId> <artifactId>ormlite-jdbc</artifactId> <version>4.47</version> </dependency> <dependency> <groupId>org.xerial</groupId> <artifactId>sqlite-jdbc</artifactId> <version>3.8.11.2</version> </dependency> </dependencies> </project> 

pom.xml root project:

 <?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"> <modelVersion>4.0.0</modelVersion> <groupId>com.dugin.rostislav</groupId> <artifactId>OSLoaderServer</artifactId> <name>OSLoaderServer</name> <packaging>pom</packaging> <version>1.0</version> <modules> <module>RostislavUtil</module> <module>StorageModule</module> <module>HandlingModule</module> </modules> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.8</source> <target>1.8</target> </configuration> </plugin> </plugins> </build> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.12</version> </dependency> <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <version>1.16.8</version> <scope>provided</scope> </dependency> <dependency> <groupId>com.google.code.findbugs</groupId> <artifactId>jsr305</artifactId> <version>2.0.1</version> </dependency> <dependency> <groupId>org.json</groupId> <artifactId>json</artifactId> <version>20160212</version> </dependency> <dependency> <groupId>com.google.inject</groupId> <artifactId>guice</artifactId> <version>4.0</version> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <version>3.1.0</version> </dependency> </dependencies> </project> 

What is the problem and how to fix it?


UPD_0:

enter image description here

UPD_1:

enter image description here

    1 answer 1

    File -> project structure -> Modules -> Select StorageModules module -> Dependencies -> Click the green plus sign on the right -> Module dependency -> Select RostislavUtils module -> Ok -> Ok

    • There was a mistake (hooray! I found at least a clue!). As I understand, not enough. Jar'nik? - user189127
    • What jar? You can do Module Dependency, not Library - Andrew Bystrov
    • And how to do it, I tried, but I wrote that the source directory could not be in the module ... I attached a screenshot so that it was visible. - user189127
    • Although I will put it into a separate question, you have already helped with the question above :)). - user189127