Clicking on Reload All Maven Projects is throwing errors but running maven install does not

Answered

Hi,

 

I am a pro user of intellij. I have a multi-module maven project. I have configured custom maven version (3.6.3) and custom maven settings to use S3 as our custom artifact repository. So, the problem is when I click on "Reload All Projects" button in the maven section, it is throwing an error saying "Could not connect to repository" but whereas when I go to "Lifecycle" -> "install" it does not throw anything. It just runs fine.

I want to understand what command does "Reload All Projects" run internally? I tried to find this by looking at my "htop" to see the process but I couldn't find anything relevant. Does this not use the custom maven and settings I configured?

 

Please find the screenshots below

Maven configuration - https://imgur.com/a/Ilf6XLV

"Reload All Projects" - https://imgur.com/a/TRmmamJ

Clicking on "Install" lifecycle - https://imgur.com/eccjRw1

0
15 comments
Hi Lokesh - does it make a difference if you delegate build/run actions to Maven under 'File | Settings | Build, Execution, Deployment | Build Tools | Maven | Runner'?

Please also attach a screenshot of that dialog.
0

Hey Arina Efremova

I tried that but it's still happening the same. I think the problem could be the runner is not using the custom settings file I provided `~/.m2/settings.xml` but when I run "install" it is able to use the custom settings.

Here is the settings.xml file I have

```

<settings>

    <servers>
        <server>
            <id>s3.release</id>
            <username>XYZ</username>
            <password>XYZ</password>
            <filePermissions>AuthenticatedRead</filePermissions>
        </server>
        <server>
            <id>s3.snapshot</id>
            <username>XYZ</username>
            <password>XYZ</password>
            <filePermissions>AuthenticatedRead</filePermissions>
        </server>
    </servers>
</settings>

```

Here's the screenshot of it - https://imgur.com/zccJiDk

 

0
Please provide the idea.log file collected after reproducing the issue: Help | Show Log in...

Also a screenshot of the 'File | Settings | Build, Execution, Deployment | Build Tools | Maven | Runner' dialog.
0

Hi! Do you use any Maven extensions? If so, where do you define them - directly in pom.xml or in external file?

0

Andrey Dernov

I see that we are using extensions and it's defined in pom.xml

<extensions>
<extension>
<groupId>org.kuali.maven.wagons</groupId>
<artifactId>maven-s3-wagon</artifactId>
<version>1.2.1</version>
</extension>
</extensions>
0

Could be the

IDEA-266313 Maven integration in 2021.1 does not use aws-maven extension if defined directly in pom.xml but uses it if defined in a separate xml file

Could you try if it helps to define it in a separate file?

0

Andrey Dernov - I am not using maven wrapper, so I created a `.mvn` folder and a new file `extensions.xml` and tried with this

 

<extensions xmlns="http://maven.apache.org/EXTENSIONS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/EXTENSIONS/1.0.0 http://maven.apache.org/xsd/core-extensions-1.0.0.xsd">
<extension>
<groupId>org.kuali.maven.wagons</groupId>
<artifactId>maven-s3-wagon</artifactId>
<version>1.2.1</version>
</extension>
</extensions>

still not working!

0

Thank you. Could you please try using some older Maven versions?

0

Andrey Dernov

Can you please be more specific here? I mentioned that I am already using 3.6.3 which version do you want me to use? Intellij being a decade old IDE, isn't this a very obvious issue and you guys should have fixed it earlier? Also, you guys are taking too much time to troubleshoot

0

Intellij being a decade old IDE, isn't this a very obvious issue and you guys should have fixed it earlier? 

There was an issue IDEA-266313 that has been fixed but it may have resurfaced for new Maven versions, that is why I asked you to try older versions to check if this hypothesis is true.

Also, you guys are taking too much time to troubleshoot

I totally understand that this could be frustrating and I'm sorry about such a long turnarounds and I thank you for your patience. Unfortunately, it is hard to find the problem without a reproducer. By the way - would it be possible to have the project which fails for you? It would help our developers a lot.

Thank you.

0

Andrey Dernov

Hi, thanks for the quick update. Unfortunately, I cannot share the project as it is an enterprise entity. Which maven version you want me to try? I am using 3.6.3 currently

0

Indeed 3.6.3 is quite an old version already. It looks like the problem is not in a Maven version. Especially if it works with latest versions. I have reported the issue to investigate: IDEA-329722 Maven sync cannot download artifacts from s3 wagon repository, but Maven goal completes successfully

Please vote for it and follow for the updates.

0

Also, to get more information for the investigation it would be very helpful if you would

- enable Settings | Build, Execution, Deployment | Build Tools | Maven | Print exception stack traces option

- set the output level to Debug in IDE Maven settings

- enabled debug level for IDE logs by adding 

#org.jetbrains.idea.maven

line to Help | Diagnostic Tools | Debug Log Settings... dialog.

And after reproducing, attach maven output and IDE logs (using Help | Collect Logs and Diagnostic Data action).

Thank you!

0

Andrey Dernov - Done, added to the ticket. Thanks!

0

Please sign in to leave a comment.