Bug 1017847 - The maven repository structure is confusing, the artifacts are not deployed to the right maven repository
Summary: The maven repository structure is confusing, the artifacts are not deployed t...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss BRMS Platform 6
Classification: Retired
Component: Business Central
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
medium
high
Target Milestone: ER5
: 6.0.0
Assignee: manstis
QA Contact: Ivo Bek
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-10-10 15:35 UTC by Ivo Bek
Modified: 2014-08-06 20:16 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-08-06 20:16:38 UTC
Type: Bug
Embargoed:
manstis: needinfo+


Attachments (Terms of Use)

Description Ivo Bek 2013-10-10 15:35:33 UTC
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 11:00:24 UTC
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 15:56:06 UTC
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 12:28:33 UTC
+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 13:08:54 UTC
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 16:07:36 UTC
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 08:55:52 UTC
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 14:26:46 UTC
Verified in BPMS 6.0.0.ER5.
In default BPMS uses maven repository at .../repositories/kie

Comment 11 Ivo Bek 2014-03-18 12:18:53 UTC
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.