question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot assign configuration entry 'locations' with value 'com.xyz.my-project.v10.resources' of type java.lang.String to property of type java.util.List

See original GitHub issue

We are facing below issue with Swagger maven plugin. Although it is working on one or two machines and swagger json getting generated successfully.

Not sure if it has to anything with maven version. Most of us have maven version = 3.2.1

[ERROR] Failed to execute goal com.github.kongchen:swagger-maven-plugin:3.1.4:generate (default) on project my-project-rest: Unable to parse configuration of mojo com.github.kongchen:swagger-maven-plugin:3.1.4:generate for parameter locations: Cannot assign configuration entry ‘locations’ with value ‘com.xyz.my-project.v10.resources’ of type java.lang.String to property of type java.util.List

Could anyone please help us! Thanks. Rahul

			<plugin>
				<groupId>com.github.kongchen</groupId>
				<artifactId>swagger-maven-plugin</artifactId>
				<version>3.1.4</version>
				<configuration>
					<apiSources>
						<apiSource>
							<springmvc>false</springmvc>
							<locations>com.xyz.my-project.v10.resources</locations>
							<schemes>http,https</schemes>
							<host>http://localhost:8001</host>
							<basePath>/api</basePath>
							<info>
								<title>Swagger spec for REST API</title>
								<version>v1.0</version>
								<description>My Project REST API</description>
								<termsOfService>
									http://www.xyz.com/terms-and-conditions
								</termsOfService>
								<contact>
									<email>admin(@)testcompany.com</email>
									<name>Admin</name>
									<url>http://www.xyz.com</url>
								</contact>
								<license>
									<url>http://www.xyz.com/licenses/LICENSE-2.0.html</url>
									<name>Project Licence</name>
								</license>
							</info>
							<templatePath>${project.basedir}/src/swagger-templates/strapdown.html.hbs</templatePath>
							<outputPath>${project.basedir}/target/rest-docs/swagger-doc.html</outputPath>
							<swaggerDirectory>${project.basedir}/src/main/resources</swaggerDirectory>
						</apiSource>
					</apiSources>
				</configuration>
				<executions>
					<execution>
						<phase>compile</phase>
						<goals>
							<goal>generate</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

9reactions
rahul-winnercommented, Feb 28, 2017

Thanks @viktorgunnarson @JoepWeijers

I believe I found the the real issue. The new maven (MoJo) e.g. 3.3.9 is able to assign values to <locations> even if those are not defined within <location> tag.

However, the older version of maven needs parameters whose type is ArrayList/List to be passed as set of tags.

If one updates the version of maven to 3.3.9 and just uses <locations> then it works well.

Kindly confirm

4reactions
JoepWeijerscommented, Feb 28, 2017

Hello Rahul, I think there is a mistake in your <locations> tags. It expects a list of <location>s, not a string, like so:

<locations>
  <location>com.xyz.my-project.v10.resources</location>
</locations>
Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot assign configuration entry 'locations ... - Bountysource
Cannot assign configuration entry 'locations' with value 'com.xyz.my-project.v10.resources' of type java.lang.String to property of type java.
Read more >
maven - Cannot assign configuration entry 'tags' with value ...
Cannot assign configuration entry 'tags' with value '"~@ignored"' of type java.lang.String to property of type java.util.List -> [Help 1] · You ...
Read more >
Cannot assign configuration entry with value of type java.util ...
The issue is invalid. The plugin is incorrectly implemented. MNG-6164 makes collections consistently immutable while retaining the binary ...
Read more >
Bug List
LambdaConversionException: Invalid receiver type class java.lang. ... a "CDT managed Build Setting Entries" value doesn't reflect after C/C++ index rebuild.
Read more >
Chapter 11. Building a configuration management database
package com.springinpractice.ch11.model; import java.util. ... 13 You can't inject CIService<T> in the base controller due to type erasure.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found