Examples of InputLocation


Examples of org.apache.maven.model.InputLocation

        IssueManagement management = mavenProject.getIssueManagement();

        if (null == management) {
            final InputSource source = new InputSource();
            source.setLocation(mavenProject.getOriginalModel().getPomFile() + "");
            InputLocation location = new InputLocation(0, 0, source);
            resultCollector.addViolation(mavenProject, this, "missing <issueManagement/> section", location);
        } else {
            if (StringUtils.isEmpty(management.getSystem())) {
                resultCollector.addViolation(mavenProject, this, "missing <system/> entry in <issueManagement/> section", management.getLocation(""));
            }
View Full Code Here

Examples of org.apache.maven.model.InputLocation

            if (otherManagedDependency.getManagementKey().equals(dependency.getManagementKey())) {
                i.remove();
                if (otherManagedDependency != dependency) {
                    final String version = modelUtil.getVersion(dependency);
                    final String otherVersion = modelUtil.getVersion(otherManagedDependency);
                    final InputLocation location = modelUtil.getLocation(dependency);
                    final InputLocation otherLocation = modelUtil.getLocation(otherManagedDependency);
                    if (ObjectUtils.equals(version, otherVersion)) {
                        resultCollector.addViolation(mavenProject, this, dependencyDescription + " '" + modelUtil.getKey(dependency) +
                                                                         "' is declared multiple times with the same version: " +
                                                                         otherLocation.getLineNumber() + ":" + otherLocation.getColumnNumber(), location);
                    } else {
                        resultCollector.addViolation(mavenProject, this, dependencyDescription + " '" + modelUtil.getKey(dependency) +
                                                                         "' is declared multiple times with different versions (" + version + ", "
                                                                         + otherVersion + ")", location);
                    }
View Full Code Here

Examples of org.apache.maven.model.InputLocation

        CiManagement management = mavenProject.getCiManagement();

        if (null == management) {
            final InputSource source = new InputSource();
            source.setLocation(mavenProject.getOriginalModel().getPomFile() + "");
            InputLocation location = new InputLocation(0, 0, source);
            resultCollector.addViolation(mavenProject, this, "missing <ciManagement/> section", location);
        } else {
            if (StringUtils.isEmpty(management.getSystem())) {
                resultCollector.addViolation(mavenProject, this, "missing <system/> entry in <ciManagement/> section", management.getLocation(""));
            }
View Full Code Here

Examples of org.apache.maven.model.InputLocation

        for (final Map.Entry<Object, VersionProperty> entry : versionPropertyByObject.entrySet()) {
            final VersionProperty versionProperty = entry.getValue();
            for (final String propertyName : versionProperty.getPropertyNames()) {
                if (isVersionProperty(propertyName) && !isAcceptableVersionPropertyName(propertyName)) {
                    final InputLocation location = modelUtil.getLocation(entry.getKey(), "version");
                    resultCollector.addViolation(mavenProject, this, "Version property names must use '.version', not '-version': '" + propertyName + "'",
                                                 location);
                }
            }
        }
View Full Code Here

Examples of org.apache.maven.model.InputLocation

                            }
                        }
                    }
                }
                if (!disallowedDescriptors.isEmpty()) {
                    final InputLocation location = modelUtil.getLocation(profile, "");
                    resultCollector.addViolation(mavenProject, this, "Found '" + disallowedDescriptors + "' where only submodules are allowed", location);
                }
            }
        }
    }
View Full Code Here

Examples of org.apache.maven.model.InputLocation

        return findSuppressionComment(violation) != null;
    }

    public String findSuppressionComment(final Violation violation) {
        final Rule rule = violation.getRule();
        final InputLocation inputLocation = violation.getInputLocation();
        return findSuppressionComment(rule, inputLocation);
    }
View Full Code Here

Examples of org.apache.maven.model.InputLocation

        String version = resolveVersion(modelObject, resolvedModelObject);
        String inheritedVersion = modelUtil.getVersion(tryResolveObject(inheritedObject));
        // both have a version, but if they're different, that might be ok.
        // But if they're the same, then one is redundant.
        if (version != null && inheritedVersion != null && inheritedVersion.equals(version)) {
            InputLocation location = modelUtil.getLocation(modelObject, "version");
            String message = dependencyDescription + " '" + modelUtil.getKey(modelObject) + "' has same version (" + version + ") as " + inheritedDescription;
            resultCollector.addViolation(mavenProject, this, message, location);
        }
    }
View Full Code Here

Examples of org.apache.maven.model.InputLocation

    @Override
    public void invoke(MavenProject mavenProject, Map<String, Object> models, ResultCollector resultCollector) {
        List<Developer> developers = mavenProject.getDevelopers();

        if (developers.isEmpty()) {
            InputLocation location = getEmptyLocation(mavenProject);
            resultCollector.addViolation(mavenProject, this, "missing <developers/> section", location);
        } else {
            for (Developer developer : developers) {
                if (StringUtils.isEmpty(developer.getId())) {
                    resultCollector.addViolation(mavenProject, this, "missing <id/> entry in <developer/> section", developer.getLocation(""));
View Full Code Here

Examples of org.apache.maven.model.InputLocation

    }

    private InputLocation getEmptyLocation(MavenProject mavenProject) {
        final InputSource source = new InputSource();
        source.setLocation(mavenProject.getOriginalModel().getPomFile() + "");
        return new InputLocation(0, 0, source);
    }
View Full Code Here

Examples of org.apache.maven.model.InputLocation

        for (final Plugin plugin : plugins) {
            final Collection<PluginExecution> executions = expressionEvaluator.getPath(plugin, "/executions");
            for (final PluginExecution execution : executions) {
                // "default" is what maven seems to use if no id is specified
                if (StringUtils.isEmpty(execution.getId()) || "default".equals(execution.getId())) {
                    final InputLocation location = modelUtil.getLocation(execution, "");
                    resultCollector.addViolation(mavenProject, this, "Executions must specify an id", location);
                }
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.