plexus-maven-plugin-1.3.8/ 0000755 0001750 0001750 00000000000 11121276713 015402 5 ustar twerner twerner plexus-maven-plugin-1.3.8/src/ 0000755 0001750 0001750 00000000000 11121276713 016171 5 ustar twerner twerner plexus-maven-plugin-1.3.8/src/test/ 0000755 0001750 0001750 00000000000 11121276712 017147 5 ustar twerner twerner plexus-maven-plugin-1.3.8/src/test/resources/ 0000755 0001750 0001750 00000000000 11121276712 021161 5 ustar twerner twerner plexus-maven-plugin-1.3.8/src/test/resources/projects/ 0000755 0001750 0001750 00000000000 11121276712 023012 5 ustar twerner twerner plexus-maven-plugin-1.3.8/src/test/resources/projects/project-01/ 0000755 0001750 0001750 00000000000 11121276712 024676 5 ustar twerner twerner plexus-maven-plugin-1.3.8/src/test/resources/projects/project-01/src/ 0000755 0001750 0001750 00000000000 11121276712 025465 5 ustar twerner twerner plexus-maven-plugin-1.3.8/src/test/resources/projects/project-01/src/main/ 0000755 0001750 0001750 00000000000 11121276712 026411 5 ustar twerner twerner plexus-maven-plugin-1.3.8/src/test/resources/projects/project-01/src/main/java/ 0000755 0001750 0001750 00000000000 11121276712 027332 5 ustar twerner twerner plexus-maven-plugin-1.3.8/src/test/resources/projects/project-01/src/main/java/org/ 0000755 0001750 0001750 00000000000 11121276712 030121 5 ustar twerner twerner plexus-maven-plugin-1.3.8/src/test/resources/projects/project-01/src/main/java/org/codehaus/ 0000755 0001750 0001750 00000000000 11121276712 031714 5 ustar twerner twerner plexus-maven-plugin-1.3.8/src/test/resources/projects/project-01/src/main/java/org/codehaus/plexus/ 0000755 0001750 0001750 00000000000 11121276712 033234 5 ustar twerner twerner ././@LongLink 0000000 0000000 0000000 00000000156 00000000000 011567 L ustar root root plexus-maven-plugin-1.3.8/src/test/resources/projects/project-01/src/main/java/org/codehaus/plexus/component/ plexus-maven-plugin-1.3.8/src/test/resources/projects/project-01/src/main/java/org/codehaus/plexus/c0000755 0001750 0001750 00000000000 11121276712 033377 5 ustar twerner twerner ././@LongLink 0000000 0000000 0000000 00000000170 00000000000 011563 L ustar root root plexus-maven-plugin-1.3.8/src/test/resources/projects/project-01/src/main/java/org/codehaus/plexus/component/Hello.java plexus-maven-plugin-1.3.8/src/test/resources/projects/project-01/src/main/java/org/codehaus/plexus/c0000644 0001750 0001750 00000000217 10565423462 033410 0 ustar twerner twerner package org.codehaus.plexus.component;
public interface Hello
{
final static String ROLE = Hello.class.getName();
void sayHello();
} ././@LongLink 0000000 0000000 0000000 00000000174 00000000000 011567 L ustar root root plexus-maven-plugin-1.3.8/src/test/resources/projects/project-01/src/main/java/org/codehaus/plexus/component/HelloImpl.java plexus-maven-plugin-1.3.8/src/test/resources/projects/project-01/src/main/java/org/codehaus/plexus/c0000644 0001750 0001750 00000000526 10565423462 033413 0 ustar twerner twerner package org.codehaus.plexus.component;
/**
* @plexus.component
*/
public class HelloImpl
implements Hello
{
/**
* @plexus.configuration expression="${expression}" default-value="Hello World!"
* @required
*/
private String message;
public void sayHello()
{
System.out.print( message );
}
} plexus-maven-plugin-1.3.8/src/test/resources/projects/project-01/pom.xml 0000644 0001750 0001750 00000001606 10536361003 026213 0 ustar twerner twerner
4.0.0
plexus-maven-test
plexus-maven-plugin-test
0.1
Plexus Maven Plugin Test
org.codehaus.plexus
plexus-maven-plugin
true
descriptor
plexus-maven-plugin-1.3.8/src/main/ 0000755 0001750 0001750 00000000000 11121276713 017115 5 ustar twerner twerner plexus-maven-plugin-1.3.8/src/main/java/ 0000755 0001750 0001750 00000000000 11121276712 020035 5 ustar twerner twerner plexus-maven-plugin-1.3.8/src/main/java/org/ 0000755 0001750 0001750 00000000000 11121276712 020624 5 ustar twerner twerner plexus-maven-plugin-1.3.8/src/main/java/org/codehaus/ 0000755 0001750 0001750 00000000000 11121276712 022417 5 ustar twerner twerner plexus-maven-plugin-1.3.8/src/main/java/org/codehaus/plexus/ 0000755 0001750 0001750 00000000000 11121276712 023737 5 ustar twerner twerner plexus-maven-plugin-1.3.8/src/main/java/org/codehaus/plexus/maven/ 0000755 0001750 0001750 00000000000 11121276712 025045 5 ustar twerner twerner plexus-maven-plugin-1.3.8/src/main/java/org/codehaus/plexus/maven/plugin/ 0000755 0001750 0001750 00000000000 11121276713 026344 5 ustar twerner twerner plexus-maven-plugin-1.3.8/src/main/java/org/codehaus/plexus/maven/plugin/report/ 0000755 0001750 0001750 00000000000 11121276713 027657 5 ustar twerner twerner plexus-maven-plugin-1.3.8/src/main/java/org/codehaus/plexus/maven/plugin/report/Requirements.java 0000644 0001750 0001750 00000005554 10700074416 033214 0 ustar twerner twerner /*
* The MIT License
*
* Copyright (c) 2006, The Codehaus
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is furnished to do
* so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package org.codehaus.plexus.maven.plugin.report;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.codehaus.doxia.sink.Sink;
import org.jdom.Element;
/**
* @author Trygve Laugstøl
* @version $Id: Requirements.java 6925 2007-10-01 04:35:26Z user57 $
*/
public class Requirements
{
private List requirements = new ArrayList();
public Requirements( Element element )
{
for ( Iterator it = element.getChildren( "requirement" ).iterator(); it.hasNext(); )
{
Element requireqment = (Element) it.next();
requirements.add( new Requirement( requireqment ) );
}
}
public void print( Sink sink )
{
if ( requirements.size() == 0 )
{
return;
}
/*
sink.section4();
sink.sectionTitle4();
sink.text( "Requirements" );
sink.sectionTitle4_();
sink.section4_();
sink.paragraph();
for ( Iterator it = requirements.iterator(); it.hasNext(); )
{
Requirement requirement = (Requirement) it.next();
requirement.print( sink );
}
sink.paragraph_();
*/
// sink.section4();
// sink.sectionTitle4();
// sink.text( "Requirements" );
// sink.sectionTitle4_();
// sink.section4_();
sink.paragraph();
sink.table();
sink.tableCaption();
sink.text( "Requirements" );
sink.tableCaption_();
for ( Iterator it = requirements.iterator(); it.hasNext(); )
{
Requirement requirement = (Requirement) it.next();
requirement.print( sink );
}
sink.table_();
sink.paragraph_();
}
}
plexus-maven-plugin-1.3.8/src/main/java/org/codehaus/plexus/maven/plugin/report/Requirement.java 0000644 0001750 0001750 00000006560 10700074416 033027 0 ustar twerner twerner /*
* The MIT License
*
* Copyright (c) 2006, The Codehaus
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is furnished to do
* so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package org.codehaus.plexus.maven.plugin.report;
import org.codehaus.doxia.sink.Sink;
import org.codehaus.plexus.util.StringUtils;
import org.jdom.Element;
/**
* @author Trygve Laugstøl
* @version $Id: Requirement.java 6925 2007-10-01 04:35:26Z user57 $
*/
public class Requirement
{
private String role;
private String roleHint;
private String fieldName;
public Requirement( Element requireqment )
{
role = requireqment.getChildTextTrim( "role" );
roleHint = requireqment.getChildTextTrim( "roleHint" );
fieldName = requireqment.getChildTextTrim( "fieldName" );
}
public String getRole()
{
return role;
}
public String getRoleHint()
{
return roleHint;
}
public String getFieldName()
{
return fieldName;
}
public void print( Sink sink )
{
/*
sink.text( "Role: " + role ); sink.lineBreak();
if( StringUtils.isNotEmpty( roleHint ) )
{
sink.text( "Role hint: " + roleHint ); sink.lineBreak();
}
if( StringUtils.isNotEmpty( fieldName ) )
{
sink.text( "Field name: " + fieldName ); sink.lineBreak();
}
*/
sink.tableRow();
sink.tableCell();
sink.text( "Role" );
sink.tableCell_();
sink.tableCell();
sink.monospaced();
sink.text( role );
sink.monospaced_();
sink.tableCell_();
sink.tableRow_();
if( StringUtils.isNotEmpty( roleHint ) )
{
sink.tableRow();
sink.tableCell();
sink.text( "Hint" );
sink.tableCell_();
sink.tableCell();
sink.monospaced();
sink.text( roleHint );
sink.monospaced_();
sink.tableCell_();
sink.tableRow_();
}
if( StringUtils.isNotEmpty( fieldName ) )
{
sink.tableRow();
sink.tableCell();
sink.text( "Field name" );
sink.tableCell_();
sink.tableCell();
sink.monospaced();
sink.text( fieldName );
sink.monospaced_();
sink.tableCell_();
sink.tableRow_();
}
}
}
plexus-maven-plugin-1.3.8/src/main/java/org/codehaus/plexus/maven/plugin/report/Component.java 0000644 0001750 0001750 00000012341 10700074416 032463 0 ustar twerner twerner package org.codehaus.plexus.maven.plugin.report;
/*
* Copyright 2007 The Codehaus Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.util.Iterator;
import java.util.List;
import org.codehaus.doxia.sink.Sink;
import org.codehaus.plexus.util.StringUtils;
import org.jdom.Element;
/**
* @author Trygve Laugstøl
* @version $Id: Component.java 6925 2007-10-01 04:35:26Z user57 $
*/
public class Component
implements Comparable
{
private String description;
private String role;
private String roleHint;
private String alias;
private String version;
private String implementation;
private String instantiationStrategy;
private Requirements requirements;
private Configuration configuration;
public Component( Element component )
{
description = component.getChildText( "description" );
role = component.getChildText( "role" );
roleHint = component.getChildText( "role-hint" );
alias = component.getChildText( "alias" );
version = component.getChildText( "version" );
implementation = component.getChildText( "implementation" );
instantiationStrategy = component.getChildTextTrim( "instantiation-strategy" );
List list = component.getChildren( "requirements" );
for ( Iterator it = list.iterator(); it.hasNext(); )
{
Element element = (Element) it.next();
requirements = new Requirements( element );
}
list = component.getChildren( "configuration" );
for ( Iterator it = list.iterator(); it.hasNext(); )
{
Element element = (Element) it.next();
configuration = new Configuration( element );
}
}
public String getRole()
{
return role;
}
public String getRoleHint()
{
return roleHint;
}
public String getImplementation()
{
return implementation;
}
public boolean hasRoleHint()
{
return StringUtils.isNotEmpty( roleHint );
}
public void print( Sink sink, String javaDocDestDir, String jxrDestDir )
{
// ----------------------------------------------------------------------
//
// ----------------------------------------------------------------------
String title;
if ( !hasRoleHint() )
{
title = role;
}
else
{
title = roleHint;
}
// ----------------------------------------------------------------------
//
// ----------------------------------------------------------------------
sink.section3();
sink.sectionTitle3();
sink.text( "Component: " + title );
sink.sectionTitle3_();
sink.section3_();
sink.table();
writeField( sink, "Role", role );
writeField( sink, "Role hint", roleHint );
sink.tableRow();
sink.tableCell();
sink.text( "Implementation" );
sink.tableCell_();
sink.tableCell();
sink.monospaced();
sink.text( implementation );
sink.monospaced_();
sink.text( " " );
sink.link( "../" + javaDocDestDir + "/" + implementation.replace( '.', '/' ) + ".html" );
sink.text( "javadoc" );
sink.link_();
sink.link( "../" + jxrDestDir + "/" + implementation.replace( '.', '/' ) + ".html" );
sink.text( " " );
sink.text( "xref" );
sink.link_();
sink.tableCell_();
sink.tableRow_();
writeField( sink, "Description", description );
writeField( sink, "Alias", alias );
writeField( sink, "Version", version );
writeField( sink, "Instantiation strategy", instantiationStrategy );
sink.table_();
if ( requirements != null )
{
requirements.print( sink );
}
if ( configuration != null )
{
configuration.print( sink );
}
}
private void writeField( Sink sink, String name, String value )
{
if ( StringUtils.isNotEmpty( value ) )
{
sink.tableRow();
sink.tableCell();
sink.text( name );
sink.tableCell_();
sink.tableCell();
sink.monospaced();
sink.text( value );
sink.monospaced_();
sink.tableCell_();
sink.tableRow_();
}
}
public int compareTo( Object o )
{
return ( (Component) o ).getId().compareTo( getId() );
}
private String getId()
{
if ( !hasRoleHint() )
{
return role;
}
else
{
return role + ":" + roleHint;
}
}
}
plexus-maven-plugin-1.3.8/src/main/java/org/codehaus/plexus/maven/plugin/report/Components.java 0000644 0001750 0001750 00000011307 10700074416 032647 0 ustar twerner twerner package org.codehaus.plexus.maven.plugin.report;
/*
* Copyright 2007 The Codehaus Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.SortedMap;
import java.util.SortedSet;
import java.util.TreeMap;
import java.util.TreeSet;
import org.codehaus.doxia.sink.Sink;
import org.jdom.Element;
/**
* @author Trygve Laugstøl
* @version $Id: Components.java 6925 2007-10-01 04:35:26Z user57 $
*/
public class Components
{
private List components = new ArrayList();
public Components( Element element )
{
for ( Iterator it = element.getChildren( "component" ).iterator(); it.hasNext(); )
{
Element component = (Element) it.next();
components.add( new Component( component ) );
}
}
public void print( Sink sink, String javaDocDestDir, String jxrDestDir )
{
SortedSet roles = new TreeSet();
SortedSet emptyList = new TreeSet();
SortedMap roleMap = new TreeMap();
// ----------------------------------------------------------------------
// Build stuff
// ----------------------------------------------------------------------
for ( Iterator it = components.iterator(); it.hasNext(); )
{
Component component = (Component) it.next();
roles.add( component.getRole() );
if ( !component.hasRoleHint() )
{
emptyList.add( component );
}
else
{
List list = (List) roleMap.get( component.getRole() );
if ( list == null )
{
list = new ArrayList();
roleMap.put( component.getRole(), list );
}
list.add( component );
}
}
// ----------------------------------------------------------------------
// Component role index
// ----------------------------------------------------------------------
sink.section2();
sink.sectionTitle2();
sink.text( "Index" );
sink.sectionTitle2_();
sink.section2_();
sink.paragraph();
for ( Iterator it = roles.iterator(); it.hasNext(); )
{
String role = (String) it.next();
sink.link( "#" + role );
sink.text( role );
sink.link_();
sink.lineBreak();
}
sink.paragraph_();
// ----------------------------------------------------------------------
// Components without role hints
// ----------------------------------------------------------------------
sink.section2();
sink.sectionTitle2();
sink.text( "Components without role-hint" );
sink.sectionTitle2_();
sink.section2_();
for ( Iterator it = emptyList.iterator(); it.hasNext(); )
{
Component component = (Component) it.next();
sink.anchor( component.getRole() );
sink.paragraph();
component.print( sink, javaDocDestDir, jxrDestDir );
sink.paragraph_();
sink.anchor_();
}
// ----------------------------------------------------------------------
// Components with role hint, sorted by role
// ----------------------------------------------------------------------
for ( Iterator it = roleMap.entrySet().iterator(); it.hasNext(); )
{
Map.Entry entry = (Map.Entry) it.next();
sink.section2();
sink.sectionTitle2();
sink.anchor( (String) entry.getKey() );
sink.text( "Components implementing " + entry.getKey() );
sink.anchor_();
sink.sectionTitle2_();
sink.section2_();
for ( Iterator j = ( (List) entry.getValue() ).iterator(); j.hasNext(); )
{
Component component = (Component) j.next();
sink.paragraph();
component.print( sink, javaDocDestDir, jxrDestDir );
sink.paragraph_();
}
}
}
}
plexus-maven-plugin-1.3.8/src/main/java/org/codehaus/plexus/maven/plugin/report/Configuration.java 0000644 0001750 0001750 00000003342 10700074416 033331 0 ustar twerner twerner /*
* The MIT License
*
* Copyright (c) 2006, The Codehaus
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is furnished to do
* so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package org.codehaus.plexus.maven.plugin.report;
import org.codehaus.doxia.sink.Sink;
import org.jdom.Element;
/**
* @author Trygve Laugstøl
* @version $Id: Configuration.java 6925 2007-10-01 04:35:26Z user57 $
*/
public class Configuration
{
public Configuration( Element element )
{
}
public void print( Sink sink )
{
sink.section4();
sink.sectionTitle4();
sink.text( "Configuration" ); sink.lineBreak();
sink.sectionTitle4_();
sink.section4_();
sink.paragraph();
sink.paragraph_();
}
}
plexus-maven-plugin-1.3.8/src/main/java/org/codehaus/plexus/maven/plugin/report/ComponentSet.java 0000644 0001750 0001750 00000002655 10565423462 033156 0 ustar twerner twerner package org.codehaus.plexus.maven.plugin.report;
/*
* Copyright 2007 The Codehaus Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.util.List;
import org.codehaus.doxia.sink.Sink;
import org.jdom.Element;
/**
* @author Trygve Laugstøl
* @version $Id: ComponentSet.java 5741 2007-02-16 21:50:42Z olamy $
*/
public class ComponentSet
{
private Components components;
public ComponentSet( Element element )
{
List list = element.getChildren( "components" );
if ( list.size() > 1 )
{
throw new RuntimeException( "The component set can only contain a single section." );
}
components = new Components( (Element) list.get( 0 ) );
}
public void print( Sink sink, String javaDocDestDir, String jxrDestDir )
{
components.print( sink, javaDocDestDir, jxrDestDir );
}
}
././@LongLink 0000000 0000000 0000000 00000000147 00000000000 011567 L ustar root root plexus-maven-plugin-1.3.8/src/main/java/org/codehaus/plexus/maven/plugin/PlexusTestDescriptorMojo.java plexus-maven-plugin-1.3.8/src/main/java/org/codehaus/plexus/maven/plugin/PlexusTestDescriptorMojo.ja0000644 0001750 0001750 00000006116 10700074416 033666 0 ustar twerner twerner package org.codehaus.plexus.maven.plugin;
/*
* Copyright (c) 2004-2005, Codehaus.org
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is furnished to do
* so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
import java.io.File;
import java.util.Collections;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.artifact.handler.ArtifactHandler;
/**
* Generates a Plexus components.xml component descriptor file from test source (javadoc) or test class annotations.
*
* @goal test-descriptor
* @phase process-test-classes
* @requiresDependencyResolution test
*
* @author Trygve Laugstøl
* @version $Id: PlexusTestDescriptorMojo.java 6925 2007-10-01 04:35:26Z user57 $
* @since 1.3.4
*/
public class PlexusTestDescriptorMojo
extends AbstractDescriptorMojo
{
//
// FIXME: When running as process-classes, which is required to deal with the class-based annotation gleaning
// we can't put the generated file into resources, as it will never make it to the correct directory
//
// expression="${project.build.directory}/generated-test-resources/plexus/"
//
/**
* The output directory where the descriptor is written.
*
* @parameter expression="${project.build.testOutputDirectory}"
* @required
*/
private File outputDirectory;
public void execute() throws MojoExecutionException {
// Only execute if the current project looks like its got Java bits in it
ArtifactHandler artifactHandler = getMavenProject().getArtifact().getArtifactHandler();
if (!"java".equals(artifactHandler.getLanguage())) {
log.debug("Not executing on non-Java project");
}
else {
generateDescriptor(TEST_SCOPE, new File(outputDirectory, fileName));
getMavenProjectHelper().addTestResource( getMavenProject(),
outputDirectory.getAbsolutePath(),
Collections.EMPTY_LIST,
Collections.EMPTY_LIST );
}
}
}
././@LongLink 0000000 0000000 0000000 00000000145 00000000000 011565 L ustar root root plexus-maven-plugin-1.3.8/src/main/java/org/codehaus/plexus/maven/plugin/PlexusComponentsReport.java plexus-maven-plugin-1.3.8/src/main/java/org/codehaus/plexus/maven/plugin/PlexusComponentsReport.java0000644 0001750 0001750 00000012021 10700074416 033723 0 ustar twerner twerner package org.codehaus.plexus.maven.plugin;
/*
* The MIT License
*
* Copyright (c) 2006, The Codehaus
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is furnished to do
* so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
import java.io.File;
import java.io.IOException;
import java.util.Locale;
import org.apache.maven.project.MavenProject;
import org.apache.maven.reporting.AbstractMavenReport;
import org.apache.maven.reporting.MavenReportException;
import org.codehaus.doxia.sink.Sink;
import org.codehaus.doxia.site.renderer.SiteRenderer;
import org.codehaus.plexus.maven.plugin.report.ComponentSet;
import org.jdom.Document;
import org.jdom.JDOMException;
import org.jdom.input.SAXBuilder;
/**
* @goal components-report
*
* @execute phase="process-resources" lifecycle="plexus-site"
*
* @author Trygve Laugstøl
* @version $Id: PlexusComponentsReport.java 6925 2007-10-01 04:35:26Z user57 $
*/
public class PlexusComponentsReport
extends AbstractMavenReport
{
/**
* @parameter default-value="${project.build.outputDirectory}/META-INF/plexus/components.xml"
* @required
*/
private File componentsXml;
/**
* @parameter expression="${project}"
* @readonly
*/
private MavenProject project;
/**
* @component org.codehaus.doxia.site.renderer.SiteRenderer
*/
private SiteRenderer siteRenderer;
/**
* @parameter expression="${project.reporting.outputDirectory}
*/
private String outputDirectory;
/**
* Location of javadoc report
*
* @parameter expression="${javaDocDestDir}" default-value="apidocs"
*/
private String javaDocDestDir;
/**
* Location of xref report
*
* @parameter expression="${jxrDestDir}" default-value="xref"
*/
private String jxrDestDir;
// ----------------------------------------------------------------------
// MavenReport Implementation
// ----------------------------------------------------------------------
public String getOutputName()
{
return "plexus/plexus-components";
}
public String getName( Locale locale )
{
return "Plexus Components";
}
public String getCategoryName()
{
return CATEGORY_PROJECT_REPORTS;
}
public String getDescription( Locale locale )
{
return "Plexus components report description";
}
protected MavenProject getProject()
{
return project;
}
protected SiteRenderer getSiteRenderer()
{
return siteRenderer;
}
protected String getOutputDirectory()
{
return outputDirectory;
}
public boolean canGenerateReport()
{
return componentsXml.isFile();
}
protected void executeReport( Locale locale )
throws MavenReportException
{
String title = "Plexus Components Report";
Sink sink = getSink();
sink.head();
sink.title();
sink.text( title );
sink.title_();
sink.head_();
sink.body();
sink.section1();
sink.sectionTitle1();
sink.text( title );
sink.sectionTitle1_();
Document document;
try
{
document = new SAXBuilder().build( componentsXml );
}
catch ( JDOMException e )
{
throw new MavenReportException(
"Error while building document of " + componentsXml.getAbsolutePath() + ".",
e );
}
catch ( IOException e )
{
throw new MavenReportException(
"Error while building document of " + componentsXml.getAbsolutePath() + ".",
e );
}
if ( document.getRootElement().getName().equals( "component-set" ) )
{
ComponentSet componentSet = new ComponentSet( document.getRootElement() );
componentSet.print( sink, javaDocDestDir, jxrDestDir );
}
sink.body_();
sink.flush();
}
}
plexus-maven-plugin-1.3.8/src/main/java/org/codehaus/plexus/maven/plugin/PlexusDescriptorMojo.java 0000644 0001750 0001750 00000004621 10701413305 033347 0 ustar twerner twerner package org.codehaus.plexus.maven.plugin;
/*
* Copyright (c) 2004-2005, Codehaus.org
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is furnished to do
* so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
import java.io.File;
import java.util.Collections;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.artifact.handler.ArtifactHandler;
/**
* Generates a Plexus components.xml component descriptor file from source (javadoc) or class annotations.
*
* @goal descriptor
* @phase process-classes
* @requiresDependencyResolution compile
*
* @author Trygve Laugstøl
* @version $Id: PlexusDescriptorMojo.java 6933 2007-10-05 10:49:41Z user57 $
*/
public class PlexusDescriptorMojo
extends AbstractDescriptorMojo
{
/**
* The directory where the descriptor is written.
*
* @parameter expression="${project.build.outputDirectory}"
* @required
*/
private File outputDirectory;
public void execute() throws MojoExecutionException {
// Only execute if the current project looks like its got Java bits in it
ArtifactHandler artifactHandler = getMavenProject().getArtifact().getArtifactHandler();
if (!"java".equals(artifactHandler.getLanguage())) {
log.debug("Not executing on non-Java project");
}
else {
generateDescriptor(COMPILE_SCOPE, new File(outputDirectory, fileName));
}
}
}
././@LongLink 0000000 0000000 0000000 00000000160 00000000000 011562 L ustar root root plexus-maven-plugin-1.3.8/src/main/java/org/codehaus/plexus/maven/plugin/ClassComponentDescriptorExtractor.java plexus-maven-plugin-1.3.8/src/main/java/org/codehaus/plexus/maven/plugin/ClassComponentDescriptorExt0000644 0001750 0001750 00000012641 10701413253 033736 0 ustar twerner twerner /*
* Copyright (C) 2007 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.codehaus.plexus.maven.plugin;
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.project.MavenProject;
import org.codehaus.plexus.cdc.gleaner.ClassComponentGleaner;
import org.codehaus.plexus.component.repository.cdc.ComponentDescriptor;
import org.codehaus.plexus.util.DirectoryScanner;
/**
* Extracts {@link ComponentDescriptor} from class files.
*
* @version $Id: ClassComponentDescriptorExtractor.java 6932 2007-10-05 10:49:15Z user57 $
*/
public class ClassComponentDescriptorExtractor
extends ComponentDescriptorExtractorSupport
{
private ClassComponentGleaner gleaner;
public ClassComponentDescriptorExtractor(final ClassComponentGleaner gleaner) {
this.gleaner = gleaner;
}
public ClassComponentDescriptorExtractor() {}
public List extract(final MavenProject project, final String scope, final ComponentDescriptor[] roleDefaults) throws Exception {
assert project != null;
assert scope != null;
assert roleDefaults != null;
// We don't have a reasonable default to use, so just puke up
if (gleaner == null) {
throw new IllegalStateException("Gleaner is not bound");
}
log.debug("Gleaner: " + gleaner + ", scope: " + scope);
List classpath;
File classesDir;
if (COMPILE_SCOPE.equals(scope)) {
classpath = project.getCompileClasspathElements();
classesDir = new File(project.getBuild().getOutputDirectory());
}
else if (TEST_SCOPE.equals(scope)) {
classpath = project.getTestClasspathElements();
classesDir = new File(project.getBuild().getTestOutputDirectory());
}
else {
throw new IllegalArgumentException("Invalid scope: " + scope);
}
if (!classesDir.exists()) {
log.warn("Missing classes directory: {}", classesDir);
return Collections.EMPTY_LIST;
}
final ClassLoader prev = Thread.currentThread().getContextClassLoader();
final ClassLoader cl = createClassLoader(classpath);
Thread.currentThread().setContextClassLoader(cl);
try {
return extract(classesDir, cl, getDefaultsByRole(roleDefaults));
}
finally {
Thread.currentThread().setContextClassLoader(prev);
}
}
private ClassLoader createClassLoader(final List elements) throws Exception {
List list = new ArrayList();
// Add the projects dependencies
for (Iterator iter = elements.iterator(); iter.hasNext();) {
String filename = (String) iter.next();
try {
list.add(new File(filename).toURI().toURL());
}
catch (MalformedURLException e) {
throw new MojoExecutionException("Invalid classpath entry: " + filename, e);
}
}
URL[] urls = (URL[]) list.toArray(new URL[list.size()]);
log.debug("Classpath:");
for (int i=0; i