mirror of https://github.com/apache/maven.git
improved javadoc and Java toolchain implementation class name (not a
Plexus component, then DefaultComponentName convention doesn't apply)
This commit is contained in:
parent
36d746789d
commit
e661aa87f5
|
@ -27,12 +27,13 @@ import org.apache.maven.toolchain.model.ToolchainModel;
|
||||||
import org.codehaus.plexus.logging.Logger;
|
import org.codehaus.plexus.logging.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default toolchain implementation.
|
* Default abstract toolchain implementation, to be used as base class for any toolchain implementation
|
||||||
|
* to avoid rewriting usual code.
|
||||||
*
|
*
|
||||||
* @author mkleint
|
* @author mkleint
|
||||||
* @since 2.0.9
|
* @since 2.0.9
|
||||||
*/
|
*/
|
||||||
public abstract class DefaultToolchain
|
public abstract class DefaultToolchain // should have been AbstractToolchain...
|
||||||
implements Toolchain, ToolchainPrivate
|
implements Toolchain, ToolchainPrivate
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ import org.apache.maven.execution.MavenSession;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Public API for a plugin to get a toolchain instance.
|
* Public API for a toolchain-aware plugin to get expected toolchain instance.
|
||||||
*
|
*
|
||||||
* @author mkleint
|
* @author mkleint
|
||||||
* @since 2.0.9
|
* @since 2.0.9
|
||||||
|
|
|
@ -26,7 +26,7 @@ import org.apache.maven.toolchain.Toolchain;
|
||||||
*
|
*
|
||||||
* @author Jason van Zyl
|
* @author Jason van Zyl
|
||||||
* @author Milos Kleint
|
* @author Milos Kleint
|
||||||
* @since 2.0.9
|
* @since 2.0.9, renamed from JavaToolChain in 3.2.4
|
||||||
*/
|
*/
|
||||||
public interface JavaToolchain
|
public interface JavaToolchain
|
||||||
extends Toolchain
|
extends Toolchain
|
||||||
|
|
|
@ -59,7 +59,7 @@ public class JavaToolchainFactory
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
DefaultJavaToolchain jtc = new DefaultJavaToolchain( model, logger );
|
JavaToolchainImpl jtc = new JavaToolchainImpl( model, logger );
|
||||||
|
|
||||||
// populate the provides section
|
// populate the provides section
|
||||||
Properties provides = model.getProvides();
|
Properties provides = model.getProvides();
|
||||||
|
@ -89,11 +89,11 @@ public class JavaToolchainFactory
|
||||||
|
|
||||||
// populate the configuration section
|
// populate the configuration section
|
||||||
Xpp3Dom dom = (Xpp3Dom) model.getConfiguration();
|
Xpp3Dom dom = (Xpp3Dom) model.getConfiguration();
|
||||||
Xpp3Dom javahome = dom.getChild( DefaultJavaToolchain.KEY_JAVAHOME );
|
Xpp3Dom javahome = dom.getChild( JavaToolchainImpl.KEY_JAVAHOME );
|
||||||
if ( javahome == null )
|
if ( javahome == null )
|
||||||
{
|
{
|
||||||
throw new MisconfiguredToolchainException( "Java toolchain without the "
|
throw new MisconfiguredToolchainException( "Java toolchain without the "
|
||||||
+ DefaultJavaToolchain.KEY_JAVAHOME + " configuration element." );
|
+ JavaToolchainImpl.KEY_JAVAHOME + " configuration element." );
|
||||||
}
|
}
|
||||||
File normal = new File( FileUtils.normalize( javahome.getValue() ) );
|
File normal = new File( FileUtils.normalize( javahome.getValue() ) );
|
||||||
if ( normal.exists() )
|
if ( normal.exists() )
|
||||||
|
|
|
@ -31,9 +31,9 @@ import org.codehaus.plexus.util.Os;
|
||||||
* JDK toolchain implementation.
|
* JDK toolchain implementation.
|
||||||
*
|
*
|
||||||
* @author Milos Kleint
|
* @author Milos Kleint
|
||||||
* @since 2.0.9
|
* @since 2.0.9, renamed from DefaultJavaToolChain in 3.2.4
|
||||||
*/
|
*/
|
||||||
public class DefaultJavaToolchain
|
public class JavaToolchainImpl
|
||||||
extends DefaultToolchain
|
extends DefaultToolchain
|
||||||
implements JavaToolchain
|
implements JavaToolchain
|
||||||
{
|
{
|
||||||
|
@ -41,7 +41,7 @@ public class DefaultJavaToolchain
|
||||||
|
|
||||||
public static final String KEY_JAVAHOME = "jdkHome"; //NOI18N
|
public static final String KEY_JAVAHOME = "jdkHome"; //NOI18N
|
||||||
|
|
||||||
public DefaultJavaToolchain( ToolchainModel model, Logger logger )
|
public JavaToolchainImpl( ToolchainModel model, Logger logger )
|
||||||
{
|
{
|
||||||
super( model, "jdk", logger );
|
super( model, "jdk", logger );
|
||||||
}
|
}
|
|
@ -70,6 +70,6 @@ Maven Core
|
||||||
to manage toolchain selection,
|
to manage toolchain selection,
|
||||||
|
|
||||||
* internal JDK toolchain implementation: <<<JavaToolchain>>> interface ({{{./apidocs/org/apache/maven/toolchain/java/JavaToolchain.html}javadoc}}),
|
* internal JDK toolchain implementation: <<<JavaToolchain>>> interface ({{{./apidocs/org/apache/maven/toolchain/java/JavaToolchain.html}javadoc}}),
|
||||||
with its <<<DefaultJavaToolchain>>> implementation
|
with its <<<JavaToolchainImpl>>> implementation
|
||||||
({{{./xref/org/apache/maven/toolchain/java/DefaultJavaToolchain.html}source}}) and <<<JavaToolchainFactory>>>
|
({{{./xref/org/apache/maven/toolchain/java/JavaToolchainImpl.html}source}}) and <<<JavaToolchainFactory>>>
|
||||||
factory ({{{./xref/org/apache/maven/toolchain/java/JavaToolchainFactory.html}source}}).
|
factory ({{{./xref/org/apache/maven/toolchain/java/JavaToolchainFactory.html}source}}).
|
||||||
|
|
|
@ -24,7 +24,7 @@ import static org.junit.Assert.assertTrue;
|
||||||
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
|
||||||
import org.apache.maven.toolchain.java.DefaultJavaToolchain;
|
import org.apache.maven.toolchain.java.JavaToolchainImpl;
|
||||||
import org.apache.maven.toolchain.model.PersistedToolchains;
|
import org.apache.maven.toolchain.model.PersistedToolchains;
|
||||||
import org.apache.maven.toolchain.model.ToolchainModel;
|
import org.apache.maven.toolchain.model.ToolchainModel;
|
||||||
import org.apache.maven.toolchain.model.io.xpp3.MavenToolchainsXpp3Reader;
|
import org.apache.maven.toolchain.model.io.xpp3.MavenToolchainsXpp3Reader;
|
||||||
|
@ -48,8 +48,8 @@ public class DefaultToolchainTest
|
||||||
PersistedToolchains jdks = reader.read( jdksIS );
|
PersistedToolchains jdks = reader.read( jdksIS );
|
||||||
PersistedToolchains jdksExtra = reader.read( jdksExtraIS );
|
PersistedToolchains jdksExtra = reader.read( jdksExtraIS );
|
||||||
|
|
||||||
DefaultJavaToolchain tc1 = new DefaultJavaToolchain( jdks.getToolchains().get( 0 ), null );
|
JavaToolchainImpl tc1 = new JavaToolchainImpl( jdks.getToolchains().get( 0 ), null );
|
||||||
DefaultJavaToolchain tc2 = new DefaultJavaToolchain( jdksExtra.getToolchains().get( 0 ), null );
|
JavaToolchainImpl tc2 = new JavaToolchainImpl( jdksExtra.getToolchains().get( 0 ), null );
|
||||||
|
|
||||||
assertTrue( tc1.equals( tc1 ) );
|
assertTrue( tc1.equals( tc1 ) );
|
||||||
assertFalse( tc1.equals( tc2 ) );
|
assertFalse( tc1.equals( tc2 ) );
|
||||||
|
|
Loading…
Reference in New Issue