Maven multimodule dependency not found












0















I am getting a quite odd error that I can't seem to explain.



I have a multimodule maven project where I've built a module that tests the integration between two other modules.



So pretty much something like this:



root
|
+--dispatcher
|
+--worker
|
+--tester


and if I run the tester with IntelliJ everything is fine, however running it through maven fails.
And it fails because it cannot find a specific package, not because it cannot find the artifact.



I have tried creating a new project to test the concept behind module dependencies and it seems to work, but I cannot seem to find why.



So these are the pom files:



Parent:



<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
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>se.group</groupId>
<artifactId>parentid</artifactId>
<version>0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<description>Parent project for all maven modules.</description>

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.3.RELEASE</version>
<relativePath/>
</parent>

<modules>
<module>worker</module>
<module>dispatcher</module>
<module>service-testing</module>
</modules>
...
</project>


Dispatcher:



<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
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>dispatcher</artifactId>
<version>0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>dispatcher</name>

<parent>
<groupId>se.group</groupId>
<artifactId>parentid</artifactId>
<version>0.1-SNAPSHOT</version>
</parent>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<project.version>${project.version}</project.version>
</properties>

<scm>
<developerConnection>
scm:git:https://ghe.com/dispatcher.git
</developerConnection>
<connection>scm:git:https://ghe.com/dispatcher.git
</connection>
<url>https://ghe.com/dispatcher</url>
<tag>HEAD</tag>
</scm>

<distributionManagement>
<repository>
<id>releases</id>
<url>http://nexus.net/repository/maven-releases</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<url>http://nexus.net/repository/maven-snapshots</url>
</snapshotRepository>
</distributionManagement>
...
</project>


And tester:



<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
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>systemtest</artifactId>
<version>0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>systemtest</name>

<parent>
<groupId>se.group</groupId>
<artifactId>parentid</artifactId>
<version>0.1-SNAPSHOT</version>
</parent>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<project.version>${project.version}</project.version>
</properties>

<scm>
<developerConnection>
scm:git:https://ghe.com/dispatcher.git
</developerConnection>
<connection>scm:git:https://ghe.com/dispatcher.git
</connection>
<url>https://ghe.com/dispatcher</url>
<tag>HEAD</tag>
</scm>

<distributionManagement>
<repository>
<id>releases</id>
<url>http://nexus.net/repository/maven-releases</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<url>http://nexus.net/repository/maven-snapshots</url>
</snapshotRepository>
</distributionManagement>
<dependencies>
<dependency>
<groupId>se.group</groupId>
<artifactId>dispatcher</artifactId>
<version>0.1-SNAPSHOT</version>
<scope>test</scope>
</dependency>
</dependencies>
...
</project>


This should work right?



Ok, this is kind of odd I think.
If I run mvn clean install it breaks, but it seems as if it works if I run mvn clean package install










share|improve this question

























  • Did you define the dependencies between the modules correctly?

    – JF Meier
    Nov 14 '18 at 15:02











  • well the dependency is defined in the pom for the tester as written in the question. I assume that this is correct?

    – munHunger
    Nov 14 '18 at 15:03











  • please verify if this package exists somewhere after mvn clean and then after mvn package.

    – wirnse
    Nov 15 '18 at 0:13
















0















I am getting a quite odd error that I can't seem to explain.



I have a multimodule maven project where I've built a module that tests the integration between two other modules.



So pretty much something like this:



root
|
+--dispatcher
|
+--worker
|
+--tester


and if I run the tester with IntelliJ everything is fine, however running it through maven fails.
And it fails because it cannot find a specific package, not because it cannot find the artifact.



I have tried creating a new project to test the concept behind module dependencies and it seems to work, but I cannot seem to find why.



So these are the pom files:



Parent:



<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
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>se.group</groupId>
<artifactId>parentid</artifactId>
<version>0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<description>Parent project for all maven modules.</description>

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.3.RELEASE</version>
<relativePath/>
</parent>

<modules>
<module>worker</module>
<module>dispatcher</module>
<module>service-testing</module>
</modules>
...
</project>


Dispatcher:



<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
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>dispatcher</artifactId>
<version>0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>dispatcher</name>

<parent>
<groupId>se.group</groupId>
<artifactId>parentid</artifactId>
<version>0.1-SNAPSHOT</version>
</parent>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<project.version>${project.version}</project.version>
</properties>

<scm>
<developerConnection>
scm:git:https://ghe.com/dispatcher.git
</developerConnection>
<connection>scm:git:https://ghe.com/dispatcher.git
</connection>
<url>https://ghe.com/dispatcher</url>
<tag>HEAD</tag>
</scm>

