[GRADLE-3040] Adding a custom artifact file without an extension and without 'ext' property causes internal NPE Created: 05/Mar/14  Updated: 26/Mar/14  Resolved: 05/Mar/14

Status: Resolved
Project: Gradle
Affects Version/s: 1.11
Fix Version/s: 1.12-rc-1

Type: Bug
Reporter: Gradle Forums Assignee: Luke Daley
Resolution: Duplicate Votes: 0

Issue Links:
Duplicate
Duplicates GRADLE-3014 NPE when declared artifact uses file ... Resolved

 Description   

def theFile = new File(buildDir, 'foo.txt')
task buildTheFile << {
theFile << "bar"
}
tasks.findByName('assemble').dependsOn buildTheFile

artifacts {
archives file: theFile, name: 'my-artifact', type: 'text', builtBy: buildTheFile
}

Caused by: java.lang.NullPointerException
at org.apache.ivy.core.module.descriptor.AbstractArtifact.hashCode(AbstractArtifact.java:51)
at org.apache.ivy.core.module.descriptor.DefaultModuleDescriptor.addArtifact(DefaultModuleDescriptor.java:375)
at org.gradle.api.internal.artifacts.metadata.DefaultLocalComponentMetaData.addArtifact(DefaultLocalComponentMetaData.java:53)
at org.gradle.api.internal.artifacts.ivyservice.moduleconverter.DefaultConfigurationsToArtifactsConverter.addArtifacts(DefaultConfigurationsToArtifactsConverter.java:38)
at org.gradle.api.internal.artifacts.ivyservice.moduleconverter.PublishLocalComponentFactory.convert(PublishLocalComponentFactory.java:44)
at org.gradle.api.internal.artifacts.ivyservice.projectmodule.ProjectDependencyResolver.resolve(ProjectDependencyResolver.java:53)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DependencyGraphBuilder.resolve(DependencyGraphBuilder.java:64)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DefaultDependencyResolver$1.transform(DefaultDependencyResolver.java:108)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DefaultDependencyResolver$1.transform(DefaultDependencyResolver.java:77)
at org.gradle.api.internal.artifacts.ivyservice.DefaultIvyContextManager.withIvy(DefaultIvyContextManager.java:61)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DefaultDependencyResolver.resolve(DefaultDependencyResolver.java:77)
at org.gradle.api.internal.artifacts.ivyservice.CacheLockingArtifactDependencyResolver$1.create(CacheLockingArtifactDependencyResolver.java:39)
at org.gradle.api.internal.artifacts.ivyservice.CacheLockingArtifactDependencyResolver$1.create(CacheLockingArtifactDependencyResolver.java:37)
at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:187)
at org.gradle.cache.internal.DefaultPersistentDirectoryStore.useCache(DefaultPersistentDirectoryStore.java:102)
at org.gradle.cache.internal.DefaultCacheFactory$ReferenceTrackingCache.useCache(DefaultCacheFactory.java:189)
at org.gradle.api.internal.artifacts.ivyservice.DefaultCacheLockingManager.useCache(DefaultCacheLockingManager.java:61)
at org.gradle.api.internal.artifacts.ivyservice.CacheLockingArtifactDependencyResolver.resolve(CacheLockingArtifactDependencyResolver.java:37)
at org.gradle.api.internal.artifacts.ivyservice.SelfResolvingDependencyResolver.resolve(SelfResolvingDependencyResolver.java:41)
at org.gradle.api.internal.artifacts.ivyservice.ShortcircuitEmptyConfigsArtifactDependencyResolver.resolve(ShortcircuitEmptyConfigsArtifactDependencyResolver.java:51)
at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingArtifactDependencyResolver.resolve(ErrorHandlingArtifactDependencyResolver.java:44)
at org.gradle.api.internal.artifacts.ivyservice.DefaultConfigurationResolver.resolve(DefaultConfigurationResolver.java:42)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.resolveNow(DefaultConfiguration.java:240)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.getResolvedConfiguration(DefaultConfiguration.java:230)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration_Decorated.getResolvedConfiguration(Unknown Source)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ConfigurationFileCollection.getFiles(DefaultConfiguration.java:463)
... 61 more


Generated at Wed Jun 30 12:38:16 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.