-1

I have a Java project with Maven dependency management. I copied it to another workstation and imported to IntelliJ IDEA. Dependencies from pom.xml file are not resolved. Maven Integration plugin is enabled, but Maven's Reimport function has no effect. settings.xml file in .m2 folder:

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                      https://maven.apache.org/xsd/settings-1.0.0.xsd">
</settings>

Import Maven projects automatically option is set to on. I use JDK version 1.8.0_171 and Maven 3.5.4, which I set path manually in IDE.

IDE information:

IntelliJ IDEA 2018.1.5 (Community Edition)
Build #IC-181.5281.24, built on June 12, 2018
JRE: 1.8.0_152-release-1136-b39 x86
JVM: OpenJDK Server VM by JetBrains s.r.o
Windows 10 10.0
plaidshirt
  • 5,189
  • 19
  • 91
  • 181
  • Is it projects that are released or snapshots? Is your local repository property rebuilt once on the new worksation? – DamCx Jul 03 '18 at 13:13
  • @DamCx : I can't rebuild it, because it gives error during build, because of unresolved classes. It is not a released project. – plaidshirt Jul 03 '18 at 13:15
  • Is it a standalone project, or does it have other "home-made" dependencies? if "home-made" ones, you might have to get them on your workstation and rebuild them, prior to your main project – DamCx Jul 03 '18 at 13:17
  • 2
    Independent of intellij Idea, can you build the maven project from command line? – gagan singh Jul 03 '18 at 13:18
  • @DamCx : It uses dependencies only from Maven Central. – plaidshirt Jul 03 '18 at 13:22
  • @gagansingh : Yes, it is working. – plaidshirt Jul 03 '18 at 13:22
  • then it should work in idea as well. Did you check idea logs? – gagan singh Jul 03 '18 at 13:27
  • When you open the pom.xml in the editor, what does the analyse result say in the top right? Green checkmark or does it show something is wrong? I've seen this problem when intellij itself does not like the pom. Low chance since everything builds on the command line, but without anything to look at its pretty much just a guessing game. – Gimby Jul 03 '18 at 13:27
  • @Gimby : Yes, there is a green tick there when I open pom.xml. – plaidshirt Jul 03 '18 at 13:34
  • So just to be sure that assumptions and reality match up: you base your findings on the fact that when you click the **maven projects** tab, the **dependencies** menu tree item is empty? – Gimby Jul 03 '18 at 13:36
  • @Gimby : No, I see there the dependencies. I wonder why aren't these resolved in Java classes. – plaidshirt Jul 03 '18 at 13:59
  • @Gimby : I see, but error is about missing methods. Aren't there any other error messages. Dependencies aren't resolved properly, because methods couldn't be found. – plaidshirt Jul 04 '18 at 10:57

1 Answers1

0

I copied repository folder under .m2 folder from my computer to second workstation and after that Maven dependencies are resolved.

plaidshirt
  • 5,189
  • 19
  • 91
  • 181