<distributionManagement>
<repository>
<id>releases</id>
<url>http://nexus.net/repository/maven-releases</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<url>http://nexus.net/repository/maven-snapshots</url>
</snapshotRepository>
</distributionManagement>
...
</project>


And tester:



<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
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>systemtest</artifactId>
<version>0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>systemtest</name>

<parent>
<groupId>se.group</groupId>
<artifactId>parentid</artifactId>
<version>0.1-SNAPSHOT</version>
</parent>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<project.version>${project.version}</project.version>
</properties>

<scm>
<developerConnection>
scm:git:https://ghe.com/dispatcher.git
</developerConnection>
<connection>scm:git:https://ghe.com/dispatcher.git
</connection>
<url>https://ghe.com/dispatcher</url>
<tag>HEAD</tag>
</scm>

<distributionManagement>
<repository>
<id>releases</id>
<url>http://nexus.net/repository/maven-releases</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<url>http://nexus.net/repository/maven-snapshots</url>
</snapshotRepository>
</distributionManagement>
<dependencies>
<dependency>
<groupId>se.group</groupId>
<artifactId>dispatcher</artifactId>
<version>0.1-SNAPSHOT</version>
<scope>test</scope>
</dependency>
</dependencies>
...
</project>


This should work right?



Ok, this is kind of odd I think.
If I run mvn clean install it breaks, but it seems as if it works if I run mvn clean package install










share|improve this question

























  • Did you define the dependencies between the modules correctly?

    – JF Meier
    Nov 14 '18 at 15:02











  • well the dependency is defined in the pom for the tester as written in the question. I assume that this is correct?

    – munHunger
    Nov 14 '18 at 15:03











  • please verify if this package exists somewhere after mvn clean and then after mvn package.

    – wirnse
    Nov 15 '18 at 0:13














0












0








0








I am getting a quite odd error that I can't seem to explain.



I have a multimodule maven project where I've built a module that tests the integration between two other modules.



So pretty much something like this:



root
|
+--dispatcher
|
+--worker
|
+--tester


and if I run the tester with IntelliJ everything is fine, however running it through maven fails.
And it fails because it cannot find a specific package, not because it cannot find the artifact.



I have tried creating a new project to test the concept behind module dependencies and it seems to work, but I cannot seem to find why.



So these are the pom files:



Parent:



<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
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>se.group</groupId>
<artifactId>parentid</artifactId>
<version>0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<description>Parent project for all maven modules.</description>

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.3.RELEASE</version>
<relativePath/>
</parent>

<modules>
<module>worker</module>
<module>dispatcher</module>
<module>service-testing</module>
</modules>
...
</project>


Dispatcher:



<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
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>dispatcher</artifactId>
<version>0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>dispatcher</name>

<parent>
<groupId>se.group</groupId>
<artifactId>parentid</artifactId>
<version>0.1-SNAPSHOT</version>
</parent>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<project.version>${project.version}</project.version>
</properties>

<scm>
<developerConnection>
scm:git:https://ghe.com/dispatcher.git
</developerConnection>
<connection>scm:git:https://ghe.com/dispatcher.git
</connection>
<url>https://ghe.com/dispatcher</url>
<tag>HEAD</tag>
</scm>

<distributionManagement>
<repository>
<id>releases</id>
<url>http://nexus.net/repository/maven-releases</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<url>http://nexus.net/repository/maven-snapshots</url>
</snapshotRepository>
</distributionManagement>
...
</project>


And tester:



<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
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>systemtest</artifactId>
<version>0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>systemtest</name>

<parent>
<groupId>se.group</groupId>
<artifactId>parentid</artifactId>
<version>0.1-SNAPSHOT</version>
</parent>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<project.version>${project.version}</project.version>
</properties>

<scm>
<developerConnection>
scm:git:https://ghe.com/dispatcher.git
</developerConnection>
<connection>scm:git:https://ghe.com/dispatcher.git
</connection>
<url>https://ghe.com/dispatcher</url>
<tag>HEAD</tag>
</scm>

<distributionManagement>
<repository>
<id>releases</id>
<url>http://nexus.net/repository/maven-releases</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<url>http://nexus.net/repository/maven-snapshots</url>
</snapshotRepository>
</distributionManagement>
<dependencies>
<dependency>
<groupId>se.group</groupId>
<artifactId>dispatcher</artifactId>
<version>0.1-SNAPSHOT</version>
<scope>test</scope>
</dependency>
</dependencies>
...
</project>


This should work right?



Ok, this is kind of odd I think.
If I run mvn clean install it breaks, but it seems as if it works if I run mvn clean package install










share|improve this question
















