Bug 998476

Summary: Jcr2vfs migration tool creates groupId + artifactId directories from jcr package name
Product: [Retired] JBoss BRMS Platform 6 Reporter: Petr Široký <psiroky>
Component: Business CentralAssignee: Neus Miras <nmirasch>
Status: CLOSED CURRENTRELEASE QA Contact: Petr Široký <psiroky>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.0.0CC: etirelli, pzapataf
Target Milestone: ER6   
Target Release: 6.0.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-08-06 20:20:36 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Petr Široký 2013-08-19 12:10:21 UTC
Description of problem:
Jcr2vfs migration tool crates multiple unnecessary empty directories with package names in src/main/* and src/test/* directories.

For example multiple empty repositories "org/guvnor/example1/org/guvnor/example1" for following migrated prject:

org.guvnor.example1/
├── pom.xml
├── project.imports
└── src
    ├── main
    │   ├── java
    │   │   └── org
    │   │       └── guvnor
    │   │           └── example1
    │   │               └── org
    │   │                   └── guvnor
    │   │                       └── example1
    │   └── resources
    │       ├── META-INF
    │       │   └── kmodule.xml
    │       ├── org
    │       │   └── guvnor
    │       │       └── example1
    │       │           └── org
    │       │               └── guvnor
    │       │                   └── example1
    │       └── rule1.drl
    └── test
        ├── java
        │   └── org
        │       └── guvnor
        │           └── example1
        │               └── org
        │                   └── guvnor
        │                       └── example1
        └── resources
            └── org
                └── guvnor
                    └── example1
                        └── org
                            └── guvnor
                                └── example1


Version-Release number of selected component (if applicable):
6.0.0-DR6 (also community 6.0.0-SNAPSHOT)


How reproducible:
Always


Steps to Reproduce:
1. Migrate arbitrary guvnor repository
2. Look inside inside the resulting VFS repo.


Actual results:
Multiple unnecessary empty directories with package path created. See above.


Expected results:
No such empty directories.

Comment 1 Jervis Liu 2013-08-20 08:52:25 UTC
This is the default project directory structure used in 6.0. I.e., whenever you create a new project (through UI for example), it always has this directory structure.

Comment 2 Petr Široký 2013-08-20 18:34:49 UTC
The nested directory structure is based on groupId + artifactId. They are both set to jcr package name when migrating the jcr repo, so the result may lead "src/main/java/org/guvnor/example1/org/guvnor/example". It seems bit weird but I don't see any apparent solution right now. I will leave the bz open though as it would be nice to have it fixed somehow in future.

Comment 3 Edson Tirelli 2013-10-01 00:32:04 UTC
Jervis, this does not look right to me. Do we need to create the package names based on the groupId+artifactId? Maybe we should simply use package name for the assets that have a declared package name?

Comment 7 Jervis Liu 2013-10-14 08:07:02 UTC
"Jervis, this does not look right to me. Do we need to create the package names based on the groupId+artifactId? Maybe we should simply use package name for the assets that have a declared package name?"

This is the default behavior in ProjectService. Ie., when we create a new package, we set up the default workspace directory structure using GAV info from pom (which is the only info we have at that stage that can be used to guess the package name). You can always create an asset using whatever package name you prefer later on when you add assets(for example DMO).

Comment 8 Neus Miras 2013-11-18 18:09:22 UTC
Create the new project with a GAV with groupId and IdArtifact depending of the old estructure

└── src
    ├── main
    │   ├── java
    │   │   └── org
    │   │       └── guvnor
    │   │           └── example1

In the case specified the groupId has to be "org.guvnor" and the artifactId "example1" at migrated project.
This commit fix that:

Master
https://github.com/droolsjbpm/drools-wb/commit/2fa550960a99567e20735411251b0ac85c85c7f3

6.0.x
https://github.com/droolsjbpm/drools-wb/commit/9067de4e4760e4381b68818840062be3ff410566

Comment 9 Petr Široký 2014-01-14 11:00:17 UTC
Verified fixed in 6.0.0-ER7.