# Gradle 3.4 problem with jar manifest

**URL:** <https://discuss.gradle.org/t/gradle-3-4-problem-with-jar-manifest/21736>\
**Category:** Help/Discuss\
**Created:** [February 24, 2017, 2:27am UTC](https://discuss.gradle.org/t/gradle-3-4-problem-with-jar-manifest/21736 "2017-02-24T02:27:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mcooper7290](https://avatars.discourse-cdn.com/v4/letter/m/41988e/32.png) [@mcooper7290](https://discuss.gradle.org/u/mcooper7290)\
**Post date:** [February 24, 2017, 2:27am UTC](https://discuss.gradle.org/t/gradle-3-4-problem-with-jar-manifest/21736/1 "2017-02-24T02:27:31Z")

</div>

I’ve been using the following code in several projects to build a jar file:

```
apply plugin: 'application'

def mainClass = 'cmb.servernexus.ServerNexusMain'

/*
 * Tell Application plugin our main
 */
mainClassName = "$mainClass"

dependencies {
	compile project(":CaBridge")
	compile project(":WebApp")
}

jar {
	manifest {
		attributes(
			"Implementation-Title": project.name,
			"Implementation-Version": version,
			"Main-Class": "$mainClass",
			// Add Class-Path to manifest
			"Class-Path": configurations.compile.collect { it.getName() }.join(' '))
	}
}

```

This works fine in Gradle version up to and including 3.2. However, in 3.4 I get:

FAILURE: Build failed with an exception.

```
* Where:
Build file 'C:\Users\mcooper\.....\build.gradle' line: 30

What went wrong:
A problem occurred evaluating project ':ServerNexus'.
 Could not resolve all dependencies for configuration ':ServerNexus:compile'.
  A problem occurred configuring project ':WebApp'.
  Resolving configuration 'apiElements' directly is not allowed

```

Line 30 corresponds to the “Class-Path” line build.gradle shown above.