I am getting a quite odd error that I can't seem to explain.



I have a multimodule maven project where I've built a module that tests the integration between two other modules.



So pretty much something like this:



root
|
+--dispatcher
|
+--worker
|
+--tester


and if I run the tester with IntelliJ everything is fine, however running it through maven fails.
And it fails because it cannot find a specific package, not because it cannot find the artifact.



I have tried creating a new project to test the concept behind module dependencies and it seems to work, but I cannot seem to find why.



So these are the pom files:



Parent:



<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
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>se.group</groupId>
<artifactId>parentid</artifactId>
<version>0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<description>Parent project for all maven modules.</description>

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.3.RELEASE</version>
<relativePath/>
</parent>

<modules>
<module>worker</module>
<module>dispatcher</module>
<module>service-testing</module>
</modules>
...
</project>


Dispatcher:



<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
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>dispatcher</artifactId>
<version>0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>dispatcher</name>

<parent>
<groupId>se.group</groupId>
<artifactId>parentid</artifactId>
<version>0.1-SNAPSHOT</version>
</parent>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<project.version>${project.version}</project.version>
</properties>

<scm>
<developerConnection>
scm:git:https://ghe.com/dispatcher.git
</developerConnection>
<connection>scm:git:https://ghe.com/dispatcher.git
</connection>
<url>https://ghe.com/dispatcher</url>
<tag>HEAD</tag>
</scm>

<distributionManagement>
<repository>
<id>releases</id>
<url>http://nexus.net/repository/maven-releases</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<url>http://nexus.net/repository/maven-snapshots</url>
</snapshotRepository>
</distributionManagement>
...
</project>


And tester:



<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
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>systemtest</artifactId>
<version>0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>systemtest</name>

<parent>
<groupId>se.group</groupId>
<artifactId>parentid</artifactId>
<version>0.1-SNAPSHOT</version>
</parent>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<project.version>${project.version}</project.version>
</properties>

<scm>
<developerConnection>
scm:git:https://ghe.com/dispatcher.git
</developerConnection>
<connection>scm:git:https://ghe.com/dispatcher.git
</connection>
<url>https://ghe.com/dispatcher</url>
<tag>HEAD</tag>
</scm>

<distributionManagement>
<repository>
<id>releases</id>
<url>http://nexus.net/repository/maven-releases</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<url>http://nexus.net/repository/maven-snapshots</url>
</snapshotRepository>
</distributionManagement>
<dependencies>
<dependency>
<groupId>se.group</groupId>
<artifactId>dispatcher</artifactId>
<version>0.1-SNAPSHOT</version>
<scope>test</scope>
</dependency>
</dependencies>
...
</project>


This should work right?



Ok, this is kind of odd I think.
If I run mvn clean install it breaks, but it seems as if it works if I run mvn clean package install







java maven pom.xml






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 14 '18 at 15:48









user944849

10.3k4161




10.3k4161










asked Nov 14 '18 at 14:32









munHungermunHunger

441515




441515













  • Did you define the dependencies between the modules correctly?

    – JF Meier
    Nov 14 '18 at 15:02











  • well the dependency is defined in the pom for the tester as written in the question. I assume that this is correct?

    – munHunger
    Nov 14 '18 at 15:03











  • please verify if this package exists somewhere after mvn clean and then after mvn package.

    – wirnse
    Nov 15 '18 at 0:13



















  • Did you define the dependencies between the modules correctly?

    – JF Meier
    Nov 14 '18 at 15:02











  • well the dependency is defined in the pom for the tester as written in the question. I assume that this is correct?

    – munHunger
    Nov 14 '18 at 15:03











  • please verify if this package exists somewhere after mvn clean and then after mvn package.

    – wirnse
    Nov 15 '18 at 0:13

















Did you define the dependencies between the modules correctly?

– JF Meier
Nov 14 '18 at 15:02





Did you define the dependencies between the modules correctly?

– JF Meier
Nov 14 '18 at 15:02













well the dependency is defined in the pom for the tester as written in the question. I assume that this is correct?

– munHunger
Nov 14 '18 at 15:03





well the dependency is defined in the pom for the tester as written in the question. I assume that this is correct?

– munHunger
Nov 14 '18 at 15:03













please verify if this package exists somewhere after mvn clean and then after mvn package.

– wirnse
Nov 15 '18 at 0:13





please verify if this package exists somewhere after mvn clean and then after mvn package.

– wirnse
Nov 15 '18 at 0:13












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53302611%2fmaven-multimodule-dependency-not-found%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53302611%2fmaven-multimodule-dependency-not-found%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Bressuire

Vorschmack

Quarantine