Red Hat Bugzilla – Bug 1017847
The maven repository structure is confusing, the artifacts are not deployed to the right maven repository
Last modified: 2014-08-06 16:16:38 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.
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?
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.
+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.
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)
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?
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.
Verified in BPMS 6.0.0.ER5.
In default BPMS uses maven repository at .../repositories/kie
This BZ was considered for just one change in the location of maven repository. It is pointless to test this.