Search code examples
javaseleniummavencompiler-errorspom.xml

Maven project compiling


i'm trying to compile maven project by running "mvn clean compile"

and i get error like this:

[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] Resolving expression: '${xmlName}': Detected the following recursive expression cycle in 'xmlName': [xmlName] @
[ERROR] Resolving expression: '${xmlName}': Detected the following recursive expression cycle in 'xmlName': [xmlName] @
[ERROR] Resolving expression: '${xmlName}': Detected the following recursive expression cycle in 'xmlName': [xmlName] @
 @
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR]   The project automation:automation:1.0-SNAPSHOT (C:\Users\Vartotojas\Desktop\Automatiniai testia\automation\pom.xml) has 3 errors
[ERROR]     Resolving expression: '${xmlName}': Detected the following recursive expression cycle in 'xmlName': [xmlName] -> [Help 2]
[ERROR]     Resolving expression: '${xmlName}': Detected the following recursive expression cycle in 'xmlName': [xmlName] -> [Help 2]
[ERROR]     Resolving expression: '${xmlName}': Detected the following recursive expression cycle in 'xmlName': [xmlName] -> [Help 2]
[ERROR]

i have tryied to search problems in POM.XML, but i did not find anything..

maybe problem could be somewhere here in POM.XML:

<configuration>
                        <suiteXmlFiles>src/testResources/${xmlName}</suiteXmlFiles>
                        <argLine>-javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar"</argLine>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>org.aspectj</groupId>
                            <artifactId>aspectjweaver</artifactId>
                            <version>${aspectj.version}</version>
                        </dependency>
                    </dependencies>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
    <properties>
        <xmlName>${xmlName}</xmlName>
        <maven-surefire-plugin.version>2.20.1</maven-surefire-plugin.version>

Solution

  • On properties you must declare a value

    <properties>
    <xmlName>${xmlName}</xmlName>  <--------  <xmlName>SomeValueHere</xmlName>
    </properties
    

    You have passed an argument in properties which is not expected

    Maven tries to pass that somewhere else probably in build phase and instead of a value it passes an argument, so it goes again to find the value of the argument in properties. Then you have the recursion message!