Skip to content
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Agent guide for codehaus-plexus.github.io

This repository is the source of the Codehaus Plexus organization site at
<https://codehaus-plexus.github.io/> (`org.codehaus.plexus:plexus-site`, `pom` packaging). It has no
Java code and no test suite. Pages are Markdown under `src/site/markdown`: the overview
(`index.md`), `get-involved.md`, and the retired Plexus container documentation under `guides/` and
`ref/`. `src/site/site.xml` defines the menu, and `apt-old/`, `src/site/xdoc` and `src/site/old`
hold older material that is not rendered. The published URLs of the container guides are linked
from a lot of external writing: do not move, rename or delete a page, and do not change its
headings. The container tutorials are short notes that point to
`guides/migrating-from-plexus-container.md`; put new migration advice there, not in the old pages.

## Build and test

- Run `mvn site` to render the site into `target/site`. The reports configured in the POM are the
`maven-project-info-reports-plugin` team, issue-management, licenses and scm reports.
- The site is the organization page, so `maven-scm-publish-plugin` publishes it to the `master`
branch (`scmBranch` in the POM), not to `gh-pages`. `mvn site-deploy` does that; the
`site.yml` workflow runs the same publish through the shared `codehaus-plexus/.github` site
workflow, and its `dry-run` input builds without committing. Publishing steps are in
`RELEASING.md` of that shared repository.
- `.github/workflows/maven.yml` calls the shared `codehaus-plexus/.github` build workflow (the
default `mvn verify javadoc:javadoc` on the shared JDK and operating system matrix) and then the
shared deploy workflow.
- Run `mvn spotless:apply` on JDK 17 to 21 before pushing; it also formats Markdown.

## Documentation updates

A change that users or contributors can notice ships with the documentation it affects, in the
same pull request. A refactor with no visible effect needs none.

- A library gets a new site, is retired, or changes its one-line description: the matching entry in
`src/site/markdown/index.md`, under Libraries, Components, Tooling or Retired.
- A page is added or removed: the menu in `src/site/site.xml`.
- The way the site is built or published: `README.md` and the Build and test section of this file.
- A new convention, build gate or fixture: this file.

8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Codehaus Plexus site

