user2609605
user2609605

Reputation: 628

maven: Unrecognised tag: 'testResources'

When I run mvn resources:testResources i obtain

Non-parseable POM /home/ernst/Software/pom.xml: Unrecognised tag: 'testResources' 

The problem seems

<build>
<resources>
  <resource>
<directory>${resourceDir}</directory>
<filtering>true</filtering>
<includes>
  <!--include>octave/m/java-arithmetics/**/*.m</include-->
  <include>octave/octaverc</include>
  <include>octave/java.opts</include>
</includes>
  </resource>
</resources>

<testResources>
  <testResource>
<directory>${tstResourcesDir}</directory>
    <filtering>true</filtering>
    <includes>
     <include>*.rml</include>
</includes>
  </testResource>
<testResources>

<plugins>

As long as I had only the tag resources, all was fine. Now that i added testResources, i have the problem. The resources plugin is configured as follows:

<plugins>
 <plugin>
<groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-resources-plugin</artifactId>
    <version>3.0.2</version>
<configuration>
  <escapeString>\</escapeString> <!-- \${java.home} -> ${java.home} -->
      <!--nonFilteredFileExtensions>
        <nonFilteredFileExtension>pdf</nonFilteredFileExtension>
      </nonFilteredFileExtensions-->
  <!--outputDirectory>${basedir}/target/</outputDirectory-->
</configuration>
  </plugin>

I have the impression, that this problem is about maven itself not about the resources plugin, right? I use maven 3.5.0.

Upvotes: 1

Views: 2307

Answers (1)

Danylo Zatorsky
Danylo Zatorsky

Reputation: 6114

It seems to me that your XML is not valid:

  • You didn't close build element
  • You didn't close testResources element

I made few updates to your XML and built project with the following build section:

<build>
    <resources>
        <resource>
            <directory>${resourceDir}</directory>
            <filtering>true</filtering>
            <includes>
                <!--include>octave/m/java-arithmetics/**/*.m</include-->
                <include>octave/octaverc</include>
                <include>octave/java.opts</include>
            </includes>
        </resource>
    </resources>
    <testResources>
        <testResource>
            <directory>${tstResourcesDir}</directory>
            <filtering>true</filtering>
            <includes>
                <include>*.rml</include>
            </includes>
        </testResource>
    </testResources>
</build>

It worked for me. Hope it will for you :)

Upvotes: 5

Related Questions