public void resolve()

in initializr-generator/src/main/java/io/spring/initializr/metadata/Dependency.java [189:218]


	public void resolve() {
		if (getId() == null) {
			if (!hasCoordinates()) {
				throw new InvalidInitializrMetadataException(
						"Invalid dependency, should have at least an id or a groupId/artifactId pair.");
			}
			generateId();
		}
		else if (!hasCoordinates()) {
			// Let"s build the coordinates from the id
			StringTokenizer st = new StringTokenizer(getId(), ":");
			if (st.countTokens() == 1) { // assume spring-boot-starter
				asSpringBootStarter(getId());
			}
			else if (st.countTokens() == 2 || st.countTokens() == 3) {
				this.groupId = st.nextToken();
				this.artifactId = st.nextToken();
				if (st.hasMoreTokens()) {
					this.version = st.nextToken();
				}
			}
			else {
				throw new InvalidInitializrMetadataException(
						"Invalid dependency, id should have the form groupId:artifactId[:version] but got "
								+ getId());
			}
		}
		this.links.forEach(Link::resolve);
		updateVersionRanges(VersionParser.DEFAULT);
	}