# Gradle attempts to access missing jar file for Maven module with packaging = 'pom'

**URL:** <https://discuss.gradle.org/t/gradle-attempts-to-access-missing-jar-file-for-maven-module-with-packaging-pom/2394>\
**Category:** Old Forum Archive\
**Created:** [August 20, 2012, 7:14am UTC](https://discuss.gradle.org/t/gradle-attempts-to-access-missing-jar-file-for-maven-module-with-packaging-pom/2394 "2012-08-20T07:14:00Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Detlef](https://avatars.discourse-cdn.com/v4/letter/d/46a35a/32.png) [@Detlef](https://discuss.gradle.org/u/Detlef)\
**Post date:** [August 20, 2012, 7:14am UTC](https://discuss.gradle.org/t/gradle-attempts-to-access-missing-jar-file-for-maven-module-with-packaging-pom/2394/1 "2012-08-20T07:14:00Z")

</div>

Hi Gradle support. I have a gradle script that has a dependency defined : ` repositories {`

mavenCentral() } dependencies {

classpath group: ‘commons-io’, name: ‘commons-io’, version: ‘2.1’, ext: ‘jar’ } ``

And when I execute the script the following messages appear: ` Download http://repo1.maven.org/maven2/commons-io/commons-io/2.1/commons-io-2.1.pom Download http://repo1.maven.org/maven2/org/apache/commons/commons-parent/22/commons-parent-22.pom Download http://repo1.maven.org/maven2/org/apache/apache/9/apache-9.pom Resource missing. [HTTP HEAD: http://repo1.maven.org/maven2/org/apache/apache/9/apache-9.jar] Resource missing. [HTTP HEAD: http://repo1.maven.org/maven2/org/apache/commons/commons-parent/22/commons-parent-22.jar] `

The POM of commons-io defines a parent and that defines another parent (apache-9) for which there is no jar file available.

Questions:

- Does that need to worry me ?

- Can I stop gradle to look into the parent POM files of a dependency ? I tried

` dependencies {`

classpath (group: ‘commons-io’, name: ‘commons-io’, version: ‘2.1’, ext: ‘jar’){

transitive=false }

with the same result: - The same message appear for me when I download a snapshot release from my plugin that I develop. I use the maven plugin for uploading it into a nexus. ` Resource missing. [HTTP GET: http:///nexus/content/repositories/public/com/csg/gcidPlugin/1.4.7-SNAPSHOT/gcidPlugin-1.4.7-SNAPSHOT.pom] `

Thanks for you support.

Detlef

---

<div class="post-metadata">

**Author:** ![daz](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/daz/32/2475_2.png) [@daz](https://discuss.gradle.org/u/daz)\
**Post date:** [August 20, 2012, 9:21pm UTC](https://discuss.gradle.org/t/gradle-attempts-to-access-missing-jar-file-for-maven-module-with-packaging-pom/2394/2 "2012-08-20T21:21:00Z")

</div>

A maven pom file gives us no indication as to whether it has an associated jar file, so we need to check to see if one exists. The “Resource missing” log messages you see are for pom files that have no associated jar file.

Short story - this is nothing to worry about, and there’s not much we can do about it, except by decreasing our logging, which we’d rather not do. (I assume you’re executing your build with ‘–info’).

---

<div class="post-metadata">

**Author:** ![Peter\_Niederwieser](https://avatars.discourse-cdn.com/v4/letter/p/9f8e36/32.png) [@Peter\_Niederwieser](https://discuss.gradle.org/u/Peter_Niederwieser)\
**Post date:** [August 20, 2012, 10:21pm UTC](https://discuss.gradle.org/t/gradle-attempts-to-access-missing-jar-file-for-maven-module-with-packaging-pom/2394/3 "2012-08-20T22:21:00Z")

</div>

Can’t we infer this from the POM’s packaging type? For example, POMs without artifacts have ‘pom’ packaging, POMs with a Jar have ‘jar’ packaging, and so on. (Not saying the mapping is identity.)

---

<div class="post-metadata">

**Author:** ![daz](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/daz/32/2475_2.png) [@daz](https://discuss.gradle.org/u/daz)\
**Post date:** [August 21, 2012, 7:02pm UTC](https://discuss.gradle.org/t/gradle-attempts-to-access-missing-jar-file-for-maven-module-with-packaging-pom/2394/4 "2012-08-21T19:02:00Z")

</div>

Currently, we consider the ‘jar’ artifact _optional_ for a POM with packaging of type ‘pom’. So we include it if it exists, but it’s fine if it doesn’t. This is the behaviour we inherited from Ivy, and it may not be correct.

I’m not familiar enough with Maven to know if pom packaging + jar file is a valid idiom, or if we could safely deprecated this behaviour and remove it for Gradle 2.0.

---

<div class="post-metadata">

**Author:** ![Peter\_Niederwieser](https://avatars.discourse-cdn.com/v4/letter/p/9f8e36/32.png) [@Peter\_Niederwieser](https://discuss.gradle.org/u/Peter_Niederwieser)\
**Post date:** [August 21, 2012, 7:43pm UTC](https://discuss.gradle.org/t/gradle-attempts-to-access-missing-jar-file-for-maven-module-with-packaging-pom/2394/5 "2012-08-21T19:43:00Z")

</div>

I wouldn’t expect ‘pom’ packaging + Jar file to work in Maven, as the whole purpose of ‘pom’ packaging is to have a POM without an artifact. We should verify this and act accordingly.

Common use cases for ‘pom’ packaging are 1. parent POM in a multi-module build 2. “aggregate” POM (a POM with multiple dependency declarations that are often used together; client builds can then reference the POM module instead of the individual modules).

---

<div class="post-metadata">

**Author:** ![daz](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/daz/32/2475_2.png) [@daz](https://discuss.gradle.org/u/daz)\
**Post date:** [August 22, 2012, 4:20pm UTC](https://discuss.gradle.org/t/gradle-attempts-to-access-missing-jar-file-for-maven-module-with-packaging-pom/2394/6 "2012-08-22T16:20:00Z")

</div>

If that’s the case, then we should certainly deprecate the current behaviour: we’ll do this by still checking if the jar exists, but emitting a deprecation warning if it is found. Then we can change this for 2.0.

---

<div class="post-metadata">

**Author:** ![daz](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/daz/32/2475_2.png) [@daz](https://discuss.gradle.org/u/daz)\
**Post date:** [August 22, 2012, 4:28pm UTC](https://discuss.gradle.org/t/gradle-attempts-to-access-missing-jar-file-for-maven-module-with-packaging-pom/2394/7 "2012-08-22T16:28:00Z")

</div>

I’ve created GRADLE-2443 to investigate / deprecate / remove this unnecessary HTTP HEAD request.

---

<div class="post-metadata">

**Author:** ![adammurdoch](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/adammurdoch/32/17_2.png) [@adammurdoch](https://discuss.gradle.org/u/adammurdoch)\
**Post date:** [August 23, 2012, 3:28am UTC](https://discuss.gradle.org/t/gradle-attempts-to-access-missing-jar-file-for-maven-module-with-packaging-pom/2394/8 "2012-08-23T03:28:00Z")

</div>

@Daz, don’t you remember fixing the issue where we stopped checking for the jar file when packaging == ‘pom’ and this broke a bunch of builds (GRADLE-1975 and others)?

---

<div class="post-metadata">

**Author:** ![adammurdoch](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/adammurdoch/32/17_2.png) [@adammurdoch](https://discuss.gradle.org/u/adammurdoch)\
**Post date:** [August 23, 2012, 3:29am UTC](https://discuss.gradle.org/t/gradle-attempts-to-access-missing-jar-file-for-maven-module-with-packaging-pom/2394/9 "2012-08-23T03:29:00Z")

</div>

@Detlef, what’s the actual problem that you’re concerned about here? Is something failing? Is the logging message a problem? Is resolution slow?

---

<div class="post-metadata">

**Author:** ![Detlef](https://avatars.discourse-cdn.com/v4/letter/d/46a35a/32.png) [@Detlef](https://discuss.gradle.org/u/Detlef)\
**Post date:** [August 23, 2012, 5:22am UTC](https://discuss.gradle.org/t/gradle-attempts-to-access-missing-jar-file-for-maven-module-with-packaging-pom/2394/10 "2012-08-23T05:22:00Z")

</div>

Hello Adam, for me it was unclear whether something is wrong due to the log message. So from my side its only a logging issue - nothing else.

---

<div class="post-metadata">

**Author:** ![daz](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/daz/32/2475_2.png) [@daz](https://discuss.gradle.org/u/daz)\
**Post date:** [August 23, 2012, 3:52pm UTC](https://discuss.gradle.org/t/gradle-attempts-to-access-missing-jar-file-for-maven-module-with-packaging-pom/2394/11 "2012-08-23T15:52:00Z")

</div>

I’ve got a very short memory!