This repository holds the source for the [Codehaus Plexus organization site](https://codehaus-plexus.github.io/), including the component index and reference pages.
This repository holds the source of the [Codehaus Plexus organization site](https://codehaus-plexus.github.io/):
the list of Plexus libraries, with a link to each project site, and the documentation of the retired
Plexus container. Each library publishes its own site from its own repository.

Maintainers publish the site as described in [RELEASING.md](https://github.com/codehaus-plexus/.github/blob/master/RELEASING.md) in the shared `.github` repository.
Run `mvn site` to render the site into `target/site`. Maintainers publish it as described in
[RELEASING.md](https://github.com/codehaus-plexus/.github/blob/master/RELEASING.md) in the shared
`.github` repository. Contributor notes are in [AGENTS.md](AGENTS.md).
Original file line number Diff line number Diff line change
Expand Up @@ -6,43 +6,18 @@ author:
date: 2006-07-09
---

`The contents of this document are a work in progress`

# Javadoc Tags used by Plexus tools

Here is a reference of the Javadoc annotations that can be used to 'decorate' the Java sources to allow Plexus tools like Component Descriptor Creator (CDC) to generate Component Descriptors.

|**Tag/Annotation**|**Available on**|**Required**|**Descriptor Element**|
|---|---|---|---|
|[@plexus.component](#@plexus.component)|Class|Yes|Indicate to Plexus CDC that the class is a component|
|[@plexus.configuration](#@plexus.configuration)|Field|No|Tell Plexus CDC that this item should be configured through the `components.xml`|
|[@plexus.requirement](#@plexus.requirement)|Field|No|Indicate to Plexus CDC that the field is required by the component|
The Plexus container is retired and archived, so this page no longer carries the instructions it once had. It stays at this address because other sites link to it. The original page listed the Javadoc tags read by the Component Descriptor Creator.

# @plexus.component

The `@plexus.component` tag is used to show that the class it annotates is a plexus component. This will add a `<component`\> element to the `<components`\> in components.xml. The following parameters are available, but remember the `role` is required. The text in the javadoc tag describing this class is copied into the component's `<description`\> tag.

|**Parameter**|**Required**|**Description**|
|---|---|---|
|role|Yes|The role that this class provides an implementation for (usually the class name of an implemented Interface|
|role-hint|No|The hints are used to differentiate multiple implementations of the same role|
|version|No|Set the version of the component|
Replaced by [Components and injection](/guides/migrating-from-plexus-container.html#Components_and_injection) and [Component index](/guides/migrating-from-plexus-container.html#Component_index).

# @plexus.configuration

The `@plexus.configuration` tags are used to mark fields in a class for configuration through the `components.xml`.

|**Parameter**|**Required**|**Description**|
|---|---|---|
|default-value|Currently|The default values are currently required for the `<configuration`> tag to be written to `components.xml`.|
Replaced by [Configuration](/guides/migrating-from-plexus-container.html#Configuration).

# @plexus.requirement

Tagging a field with `@plexus.requirement` will tell plexus to inject the required component or list of components before the component itself is started. Fields can be of the type of the Interface defining the component you wish to be injected or of type `java.util.List` or `java.util.Map`.

Fields of type `java.lang.List` will have a list of components injected whereas a field of type `java.lang.Map` will have a mapping in the form of `role-hint -> component`. The `role` parameter is required if using a `List` or `Map` whereas a role-hint is not allowed.

|**Parameter**|**Required**|**Description**|
|---|---|---|
|role|No. Yes if the field is a `List` or a `Map`|The role parameter is used to tell plexus what Component role you are interested in. For singleton fields their type is used as a default.|
|role-hint|No. Not allowed if the field is a `List` or a `Map`|Links to the role-hint defined by a component when looking up a component. Not allowed with `List` or `Map` fields, as they return all `role-hint`s.|
Replaced by [Components and injection](/guides/migrating-from-plexus-container.html#Components_and_injection).
104 changes: 4 additions & 100 deletions src/site/markdown/guides/developer-guide/building-applications/cdc.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,114 +6,18 @@ author:
date: 2006-07-09
---

`The contents of this document are a work in progress`

# Plexus Component Descriptor Creator

**NOTE: This document and the CDC itself is currently a work in progress.**

The Component Descriptor Creator (or CDC for short) is a tool that will create the `components.xml` file from your Java code. It uses JavaDoc tags to gather the information it needs to create the component descriptor.

There is a tag for marking components, requirements and configuration. Each of the tags can have parameters as documented below.
The Plexus container is retired and archived, so this page no longer carries the instructions it once had. It stays at this address because other sites link to it. The original page described the Javadoc tags that generated `components.xml`.

## Component Tag Parameters

|**Tag**|**Required**|**Description**|
|---|---|---|
|role|y|The role of the component.|
|role-hint|n|The role-hint of the component.|
|version|n|The component version.|
|lifecycle-handler|n|The lifecycle handler of the component. _TODO: link to the different lifecycle handlers_|
|instantiation-strategy|n|The instantiation strategy of the component. _TODO: link to the different instantiation strategies_|

<!-- TODO: This line will be incorrectly render the *name* of the table as well -->
<!-- as the caption -->
<!-- [plexus-component-tags] Plexus Component Tag Parameters -->

```
package org.foo;

/**
* @plexus.component
* role="com.foo.ActionManager"
* lifecycle-handler="plexus-configurable"
*/
public class DefaultActionManager
extends AbstractLogEnabled
implements ActionManager, Serviceable
{
```

<!-- [example-class-tags] Example Component Tag -->
This will be generated in component.xml:

```
<component>
<role>org.foo.ActionManager</role>
<implementation>org.foo.DefaultActionManager</implementation>
<lifecycle-handler>plexus-configurable</lifecycle-handler>
</component>
```
Replaced by [Components and injection](/guides/migrating-from-plexus-container.html#Components_and_injection) and [Component index](/guides/migrating-from-plexus-container.html#Component_index).

## Requirement Tag Parameters

These tags are used on fields to state requirements. TODO: it should be possible to override the role for a normal field.

|**Tag**|**Required**|**Description**|
|---|---|---|
|role|y/n|The role of the component. Only required if the field is a List or Map|
|role-hint|n|The role-hint of the component.|

```
/**
* @plexus.requirement
* role-hint="foo"
*/
private ActionManager actionManager;
```

<!-- [example-requirement-tags] Example Requirement Tag -->
This will be generated in component.xml:

```
<component>
<role>org.foo.MyComponent</role>
<implementation>org.foo.MyComponentImplementation</implementation>
<requirements>
<requirement>
<role>org.foo.ActionManager</role>
<role-hint>foo</role-hint>
<field-name>actionManager</field-name>
</requirement>
</requirements>
</component>
```
Replaced by [Components and injection](/guides/migrating-from-plexus-container.html#Components_and_injection).

## Configuration Tag Parameters

Note that the default value tag won't be required in the future when these tags will be used to generate a separate configuration declaration section.

|**Tag**|**Required**|**Description**|
|---|---|---|
|default-value|y|Sets the default value for the configuration field|

```
/**
* @plexus.configuration
* default-value="Trygve"
*/
private String name;
```

<!-- [example-requirement-tags] Example Configuration Tag -->
This will be generated in component.xml:

```
<component>
<role>org.foo.MyComponent</role>
<implementation>org.foo.MyComponentImplementation</implementation>
<configuration>
<name>Trygve</name>
</configuration>
</component>
```
Replaced by [Configuration](/guides/migrating-from-plexus-container.html#Configuration).
Loading
Loading