# Gradle trying to download parent pom dependency as jar file

**URL:** <https://discuss.gradle.org/t/gradle-trying-to-download-parent-pom-dependency-as-jar-file/49791>\
**Category:** Help/Discuss\
**Created:** [November 5, 2024, 1:18pm UTC](https://discuss.gradle.org/t/gradle-trying-to-download-parent-pom-dependency-as-jar-file/49791 "2024-11-05T13:18:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rakesh2711](https://avatars.discourse-cdn.com/v4/letter/r/7ba0ec/32.png) [@Rakesh2711](https://discuss.gradle.org/u/Rakesh2711)\
**Post date:** [November 5, 2024, 1:18pm UTC](https://discuss.gradle.org/t/gradle-trying-to-download-parent-pom-dependency-as-jar-file/49791/1 "2024-11-05T13:18:05Z")

</div>

I am migrating a project from maven to Gradle.

```xml

<parent>
 <groupId>com.xxxxxx.unifiedframework</groupId>
    <artifactId>uf-soap-parent</artifactId>
    <version>2.7.3</version>
</parent>

```

For the above maven dependency,  
It’s Gradle equivalent, I defined in build gradle is as follows.

```java
dependencies {
   Implementation(platform ("com.xxxx.unifiedframework:uf-soap-parent:2.7.3"))
}

```

When I did local build, it’s was successful.  
But when I pushed my code to git, Jenkins jobs failing  
With following error

```java
What went wrong:
Execution failed for task: 'DecisioningRulesServiceApplication:war'.
Could not resolve all files for configuration 'DecisioningRulesServiceApplication:runtimeClasspath'.
Could not find com.xxxxxx.unifiedframework:uf-soap-parent:2.7.3.
15:31:53 Searched in the following locations:
15:31:53 - 

https://artifactory.xxxxx.com/artifactory/maven-external-virtual/com/xxxxx/unifiedframework/uf-soap-parent/2.7.3/uf-soap-parent-2.7.3.jar

```

From the error, we can say that it’s looking for jar file, but it’s should look for parent pom file.

Note that build was successful in my local, facing issue when the Jenkins jobs run.

---

<div class="post-metadata">

**Author:** ![Rakesh2711](https://avatars.discourse-cdn.com/v4/letter/r/7ba0ec/32.png) [@Rakesh2711](https://discuss.gradle.org/u/Rakesh2711)\
**Post date:** [November 6, 2024, 5:14pm UTC](https://discuss.gradle.org/t/gradle-trying-to-download-parent-pom-dependency-as-jar-file/49791/2 "2024-11-06T17:14:04Z")

</div>

When I commented mavenLocal(), then local build also failing with same above error.

---

<div class="post-metadata">

**Author:** ![Vampire](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/vampire/32/9082_2.png) [@Vampire](https://discuss.gradle.org/u/Vampire)\
**Post date:** [November 6, 2024, 5:41pm UTC](https://discuss.gradle.org/t/gradle-trying-to-download-parent-pom-dependency-as-jar-file/49791/3 "2024-11-06T17:41:23Z")

</div>

Yeah, using `mavenLocal()` is seldomly a good idea as it is broken-by-design in Maven already. The main effects are, that your builds become unreliable, non-reproducible, flaky, and slow. If you really must use it, it should always be the last in the list of repositories and always with a repository content filter that controls what exactly is resolved from it. See [Declaring repositories](https://docs.gradle.org/current/userguide/declaring_repositories_adv.html#sec:case-for-maven-local) for more details about that.

Regarding the actual error, it is hard to tell what causes this without seeing your build.  
If you only use it as `platform(...)` it should not try to get the `jar` I think.  
Well, maybe if the `packaging` is not correctly set to `pom`, I’m not sure.  
Maybe some other dependency depends on it badly as dependency or something like that. 🤷‍♂️
