Bug 1017847 - The maven repository structure is confusing, the artifacts are not deployed to the right maven repository
The maven repository structure is confusing, the artifacts are not deployed t...
Status: CLOSED CURRENTRELEASE
Product: JBoss BRMS Platform 6
Classification: JBoss
Component: Business Central (Show other bugs)
6.0.0
Unspecified Unspecified
medium Severity high
: ER5
: 6.0.0
Assigned To: manstis
Ivo Bek
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-10 11:35 EDT by Ivo Bek
Modified: 2014-08-06 16:16 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-08-06 16:16:38 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
manstis: needinfo+


Attachments (Terms of Use)

  None (edit)
Description Ivo Bek 2013-10-10 11:35:33 EDT
Description of problem:

Currently, the all artifacts (built projects) are deployed to the root of brms6/bin/repository. In my opinion they should be deployed to the corresponding repository in that folder; it means into brms6/bin/repository/myrepo according to the repositories in business central.

In brms6/bin/repository are two unused repositories, releases, and snapshots which not seem to be used at all.

Then the name of folder brms6/bin/repository is confusing because actually it's a folder of repositories.

To defend my opinion, look at the Nexus workspace/nexus/storage with all the maven repositories including releases, snapshots, central, etc. and I believe it should look same in our case.
Comment 1 manstis 2013-10-15 07:00:24 EDT
kie-wb provides a single Maven Repository, under /repository the structure of which is determined by Maven. All projects can import dependencies from the single Maven Repository. I don't think this is wrong.

Look at your local .m2 folder for example; where you PC hosts a single Maven Repository too.  Nexus hosts multiple Maven repositories.

Do you still consider this wrong?
Comment 2 Ivo Bek 2013-10-15 11:56:06 EDT
You are right that in .m2 folder is "repository" alone but it doesn't mean you cannot have more of them there and specify which one to use in settings.xml. You use bin/repository as .m2 or storage (for nexus) folder but if you really want to have single repository there, it should be something like bin/repositories/repository. 

I'd say you bend some maven library to do it unusually and it can cause difficulties in future. The reason is that the bin/repository contains releases and snapshots in default which implies to another repositories because I never use releases or snapshots as typical names for packages.
Comment 3 Geoffrey De Smet 2013-10-25 08:28:33 EDT
+1 to namespace it in a "repository" directory

Putting it in the working directory (e.g. JBOSS_HOME/bin/repository) is error prone:
- not always writable by the current OS user (try a jboss EAP RPM)
- installation files are not backed up. On linux, JBOSS_HOME comes under /usr which isn't backed up (unlike /home or /var).
- somestimes limited in diskspace (due to harddisk partitioning) when dealing with big data
- working directory can be arbitrary: although jboss's standalone.sh script sets the working directory to itself, no matter from where the script is started, other web containers might not.

Instead, I 'd put it under "~/.kie/repository" by default.
Why? The home directory of an OS user is always writable, always backed up.
All other linux/windows/mac processes do it like that (*). Look for ~/.firefox and ~/.java.
(*) some (not all) are smart enough to use ~/ApplicationData/... instead on windows, but that's a PITA to do in java and overkill.
Comment 4 Ivo Bek 2013-10-25 09:08:54 EDT
Hi Geoffrey,

it's already possible to change the repository location by setting the "org.guvnor.m2repo.dir" system property to whatever you want. (https://github.com/droolsjbpm/guvnor/commit/8d9abac3262d4d0877f73b9f80edd981e754c05c)
I couldn't agree more that the default directory for repository should be different; as you suggested it could be in the home directory.

BTW, this bug is about something different. (see above)
Comment 5 manstis 2013-10-25 12:07:36 EDT
Hi Ivo,

I'm having difficulty working out what to do with this :(

We use sonatype/eclipse Aether to control repository operations.

If a "local repository" (i.e. .m2/MAVEN_HOME) exists we use that by default to (mvn) install artifacts (otherwise we create a transient local in /tmp). 

kie-wb also programmatically adds a "remote repository" (i.e. org.guvnor.m2repo.dir" or /bin/repository by default) where we (mvn) deploy artifacts. Additional remotes defined in settings.xml or a project's pom.xml should also be honored for (mvn) deploy.

Looking closer at your Nexus example, I think we simply need to change to use /repositories/kie as the path for our remote repository and remove the "releases" and "snapshots" folders - as we only define a single remote. 

Am I still missing the point?
Comment 6 Ivo Bek 2013-10-29 04:55:52 EDT
You hit the nail on the head. That's exactly what I thought to have the /repositories/kie folder. Instead of removing releases and snapshots I would rather prevent to create them. Probably you mean it but I point it just to be sure.

Thank you
Comment 10 Ivo Bek 2013-12-05 09:26:46 EST
Verified in BPMS 6.0.0.ER5.
In default BPMS uses maven repository at .../repositories/kie
Comment 11 Ivo Bek 2014-03-18 08:18:53 EDT
This BZ was considered for just one change in the location of maven repository. It is pointless to test this.

Note You need to log in before you can comment on or make changes to this bug.