element.
-
-```
-
-
- .
- .
- .
-
-
-
- maven-plugin-plugin
-
- website
-
-
-
-
-
-
-```
-
-This tells Maven to use **website** as a plugin prefix or a 'short-hand' to allow invoking available Mojo(s) from our plugin.
-
-1. Next we add the `groupId` of our Maven plugin in Maven settings file. This is available under `~/.m2/settings.xml`.
-
-1. Edit it and add the following:
-
-```
-
- .
- .
- .
-
- org.codehaus.plexus
-
-
-```
-
-This should allow our Mojo to be invoked from the command prompt without have the need to type fully qualified reference to MonitorMojo (org.codehaus.plexus:plexus-website-monitor-plugin:monitor), and by simply typing:
-
-```
- mvn website:monitor
-```
-
-A more definitive reference on plugin prefix resolution is available [here](http://maven.apache.org/guides/introduction/introduction-to-plugin-prefix-mapping.html) on the Maven website.
-
-## Configuring list of websites
-
-
-
-We will come back to configuring the MonitorMojo but before we do that we'll look at setting up unit tests for it.
+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 configured a Mojo that used a Plexus component.
-[Next: Setting up Mojo unit tests](./07_01_setting_up_mojo_unit_tests.html)
+For the replacement, see [Configuration](/guides/migrating-from-plexus-container.html#Configuration) and [Guide to Configuring Plugins](https://maven.apache.org/guides/mini/guide-configuring-plugins.html).
diff --git a/src/site/markdown/guides/writing-components/07_01_from_a_maven_mojo.md b/src/site/markdown/guides/writing-components/07_01_from_a_maven_mojo.md
index 328ec1c..046021d 100644
--- a/src/site/markdown/guides/writing-components/07_01_from_a_maven_mojo.md
+++ b/src/site/markdown/guides/writing-components/07_01_from_a_maven_mojo.md
@@ -6,78 +6,8 @@ date: 2006-06-08
# Website Monitor Plugin
-This section will show how to use a Plexus component from within a Maven mojo.
+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 used a Plexus component from a Mojo in a plugin built from an archetype.
## Setting up a Maven Plugin Project
-### Creating a Maven plugin Project using an archetype
-
-Maven Archetypes are discussed in detail [here](http://maven.apache.org/guides/mini/guide-creating-archetypes.html).
-
-1. From the command prompt, change directory to the location where you want to setup the maven plugin project.
-
-1. Run the following command to set up a skeleton Maven Plugin project.
-
-```
-
- mvn archetype:create -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-mojo \
- -DarchetypeVersion=1.0-SNAPSHOT -DgroupId=org.codehaus.plexus -DartifactId=plexus-website-monitor-plugin
-
-```
-
-The `maven-archetype-mojo` sets up a skeleton Maven plugin project '`plexus-website-monitor-plugin`' for us with reasonable defaults.
-
-### Updating pom.xml dependencies
-
-1. Locate pom.xml under the '`plexus-website-monitor-plugin`' folder.
-
-1. Edit it and add a `dependency` to the plexus-website-monitor-component that we have developed in earlier chapters.
-
-The pom.xml should look like this now:
-
-```
-
-
- 4.0.0
- org.codehaus.plexus
- plexus-website-monitor-plugin
- maven-plugin
- Maven Mojo Archetype
- 1.0-SNAPSHOT
- http://maven.apache.org
-
-
- org.apache.maven
- maven-plugin-api
- 2.0
-
-
- junit
- junit
- 3.8.1
- test
-
-
- org.codehaus.plexus
- plexus-website-monitor-component
- 1.0-SNAPSHOT
-
-
-
-```
-
-### Setting up an Eclipse project
-
-Note that this step assumes that we have Plexus Website Monitor Component available in our local repository or downloadable from a remote repository.
-
-1. Run the following command to generate Eclipse project and set up library path to dependencies.
-
-```
- mvn eclipse:eclipse
-```
-
-1. From the Eclipse workbench, use 'File \> Import \> Existing projects into workspace' to import the created maven plugin project.
-
-The website monitor plugin should now be set up as a project under Eclipse.
-
-[Next: Implementing Monitor Mojo](./07_01_implementing_monitor_mojo.html)
+Replaced by [Parts without a replacement](/guides/migrating-from-plexus-container.html#Parts_without_a_replacement) and [Guide to Developing Java Plugins](https://maven.apache.org/guides/plugin/guide-java-plugin-development.html).
diff --git a/src/site/markdown/guides/writing-components/07_01_implementing_monitor_mojo.md b/src/site/markdown/guides/writing-components/07_01_implementing_monitor_mojo.md
index 14a12a2..b6da44b 100644
--- a/src/site/markdown/guides/writing-components/07_01_implementing_monitor_mojo.md
+++ b/src/site/markdown/guides/writing-components/07_01_implementing_monitor_mojo.md
@@ -4,138 +4,10 @@ author: Rahul Thakur
date: 2006-06-27
---
-`The contents of this document are a work in progress`
-
# Implementing the Monitor Mojo
-If you would like to understand what a Maven Mojo is, please refer to the documentation [here](http://maven.apache.org/guides/plugin/guide-java-plugin-development.html) on the Maven website.
-
-## Monitor Mojo
-
-We noticed that the archetype creator filled in the maven plugin project with some reasonable defaults. It also created a `MyMojo` placeholder implementation of a Mojo for us, but it doesn't do much for us.
-
-So,
-
-1. Delete `MyMojo` implementation from the project sources.
-
-1. Create a `MonitorMojo` that extends `org.apache.maven.plugin.AbstractMojo`.
-
-The Mojo source should like this:
-
-```
-
-public class MonitorMojo
- extends AbstractMojo
-{
-
- public void execute()
- throws MojoExecutionException, MojoFailureException
- {
- // TODO Auto-generated method stub
-
- }
-
-}
-
-```
-
-1. Add a Javadoc `@goal` annotation in Javadoc comments for a Class to bind a goal name that runs this Mojo.
-
-```
-
-/**
- * A Mojo that monitors a given list of websites.
- *
- * @version $Id$
- * @goal monitor
- */
-public class MonitorMojo
- extends AbstractMojo
-{
-
- public void execute()
- throws MojoExecutionException, MojoFailureException
- {
- // TODO Auto-generated method stub
-
- }
-
-}
-
-```
+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 wired a component into a Mojo through a Plexus requirement.
## Wiring the Website Monitor Component
-1. Declare a field of type `org.codehaus.plexus.tutorial.WebsiteMonitor` for `MonitorMojo`.
-
-1. Add a Javadoc annotation `@component` on the field. This indicates to Plexus runtime to lookup and populate the field with an implementation with a Component ROLE = '`org.codehaus.plexus.tutorial.WebsiteMonitor`'
-
-```
-
-/**
- * A Mojo that monitors a given list of websites.
- *
- * @version $Id$
- * @goal monitor
- */
-public class MonitorMojo
- extends AbstractMojo
-{
-
- /**
- * The website monitor component instance that will be injected
- * by the Plexus runtime.
- * @component
- */
- private WebsiteMonitor monitor;
-
- public void execute()
- throws MojoExecutionException, MojoFailureException
- {
- // TODO Auto-generated method stub
-
- }
-
-}
-
-```
-
-1. (optional) We can get choosy if we know there are more than one implementations of `org.codehaus.plexus.tutorial.WebsiteMonitor` ROLE available. This can done by adding an attribute '`role-hint`' to the Javadoc annotation that we added in the previous step.
-
-Say, for instance we had a different website monitor implementation to monitor FTP websites, the Javadoc annotation for that Mojo field will look like the snippet below.
-
-Of course, the value of `role-hint` provided in the code snippet reproduced below should have been defined for the website monitor's implementation's component descriptor that monitors FTP sites.
-
-Again the Plexus runtime does the magic of injecting the appropriate implementation.
-
-```
-
-/**
- * A Mojo that monitors a given list of websites.
- *
- * @version $Id$
- * @goal monitor
- */
-public class MonitorMojo
- extends AbstractMojo
-{
-
- /**
- * The website monitor component instance that will be injected
- * by the Plexus runtime.
- * @component role-hint="ftp"
- */
- private WebsiteMonitor monitor;
-
- public void execute()
- throws MojoExecutionException, MojoFailureException
- {
- // TODO Auto-generated method stub
-
- }
-
-}
-
-```
-
-[Next: Adding configuration for the Mojo](./07_01_configuring_monitor_mojo.html)
+Replaced by [Components and injection](/guides/migrating-from-plexus-container.html#Components_and_injection) and [Maven and JSR-330](https://maven.apache.org/maven-jsr330.html).
diff --git a/src/site/markdown/guides/writing-components/07_01_setting_up_mojo_unit_tests.md b/src/site/markdown/guides/writing-components/07_01_setting_up_mojo_unit_tests.md
index 9584ce3..c1d38c6 100644
--- a/src/site/markdown/guides/writing-components/07_01_setting_up_mojo_unit_tests.md
+++ b/src/site/markdown/guides/writing-components/07_01_setting_up_mojo_unit_tests.md
@@ -4,211 +4,14 @@ author: Rahul Thakur
date: 2006-06-27
---
-`The contents of this document are a work in progress`
-
# Setting up unit tests for Monitor Mojo
-Unit testing allows us to test out our Mojo implmentation without requiring a project to be set up.
-
-Maven provides a **Plugin Test Harness** to enable testing of Mojos.
-
-Some relatively comprehensive notes on the Maven Plugin Harness are available [here](http://docs.codehaus.org/display/MAVEN/Maven\+Plugin\+Harness).
-
-## Adding test sources directory to the project
-
-This step is needed as the Mojo Archetype (as of this writing) does not sets up test folder when we created our Maven plugin project.
-
-1. To the project root add a directory `src/test/java`. We will create our unit tests under this location.
-
-1. To the project root add a director `src/test/resources`. This directory will hold resources that we use for Mojo testing.
+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 tested a Mojo with `AbstractMojoTestCase`.
## Adding plugin test harness dependency
-1. First thing we need to do is to add the Maven plugin test harness dependency to our Plugin's `pom.xml`. Locate the `pom.xml` and add the harness dependency as follows.
-
-```
-
- .
- .
- .
-
- org.apache.maven.shared
- maven-plugin-testing-harness
- 1.0-beta-1
- test
-
-
-```
-
-1. Next we need to update depdendency references in our Eclipse project settings to make the plugin testing harness available. To do this run the following from the command prompt from the plugin project's directory.
-
-```
- mvn eclipse:clean eclipse:eclipse
-```
-
-1. Refresh the Eclipse project by selecting the project root folder and pressing 'F5' key.
-
-You will see that the plugin testing harness dependency and the test directory that we added in the previous step are now updated.
+Replaced by [Testing Maven plugins](/guides/migrating-from-plexus-container.html#Testing_Maven_plugins) and [Maven Plugin Testing Harness](https://maven.apache.org/plugin-testing/maven-plugin-testing-harness/getting-started/index.html).
## Writing our Mojo unit tests
-1. Create a new package `org.codehaus.plexus` to create our test in. Note that we create the package with the same name that our Mojo implementation resides in. This is a convenience to test out methods on Mojo which may have access specifiers that allow access only from within same package.
-
-1. We write a couple of tests to ensure that our Mojo instance is being retrieved as expected, and to test that it executes without errors for a valid list of websites.
-
-Our test source looks as follows:
-
-```
-public class MonitorMojoTest
- extends AbstractMojoTestCase
-{
-
- public void testMojoLookup()
- throws Exception
- {
- File pluginXml = new File( getBasedir(), "src/test/resources/unit/plugin-config.xml" );
- MonitorMojo mojo = (MonitorMojo) lookupMojo( "monitor", pluginXml );
- assertNotNull( mojo );
- }
-
- public void testMojoExecution()
- throws Exception
- {
- File pluginXml = new File( getBasedir(), "src/test/resources/unit/plugin-config.xml" );
- MonitorMojo mojo = (MonitorMojo) lookupMojo( "monitor", pluginXml );
- assertNotNull( mojo.getWebsites() );
- assertEquals( 1, mojo.getWebsites().size() );
- assertNotNull( mojo.getMonitor() );
- try
- {
- mojo.execute();
- }
- catch ( Exception e )
- {
- fail( "Unexpected exception with test data." );
- }
- }
-}
-```
-
-1. We set up a test configuration for the Mojo under `src/test/resources/unit/plugin-config.xml` (yes, that's the file that we refer to in the test above!).
-
-```
-
-
-
-
- org.codehaus.plexus
- plexus-website-monitor-plugin
-
-
- http://plexus.codehaus.org/
-
-
-
-
-
-
-```
-
-1. Also our Mojo implementation is now updated to be as below:
-
-```
-public class MonitorMojo
- extends AbstractMojo
-{
-
- /**
- * List of websites to monitor.
- * @parameter
- */
- private List websites;
-
- /**
- * The website monitor component instance that will be injected
- * by the Plexus runtime.
- * @component
- */
- private WebsiteMonitor monitor;
-
- public void execute()
- throws MojoExecutionException, MojoFailureException
- {
- if ( !hasWebsites() )
- {
- if ( getLog().isWarnEnabled() )
- getLog().warn( "No websites specified to be monitored." );
- return;
- }
-
- if ( getLog().isDebugEnabled() )
- showMonitoredWebsites();
-
- monitor.addWebsites( websites );
- try
- {
- monitor.monitor();
- }
- catch ( Exception e )
- {
- if ( getLog().isErrorEnabled() )
- getLog().error( "Error monitoring websites.", e );
- }
- }
-
- private void showMonitoredWebsites()
- {
- getLog().debug( "Monitoring following websites:" );
- for ( Iterator it = websites.iterator(); it.hasNext(); )
- {
- String website = (String) it.next();
- getLog().debug( "\t" + website );
- }
- }
-
- /**
- * Determines if websites were specified to the Mojo.
- *
- * @return true if there were websites specified.
- */
- private boolean hasWebsites()
- {
- return ( null != websites && websites.size() > 0 );
- }
-
- /**
- * Returns the list of websites.
- * Not public API. For unit tests only.
- *
- * @return List of websites specified via Mojo configuration.
- */
- protected List getWebsites()
- {
- return this.websites;
- }
-
- /**
- * Returns the {@link WebsiteMonitor} component instance.
- * Not public API. For unit tests only.
- *
- * @return the {@link WebsiteMonitor} instance.
- */
- protected WebsiteMonitor getMonitor()
- {
- return monitor;
- }
-
-}
-```
-
-1. Let's run the test and see what happens. You can run the test from within your favourite IDE, or from command prompt by typing
-
-```
- mvn clean test
-```
-
-At this point, the Mojo test should run without any failures.
-
-Great! You have just hooked your Plexus component successfully to a Maven plugin.
-
-For more information on developing and using Maven plugins, please refer to [Guide to Developing Java Plugins](http://maven.apache.org/guides/plugin/guide-java-plugin-development.html)
+Replaced by [Testing Maven plugins](/guides/migrating-from-plexus-container.html#Testing_Maven_plugins) and [Maven Plugin Testing Harness](https://maven.apache.org/plugin-testing/maven-plugin-testing-harness/getting-started/index.html).
diff --git a/src/site/markdown/guides/writing-components/07_02_from_a_plexus_application.md b/src/site/markdown/guides/writing-components/07_02_from_a_plexus_application.md
index 0525bfb..780db90 100644
--- a/src/site/markdown/guides/writing-components/07_02_from_a_plexus_application.md
+++ b/src/site/markdown/guides/writing-components/07_02_from_a_plexus_application.md
@@ -4,238 +4,8 @@ author: Rahul Thakur
date: 2006-06-08
---
-`The contents of this document are a work in progress`
-
# Plexus Website Monitor Application
-This section will show how to use a Plexus component in a Plexus application.
-
-## Setting up a Plexus Application project
-
-### Creating a Plexus application project using an archetype
-
-Maven Archetypes are discussed in detail [here](http://maven.apache.org/guides/mini/guide-creating-archetypes.html).
-
-1. From the command prompt, change directory to the location where you want to setup the Plexus application project.
-
-1. Run the following command to set up a skeleton Plexus Application project.
-
-```
-
- mvn archetype:create -DarchetypeGroupId=org.codehaus.plexus -DarchetypeArtifactId=plexus-archetype-application \
- -DarchetypeVersion=1.0-alpha-1-SNAPSHOT -DgroupId=org.codehaus.plexus -DartifactId=plexus-website-monitor-application \
- -DremoteRepositories=http://snapshots.repository.codehaus.org/
-
-```
-
-The `maven-archetype-mojo` sets up a skeleton Maven plugin project '`plexus-website-monitor-application`' for us with reasonable defaults.
-
-### Updating pom.xml dependencies
-
-1. Locate pom.xml under the '`plexus-website-monitor-application`' folder.
-
-1. Edit it and add a `dependency` to the plexus-website-monitor-component that we have developed in earlier chapters.
-
-1. We also configure a
-
-The pom.xml should look like this now:
-
-```
-
-
-
- plexus-examples
- org.codehaus.plexus.examples
- 1-SNAPSHOT
-
- 4.0.0
- org.codehaus.plexus
- plexus-website-monitor-application
- plexus-application
- 1.0-SNAPSHOT
-
-
-
- org.codehaus.plexus
- plexus-appserver-maven-plugin
- true
-
- src/conf
- foo
- src/conf/application.xml
- src/plexus.properties
-
-
-
-
-
-
- junit
- junit
- 3.8.1
- test
-
-
- org.codehaus.plexus
- plexus-website-monitor-component
- 1.0-SNAPSHOT
-
-
-
-
-```
-
-### Setting up an IDE project
-
-Before we proceed further let us set up an Eclipse project for our Plexus application project. To do so currently, and as a workaround we comment out the generated `` element in the `pom.xml` and add a `jar`. To generate an Eclipse project:
-
-1. Open up a command prompt/terminal, and
-
-1. run the following command
-
-```
-
- mvn eclipse:clean eclipse:eclipse
-
-```
-
-Import the generated project under an Eclipse Project.
-
-### Adding an Application Entry Class
-
-For any standalone Java application, we need a Class that defines a `main` method; the case of Plexus application is no different. We add a Application main class for our application (don't worry about the implementation details yet).
-
-We create a folder for Java sources `src/main/java` and add a sensible package for the main class. For this trail, we have created the package `org.codehaus.plexus.site.monitor` and create a main class `Main.java` under it.
-
-The generated source with a `System.out.println()` looks like below:
-
-```
-
-public class Main
-{
-
- public static void main( String[] args )
- {
- System.out.println ("Hello Plexus application!");
-
- }
-
-}
-
-```
-
-Having imported the project and added a main class, we now revert the `packaging` back to value `plexus-application`.
-
-### Setting up packaging configuration
-
-Next we set up an application assembler plugin for our Plexus application project. To do this,
-
-1. Locate the pom.xml for the plexus application project
-
-1. update the ` element configuration such that it is reflected as below
-
-```
-
-...
-
-
-
- org.codehaus.plexus
- plexus-appserver-maven-plugin
- true
-
- src/conf
- foo
- src/conf/application.xml
- src/plexus.properties
-
-
-
-
- org.codehaus.mojo
- appassembler-maven-plugin
-
-
- package
-
- assemble
-
-
-
-
- target/site-monitor-app
-
- true
-
-
-
- monitor
-
- org.codehaus.plexus.site.monitor.Main
-
-
-
-
-
-
-
-...
-
-```
-
-Note how the assembly directory is specified in the `appassembler` plugin configuration - this is where our Plexus application will be packaged up when the Maven plugin is invoked.
-
-The discussion on Plugin configuration is beyond the scope of this tutorial, you can refer to book 'Better builds with Maven' or other resources available at:
-
-1. [Maven Books and Articles](http://maven.apache.org/articles.html).
-
-### Adding `\ for Appassembler plugin download
-
-As of this writing the Appassembler pluging is available from the Codehaus snapshots repository. To have Maven download the latest version (snapshot), we add the `pluginRepositories` information to the `pom.xml`
-
-```
-
-....
-....
-
-
- codehaus-mojo-snapshots
- Codehaus Snapshots
- http://snapshots.repository.codehaus.org/
-
-
-
-```
-
-### Testing Application configuration
-
-Before we go any further, let us take our Plexus site monitor application for a spin. To do this:
-
-1. Open a command prompt/terminal
-
-1. Change directory to the Plexus application project's directory
-
-1. Run the following Maven command
-
-```
-mvn clean package
-```
-
-If you look under `target` directory you will see that the Site Monitor application is assembled under `site-monitor-app` directory. The contents under that directory consist of executable scripts (Shell and batch script by default).
-
-Lets try running the application and see what happens. To do this:
-
-1. At the command prompt, change directory to `$project-home/target/site-monitor-app/bin`
-
-1. Run the script appropriate for your operating system.
-
-You should an output similar to as below on the console:
-
-```
-E:\plexus\plexus-examples\plexus-website-monitor-application\target\site-monitor-app\bin>monitor.bat
-Hello Plexus application!
-```
-
-At this point we are ready to play with Plexus Embedder and hook our Website monitor component into our Plexus application.
+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 embedded a Plexus container in a standalone application.
-[Next: Plexus Embedder Intro & Site Monitor component integration into the application ](./07_02_plexus_embedder_and_component_integration.html)
+For the replacement, see [Looking up components](/guides/migrating-from-plexus-container.html#Looking_up_components) and [Parts without a replacement](/guides/migrating-from-plexus-container.html#Parts_without_a_replacement).
diff --git a/src/site/markdown/guides/writing-components/07_02_plexus_embedder_and_component_integration.md b/src/site/markdown/guides/writing-components/07_02_plexus_embedder_and_component_integration.md
index 5424251..813c363 100644
--- a/src/site/markdown/guides/writing-components/07_02_plexus_embedder_and_component_integration.md
+++ b/src/site/markdown/guides/writing-components/07_02_plexus_embedder_and_component_integration.md
@@ -4,113 +4,8 @@ author: Rahul Thakur
date: 2006-11-15
---
-`The contents of this document are a work in progress`
-
# Plexus Embedder
-The Plexus Embedder allows us to set up and start a Plexus Container container from within a Standalone application. The components can then be looked up in usual manner (we will see demonstrate in bit, if you don't know).
-
-## Making Embedder available to the application
-
-First thing, we need to make the Embedder available to our application by adding a dependency on it in the `pom.xml`. Follow snippet shows the relevant ` section of the application project's `pom.xml`.
-
-```
-
-
- ...
-
-
- junit
- junit
- 3.8.1
- test
-
-
- org.codehaus.plexus
- plexus-website-monitor-component
- 1.0-SNAPSHOT
-
-
-
- org.codehaus.plexus
- plexus-container-default
- 1.0-alpha-9
-
-
- ...
-
-
-```
-
-Regenerate the IDE project again as discussed in the previous section.
-
-## Starting up an embedded Plexus Container instance
-
-Lets add some code to our Site Monitor application entry class that:
-
-1. creates and starts an Embedder instance
-
-1. Obtains `PlexusContainer` instance, and
-
-1. performs a lookup for `WebsiteMonitor` component
-
-Our updated code looks as below:
-
-```
-public class Main
-{
-
- /**
- * @param args
- */
- public static void main( String[] args )
- {
- Embedder embedder = new Embedder();
- try
- {
- embedder.start();
- PlexusContainer container = embedder.getContainer();
- WebsiteMonitor monitor = (WebsiteMonitor) container.lookup( WebsiteMonitor.ROLE );
- try
- {
- monitor.monitor();
- }
- catch ( Exception e )
- {
- e.printStackTrace();
- }
-
- }
- catch ( PlexusContainerException e )
- {
- e.printStackTrace();
- }
- catch ( ComponentLookupException e )
- {
- e.printStackTrace();
- }
-
- }
-
-}
-```
-
-At this point you can try running the above `Main` class from your favorite IDE. For demonstration purposes the `WebsiteMonitor` is by default configured to monitor `http://plexus.codehaus.org`. You should see it output the HTTP status for the monitoring request issued.
-
-Something like this:
-
-```
-[INFO] HTTP request returned HTTP status code: 200 for website: http://plexus.codehaus.org/
-```
-
-## How does Plexus Embedder works?
-
-Plexus Embedder creates an instance of Plexus Container, which then loads and parses all available dependencies to discover any Plexus Components and registers them internally to make them available for look-ups.
-
-To recapture again, the container looks for a Component descriptor under:
-
-1. META-INF/plexus/components.xml
-
-This is exactly what those few lines of code achieve in the above snippet. You can, of course, use the Embedder to do fancier stuff.
+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 started an embedded container.
-Great! we have just finished integrating our site monitor component into our site monitor application.
+For the replacement, see [Looking up components](/guides/migrating-from-plexus-container.html#Looking_up_components).
diff --git a/src/site/markdown/guides/writing-components/07_03_from_a_web_application.md b/src/site/markdown/guides/writing-components/07_03_from_a_web_application.md
index a982026..1454ec7 100644
--- a/src/site/markdown/guides/writing-components/07_03_from_a_web_application.md
+++ b/src/site/markdown/guides/writing-components/07_03_from_a_web_application.md
@@ -6,142 +6,8 @@ author:
date: 2006-11-21
---
-`The contents of this document are a work in progress`
-
# How to use Plexus in web applications
-Before we demonstrate how we can set up a web application to start a Plexus Container and look up Plexus components, let us understand the alternatives that are available to embed Plexus container in web applications.
-
-## Configuration
-
-Plexus Servlet module exists for simplifying embedding and usage of Plexus in context of web applications which run inside the servlet container.
-
-There are two ways of embedding Plexus.
-
-1. By setting up a **Plexus[ServletContextListener](http://java.sun.com/products/servlet/2.3/javadoc/javax/servlet/ServletContextListener.html)**
-
-1. By setting up a **PlexusLoaderServlet**.
-
-The first way is suported by servlet containers which are compliant with servlet specification 2.3 or higher. Second one should be used for compatibility with older versions of servlet containers
-
-## Setting up PlexusServletContextListener to embed Plexus
-
-```
-
- ...
-
- org.codehaus.plexus.servlet.PlexusServletContextListener
-
- ...
-
-```
-
-## Setting up PlexusLoaderServlet to embed Plexus
-
-```
-
- plexus
- org.codehaus.plexus.servlet.PlexusLoaderServlet
- 1
-
-```
-
-By default, in both the above cases, the Plexus Embedder will search for the configuration files in the following locations:
-
-- /WEB-INF/plexus.xml (for main Plexus configuration file)
-
-- /WEB-INF/plexus.properties (for properties file which is used for seeding Plexus context)
-
-These location can be overidden _TODO: explain how_
-
-
-
-
-
-
-In both the above cases a new instance of Plexus Conatiner will be created and stored in "application" scope for the web application under the key: **org.codehaus.plexus.PlexusConstants.PLEXUS_KEY**
-
-## How to lookup and release components
-
-### In a Servlet
-
-```
-...
-ServletContext context = getServletContext();
-VelocityComponent velocityComponent = ( VelocityComponent ) PlexusServletUtils.lookup( context, VelocityComponent.ROLE );
-...
-PlexusServletUtils.release( context, velocityComponent );
-...
-```
-
-### In JSP
-
-```
-<%
-...
-VelocityComponent velocityComponent = ( VelocityComponent ) PlexusServletUtils.lookup( application, VelocityComponent.ROLE );
-...
-PlexusServletUtils.release( application, velocityComponent );
-...
-%>
-```
-
-### In Struts Action or in similar case
-
-```
-public abstract class BaseAction extends Action
-{
- protected Object lookup( HttpServletRequest request, String role )
- throws ServletException
- {
- HttpSession session = request.getSession();
-
- ServletContext application = session.getServletContext();
-
- Object retValue = PlexusServletUtils.lookup( application, role );
-
- return retValue;
- }
-
- protected void release( HttpServletRequest request, Object component )
- throws ServletException
- {
- HttpSession session = request.getSession();
-
- ServletContext application = session.getServletContext();
-
- PlexusServletUtils.release( application, component );
- }
-
- void someAction( HttpServletRequest request )
- {
- VelocityComponent velocityComponent= ( VelocityComponent ) lookup( request, VelocityComponent.ROLE );
-
- ....
-
- release( request, velocityComponent );
- }
-}
-```
-
-## Obtaining the Plexus Container instance
-
-If you need to access the instance of PlexusContainer object, it can be obtained by the following call:
-
-```
-PlexusContainer getPlexusContainer( ServletContext servletContext )
-```
-
-### Required artifacts
-
-Maven dependency:
-
-```
-
- plexus
- plexus-servlet
- 1.0-beta-2
-
-```
+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 used the Plexus servlet listener and loader in a web application.
-[Next: Setting up a Web Application Project ](./07_03_setting_up_a_web_application.html)
+For the replacement, see [Parts without a replacement](/guides/migrating-from-plexus-container.html#Parts_without_a_replacement).
diff --git a/src/site/markdown/guides/writing-components/07_03_setting_up_a_web_application.md b/src/site/markdown/guides/writing-components/07_03_setting_up_a_web_application.md
index 22e0c4b..28433d4 100644
--- a/src/site/markdown/guides/writing-components/07_03_setting_up_a_web_application.md
+++ b/src/site/markdown/guides/writing-components/07_03_setting_up_a_web_application.md
@@ -4,138 +4,8 @@ author: Rahul Thakur
date: 2006-11-22
---
-`The contents of this document are a work in progress`
-
# Preparing the web application project to use Plexus
-We will create a very basic web application project first and then gradually evolve it to demonstrate how Plexus can be embedded.
-
-To create a web application skeleton:
-
-1. Open the command prompt/terminal window.
-
-1. Change directory to where you want to create your web application project.
-
-1. Run the following Maven command
-
-```
-mvn archetype:create -DarchetypeGroupId=org.apache.maven.archetypes \
- -DarchetypeArtifactId=maven-archetype-webapp \
- -DarchetypeVersion=1.0-alpha-4-SNAPSHOT \
- -DgroupId=org.codehaus.plexus.examples \
- -DartifactId=plexus-example-webapp \
- -DpackageName=org.codehaus.plexus.tutorial \
- -Dpackaging=war \
- -DremoteRepositories=http://people.apache.org/repo/m2-snapshot-repository/
-```
-
-**Archetype creation options are explained here:**
-
-|**Commandline Option**|**Description**|**Required**|
-|---|---|---|
-|-DarchetypeGroupId|"groupId" for the archetype we want to use|Yes|
-|-DarchetypeArtifact|"artifactId" for the archetype we want to use|Yes|
-|-DarchetypeVersion|"version" for the archetype we want to use|Yes|
-|-DgroupId|"groupId" for the project to be generated|Yes|
-|-DartifactId|"artifactId" for the project to be generated|Yes|
-|-DpackageName|Base package name to be use for any Java sources being copied over|No|
-|-Dpackaging|Packaging to be used for the created project|No|
-|-DremoteRepositories|Comma-separated list of repositories to lookup to retrieve archetype|No|
-
-For more information on Maven Archetypes please refer to [this resource](http://maven.apache.org/guides/getting-started/index.html) on the Maven website.
-
-A web application project should have been created now at the location where you ran the `archetype:create` command.
-
-Locate the `pom.xml` under the created project, the contents of the POM should be as below:
-
-```
-
- 4.0.0
- org.codehaus.plexus.examples
- plexus-example-webapp
- war
- 1.0-SNAPSHOT
- Maven Webapp Archetype
- http://maven.apache.org
-
-
- junit
- junit
- 3.8.1
- test
-
-
-
- plexus-example-webapp
-
-
-```
-
-## Updating the POM
-
-Before we can embed Plexus in our web application we need to make the JAR library that contains the Plexus Embedder available to our project. We do this by introducing required ` elements in the project's `pom.xml`.
-
-The updated `pom.xml` (along with some other updates) looks as below:
-
-```
-
-
- plexus-examples
- org.codehaus.plexus.examples
- 1-SNAPSHOT
-
- 4.0.0
- org.codehaus.plexus.examples
- plexus-example-webapp
- war
- Plexus Web Application Example
- 1.0-SNAPSHOT
- http://maven.apache.org
-
- plexus-example-webapp
-
-
-
- junit
- junit
- 3.8.1
- test
-
-
-
- org.codehaus.plexus
- plexus-servlet
- 1.0-beta-5
-
-
- org.codehaus.plexus
- plexus-container-default
- 1.0-alpha-10
-
-
-
-```
-
-## Generate a Project for your IDE.
-
-### For Eclipse.
-
-1. Change directory to the newly created directory 'plexus-example-webapp'
-
-1. Run the following command from command prompt to generate Eclipse project setting files.
-
-```
- (for WTP 0.7)
- E:\plexus\plexus-examples\plexus-example-webapp>mvn eclipse:eclipse
-```
-
-```
- (for WTP 1.0 or higher)
- E:\plexus\plexus-examples\plexus-example-webapp>mvn eclipse:eclipse -Dwtpversion=1.0
-```
-
-Eclipse project files should get generated succesfully at this point. If there were any unsatisfied dependencies, update ` for dependencies in pom.xml to an available release version.
+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 set up a web application project for the Plexus servlet integration.
-1. Fire up Eclipse and import the generated project into an Eclipse Workspace.
+For the replacement, see [Parts without a replacement](/guides/migrating-from-plexus-container.html#Parts_without_a_replacement).
diff --git a/src/site/markdown/index.md b/src/site/markdown/index.md
index 1b81bc8..7a4e569 100644
--- a/src/site/markdown/index.md
+++ b/src/site/markdown/index.md
@@ -16,7 +16,7 @@ Each project has its own site, linked below, with Javadoc and reports. Sources a
Plexus originally had two halves: an IoC container, and a set of components written for it. **The container is retired.** Maven moved to [Eclipse Sisu](https://www.eclipse.org/sisu/) and [JSR-330](https://jcp.org/en/jsr/detail?id\=330) years ago, and nothing listed below needs a Plexus container to run -- the components are ordinary JSR-330 beans.
-What remains, and what this project is now, is the second half: the libraries below. The container documentation is still on this site, under _Old IoC Documentation_, because a great deal of writing from that era links to it. See [Feature Comparison](./ref/feature-comparison.html) for how Plexus related to other IoC ecosystems of the time.
+What remains, and what this project is now, is the second half: the libraries below. The container documentation is still on this site, under _Plexus Container (retired)_, because a great deal of writing from that era links to it. Pages that taught the container now point to replacements; start with [Migrating from the Plexus container](./guides/migrating-from-plexus-container.html). See [Feature Comparison](./ref/feature-comparison.html) for how Plexus related to other IoC ecosystems of the time.
# Libraries
@@ -62,7 +62,7 @@ What remains, and what this project is now, is the second half: the libraries be
These are archived and receive no fixes, including security fixes. Don't start anything new on them.
-- [plexus-containers](./plexus-containers/) -- use [Eclipse Sisu](https://www.eclipse.org/sisu/) with JSR-330 annotations.
+- [plexus-containers](./plexus-containers/) -- use [Eclipse Sisu](https://www.eclipse.org/sisu/) with JSR-330 annotations; see [Migrating from the Plexus container](./guides/migrating-from-plexus-container.html).
- [plexus-cipher](https://github.com/codehaus-plexus/plexus-cipher) -- absorbed into [plexus-sec-dispatcher](./plexus-sec-dispatcher/) 4.x.
diff --git a/src/site/markdown/new-container-gotchas.md b/src/site/markdown/new-container-gotchas.md
index f8c824e..913a67f 100644
--- a/src/site/markdown/new-container-gotchas.md
+++ b/src/site/markdown/new-container-gotchas.md
@@ -22,4 +22,4 @@ Similar to above, but more serious. This causes the new component API to be load
## Maven Jetty Plugin
-The Maven Jetty Plugin seems to be failing with webapps that use the plexus container in some instances. In former versions of plexus-xwork-integration, the container was forced to ignore plexus.xml from Maven using a classloader. Using the new version this appears not to work (though I suspect it would work if Maven was using the new container too - ie, trunk). More investigation needed. See [ JETTY-62](http://jira.codehaus.org/browse/JETTY-62) for the original problem that is reoccurring.
+The Maven Jetty Plugin seems to be failing with webapps that use the plexus container in some instances. In former versions of plexus-xwork-integration, the container was forced to ignore plexus.xml from Maven using a classloader. Using the new version this appears not to work (though I suspect it would work if Maven was using the new container too - ie, trunk). More investigation needed. See JETTY-62 for the original problem that is reoccurring.
diff --git a/src/site/markdown/ref/component-configuration.md b/src/site/markdown/ref/component-configuration.md
index abfbda3..878bf9e 100644
--- a/src/site/markdown/ref/component-configuration.md
+++ b/src/site/markdown/ref/component-configuration.md
@@ -2,68 +2,14 @@
title: Component Configuration
---
-`The contents of this document are a work in progress`
-
# Component Configuration
-## Overview
-
-For each component plexus creates a component profile. The profiles keeps track of the following things for each component:
-
-- [Component_Factory](#Component_Factory)
-
-- [Lifecycle_Handler](#Lifecycle_Handler)
+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 component profile and the `components.xml` descriptor.
-- [Component_Composer](#Component_Composer)
-
-- [Instantiation_Strategy](#Instantiation_Strategy)
+## Overview
-- The configuration for the component
+Replaced by [Components and injection](/guides/migrating-from-plexus-container.html#Components_and_injection) and [converting Plexus components to JSR-330](https://eclipse.dev/sisu/org.eclipse.sisu.plexus/conversion-to-jsr330.html) in the Sisu documentation.
## Component Descriptor
-Let's take a look at the component descriptor. It starts off with a block for the component:
-
-```
-
-```
-
-You can then declare the role and the role hint of the component. The role and the hint are what you use to look up your component from plexus. The hint is optional. The hint is just an extra id that allows you to differentiate components of the same type.
-
-```
-org.codehaus.plexus.Component
-component1
-```
-
-The implementation attribute tells plexus what you want to use to implement the specified role:
-
-```
-org.codehaus.plexus.DefaultComponent
-```
-
-You can specify how your class should be created via the component factory. The default is java. But, there are additional \[Component Factories\] as well for groovy, bsh, and jpython.
-
-```
-org.codehaus.plexus.DefaultComponent
-```
-
-If you want to use a personality that is not the default personality, you can specify a lifecycle handler. You will need this when you are mixing and matching component personalities.
-
-```
-avalon
-```
-
-Then, there is the instantiation strategy. This controls how often plexus creates your components. There are the following options:
-
-|**Strategy**|**Description**||
-|---|---|---|
-|per-lookup|Every time you lookup a component one will be created.||
-|singleton|Only one instance of your component will ever be created.||
-|keep-alive|This ensures a component is only used as a singleton, and is only shutdown when the container shuts down.||
-|poolable|Pools several component instances.||
-
-The default is singleton and you can change the strategy like this:
-
-```
-per-lookup
-```
+Replaced by [Component index](/guides/migrating-from-plexus-container.html#Component_index).
diff --git a/src/site/markdown/ref/why-use-components.md b/src/site/markdown/ref/why-use-components.md
index f93063e..cad97e1 100644
--- a/src/site/markdown/ref/why-use-components.md
+++ b/src/site/markdown/ref/why-use-components.md
@@ -78,7 +78,7 @@ While components can usually be tested by conventional means, Plexus comes with
Clear separation of components, along with well-defined interfaces, allow replacing components with other implementations. This can facilitate advanced application architectures without code modifications.
-An example of this can be seen in Apache Geronimo's GBuild, which is built on [ Apache Continuum](http://continuum.apache.org/), a Plexus application. By replacing some components with identical functionality that works with ActiveMQ, a distributed countinuous integration server was built.
+An example of this can be seen in Apache Geronimo's GBuild, which is built on [ Apache Continuum](https://continuum.apache.org/), a Plexus application. By replacing some components with identical functionality that works with ActiveMQ, a distributed countinuous integration server was built.
Additionally, the container can provide features that can be applied to all components consistently without code modifications. For example, Plexus can resolve components transparently at runtime from a Maven repository.
@@ -88,7 +88,7 @@ Additionally, the container can provide features that can be applied to all comp
Other projects have also offered what a component may be:
-- [ PicoContainer](http://picocontainer.codehaus.org/Inversion\+of\+Control)
+- [ PicoContainer](http://picocontainer.com/)
- [ Avalon](http://avalon.apache.org/central/cop/index.html)
diff --git a/src/site/site.xml b/src/site/site.xml
index 30cc192..8d6abe1 100644
--- a/src/site/site.xml
+++ b/src/site/site.xml
@@ -50,19 +50,20 @@ under the License.
Kept, and kept at these exact URLs, because a great deal of external writing links to it.
Do not move or delete these pages. -->