Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Add 6.3.0 release docs #5274

Merged
merged 1 commit into from
Jun 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2,883 changes: 2,883 additions & 0 deletions docs/releases/6.3.0/assets/css/style.css

Large diffs are not rendered by default.

408 changes: 408 additions & 0 deletions docs/releases/6.3.0/chapters/110-introduction.html

Large diffs are not rendered by default.

407 changes: 407 additions & 0 deletions docs/releases/6.3.0/chapters/120-install.html

Large diffs are not rendered by default.

503 changes: 503 additions & 0 deletions docs/releases/6.3.0/chapters/123-tour-workspace.html

Large diffs are not rendered by default.

890 changes: 890 additions & 0 deletions docs/releases/6.3.0/chapters/125-tour-features.html

Large diffs are not rendered by default.

413 changes: 413 additions & 0 deletions docs/releases/6.3.0/chapters/130-concepts.html

Large diffs are not rendered by default.

383 changes: 383 additions & 0 deletions docs/releases/6.3.0/chapters/140-best-practices.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,383 @@
<!DOCTYPE html>
<html lang="en" ng-app="jpm">

<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="/releases/6.3.0/css/style.css" rel="stylesheet" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
<script src="/js/releases.js"></script>

<!-- Begin Jekyll SEO tag v2.8.0 -->
<title>Best practices | bnd</title>
<meta name="generator" content="Jekyll v3.9.2" />
<meta property="og:title" content="Best practices" />
<meta property="og:locale" content="en_US" />
<meta name="description" content="Workspaces" />
<meta property="og:description" content="Workspaces" />
<meta property="og:site_name" content="bnd" />
<meta property="og:type" content="website" />
<meta name="twitter:card" content="summary" />
<meta property="twitter:title" content="Best practices" />
<script type="application/ld+json">
{"@context":"https://schema.org","@type":"WebPage","description":"Workspaces","headline":"Best practices","url":"/releases/6.3.0/chapters/140-best-practices.html"}</script>
<!-- End Jekyll SEO tag -->













<style>
body {
counter-reset: h1 6;
}
</style>










































































</head>


<body>


<ul class="container12 menu-bar" style="display:flex;align-items:center">
<li span=8><a class=menu-link href="/releases/6.3.0/"><img
class=menu-logo src="/releases/6.3.0/img/bnd-80x40-white.png"></a>
<a href="/releases/6.3.0/chapters/110-introduction.html">Intro
</a><a href="/releases/6.3.0/chapters/800-headers.html">Headers
</a><a href="/releases/6.3.0/chapters/825-instructions-ref.html">Instructions
</a><a href="/releases/6.3.0/chapters/855-macros-ref.html">Macros
</a><a href="/releases/6.3.0/chapters/400-commands.html">Commands
</a><div class="releases">
<button class="dropbtn"><span class="fa fa-bars"></span> 6.3.0</button>
<div class="dropdown-content"></div>
</div>
<li span=4>
<div class="search-container">
<form method="get" id="search" action="https://google.com/search" target="_blank">
<input type="hidden" name="as_q" value="site:bndtools.org OR site:bnd.discourse.group"/>
<input type="text" name="q" placeholder="Search…" aria-label="Search https://google.com for bnd specific"/>
<button type="submit" class="fa fa-search"></button>
</form>
</div>
</ul>
<div class=menu-link span=0><a href="https://github.com/bndtools/bnd" target="_"><img
style="position:absolute;top:0;right:0;margin:0;padding:0;z-index:100"
src="https://camo.githubusercontent.com/38ef81f8aca64bb9a64448d0d70f1308ef5341ab/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6461726b626c75655f3132313632312e706e67"
alt="Fork me on GitHub"
data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png"></a></div>





<ul class=container12>
<li span=3>
<div>
<ul class="side-nav">


<li><a href="/releases/6.3.0/chapters/110-introduction.html">Introduction</a>



<li><a href="/releases/6.3.0/chapters/120-install.html">How to install bnd</a>



<li><a href="/releases/6.3.0/chapters/123-tour-workspace.html">Guided Tour</a>



<li><a href="/releases/6.3.0/chapters/125-tour-features.html">Guided Tour Workspace & Projects</a>



<li><a href="/releases/6.3.0/chapters/130-concepts.html">Concepts</a>



<li class=selected>Best practices



<li><a href="/releases/6.3.0/chapters/150-build.html">Build</a>



<li><a href="/releases/6.3.0/chapters/155-project-setup.html">Project Setup</a>



<li><a href="/releases/6.3.0/chapters/160-jars.html">Generating JARs</a>



<li><a href="/releases/6.3.0/chapters/170-versioning.html">Versioning</a>



<li><a href="/releases/6.3.0/chapters/180-baselining.html">Baselining</a>



<li><a href="/releases/6.3.0/chapters/200-components.html">Service Components</a>



<li><a href="/releases/6.3.0/chapters/210-metatype.html">Metatype</a>



<li><a href="/releases/6.3.0/chapters/220-contracts.html">Contracts</a>



<li><a href="/releases/6.3.0/chapters/230-manifest-annotations.html">Bundle Annotations</a>



