Description

This page describes an issue with the packaging failing at the discover step for Maven source code.
When it fails, the log would be pointing to the discovery.castlog2 in the DMT GUI.


If you open the log, you will see the details as below: 

 
The issue comes from the resource directory structure in pom.xml defined with '\' instead of '/'.


For example:

In the pom.xml its defined as :

 <resources>

        <resource>
            <directory>src\main\resources</directory>
As a result this syntax is not recognized by the discoverer and it fails with the error as mentioned.
Observed in CAST AIP

 

Release
Yes/No
8.0.x(tick)
7.3.x(tick)
Observed on RDBMS
RDBMS
Yes/No
Oracle Server (tick)
Microsoft SQL Server (tick)
CSS2 (tick)
Step by Step Scenario

Below is the step-by-step scenario leading to the problem:

  • Package the Maven source in DMT.
  • Packaging fails at the discover step
  • Check the discovery.castlog2
  • It fails with the error :
    java.util.regex.PatternSyntaxException:Illegal/unsupported escape sequence near index 9
Impact of the Problem

The impact of the problem on the analysis or the dashboard is:

 Since the packaging is failing you will not be able to deliver the version to run the analysis and dashboard.

Solution

To fix the problem, proceed as follows:

The solution is to correct the syntax of the resource declaration to replace '/' with '\'.

The resource directory has to be changed from:

 

1
<directory>src\main\resources</directory>

to: 

 

1
<directory>src/main/resources</directory>

 

Since there can be more than one pom.xml with the incorrect syntax its better to find all the occurrences across all the projects and replace them all together.
To do so, proceed as follows:
- Open a notepad++ editor or any other editor
- Press Ctrl+F to open the search window
- Go To option Find in Files

- Find  = <directory>src\main\resources</directory>
- Replace it with = <directory>src/main/resources</directory>
- Filters = pom.xml
- Directory = Replace with the path in files to browse in DMT (the path provided to browse the projects)
- Click replace files and save

Then
- Open DMT
- Try Packaging with Force extraction option

 With the syntax being replaced with the correct one, the packaging will no longer fail with this error. 

 

 

Notes/comments
 
Related Pages