public Object get()

in src/main/java/org/apache/maven/plugins/invoker/CompositeMap.java [126:161]


    public Object get(Object key) {
        if (!(key instanceof String)) {
            return null;
        }

        Object value = null;
        String expression = (String) key;
        if (expression.startsWith("project.") || expression.startsWith("pom.")) {
            try {
                Object evaluated = ReflectionValueExtractor.evaluate(expression, this.mavenProject);
                if (evaluated != null) {
                    value = evaluated;
                }
            } catch (Exception e) {
                // uhm do we have to throw a RuntimeException here ?
            }
        }

        if (value == null) {
            value = properties.get(key);
        }

        if (value == null) {
            value = this.mavenProject.getProperties().get(key);
        }

        if (value != null && this.escapeXml) {
            value = value.toString()
                    .replaceAll("\"", """)
                    .replaceAll("<", "&lt;")
                    .replaceAll(">", "&gt;")
                    .replaceAll("&", "&amp;");
        }

        return value;
    }