<li><a href="/releases/6.3.0/chapters/235-accessor-properties.html">Accessor Properties</a>



<li><a href="/releases/6.3.0/chapters/240-spi-annotations.html">SPI Annotations</a>



<li><a href="/releases/6.3.0/chapters/250-resolving.html">Resolving Dependencies</a>



<li><a href="/releases/6.3.0/chapters/300-launching.html">Launching</a>



<li><a href="/releases/6.3.0/chapters/305-startlevels.html">Startlevels</a>



<li><a href="/releases/6.3.0/chapters/310-testing.html">Testing</a>



<li><a href="/releases/6.3.0/chapters/315-launchpad-testing.html">Testing with Launchpad</a>



<li><a href="/releases/6.3.0/chapters/320-packaging.html">Packaging Applications</a>



<li><a href="/releases/6.3.0/chapters/330-jpms.html">JPMS Libraries</a>



<li><a href="/releases/6.3.0/chapters/390-wrapping.html">Wrapping Libraries to OSGi Bundles</a>



<li><a href="/releases/6.3.0/chapters/395-generating-documentation.html">Generating Documentation</a>



<li><a href="/releases/6.3.0/chapters/400-commands.html">Commands</a>



<li><a href="/releases/6.3.0/chapters/600-developer.html">For Developers</a>



<li><a href="/releases/6.3.0/chapters/650-windows.html">Tips for Windows users</a>



<li><a href="/releases/6.3.0/chapters/700-tools.html">Tools bound to bnd</a>



<li><a href="/releases/6.3.0/chapters/790-reference.html">Reference</a>



<li><a href="/releases/6.3.0/chapters/800-headers.html">Headers</a>



<li><a href="/releases/6.3.0/chapters/820-instructions.html">Instruction Reference</a>



<li><a href="/releases/6.3.0/chapters/825-instructions-ref.html">Instruction Index</a>



<li><a href="/releases/6.3.0/chapters/850-macros.html">Macro Reference</a>



<li><a href="/releases/6.3.0/chapters/855-macros-ref.html">Macro Index</a>



<li><a href="/releases/6.3.0/chapters/870-plugins.html">Plugins</a>



<li><a href="/releases/6.3.0/chapters/875-external-plugins.html">External Plugins</a>



<li><a href="/releases/6.3.0/chapters/880-settings.html">Settings</a>



<li><a href="/releases/6.3.0/chapters/900-errors.html">Errors</a>



<li><a href="/releases/6.3.0/chapters/910-warnings.html">Warnings</a>



<li><a href="/releases/6.3.0/chapters/920-faq.html">Frequently Asked Questions</a>


</ul>

</div>

<li span=9>
<div class=notes-margin>

<h1> Best practices
</h1>
<h2 id="workspaces">Workspaces</h2>

<p>The idea of a workspace is that it is cohesive. It contains a set of shared bundles and some of those bundles are exported to a repository. Other bundles are imported from repositories. This is the basic model of modularity.</p>

<p>This strongly implies that you should NOT share cnf between workspace, just like you should not share private fields from classes nor private classes from packages. So the idea is that your organizations has a number of workspaces that contain the code that has a strong relation. For example a product, your company service APIs, or shared base libraries. Since all these projects are in one workspace you get a lot of ease of use like refactoring and immediate feedback.</p>

<p>That said, there is often a desire to have some of the information, like the repositories in a shared place because you do not want to maintain it multiple times. Since bnd is completely based on inherited properties this is not that hard. The top of the properties are coming from the cnf/build.bnd file. Since this is a bnd file, you can actually include another bnd file there. Since this can be included via a URL, you can refer it to a file on your git repository. For convenience, you could make it refer to master but a better way is to make it refer to an actual commit. The reason is that if you checkout your project 5 years from now, it is unlikely that your build will be ok with the latest version of the included bnd file.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>build.bnd:

-include: https://examplegit.com/foo/bar/master/shared/shared.bnd
</code></pre></div></div>

<p>A more defined way to handle this long term versioning problem is to use git modules. They have a bad name but as far as I understand their bad name is because people don’t like that they are not automatically updated, which is exactly what you want when you want to build your project 5 years from now. Git modules require an explicit command to upgrade it to the latest or another version. The parent git repository stores the commit at which it is linked. With git modules you could make a subdirectory in cnf and then include a shared file from there:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>cnf
shared/
.git/
shared.bnd
build.bnd

build.bnd:
-include shared/shared.bnd
</code></pre></div></div>

<p>So to summarize, share workspaces, not projects. Use continuous integration that publishes your bundles to a repository that is shared with all. Share one bnd file with a git module.</p>


</div>
</ul>


<nav class=next-prev>
<a href='/releases/6.3.0/chapters/130-concepts.html'></a> <a href='/releases/6.3.0/chapters/150-build.html'></a>
</nav>
<footer class="container12" style="border-top: 1px solid black;padding:10px 0">
<ul span=12 row>
<li span=12>
<ul>
<li><a href="/releases/6.3.0/">GitHub</a>
</ul>
</ul>
</footer>

</body>
</html>
Loading