org.apache.maven.model.converter
Class Maven1Converter

java.lang.Object
  extended by org.codehaus.plexus.logging.AbstractLogEnabled
      extended by org.apache.maven.model.converter.Maven1Converter
All Implemented Interfaces:
org.codehaus.plexus.logging.LogEnabled

public class Maven1Converter
extends org.codehaus.plexus.logging.AbstractLogEnabled

Converts a Maven 1 project.xml (v3 pom) to a Maven 2 pom.xml (v4 pom).

Version:
$Id: Maven1Converter.java 567438 2007-08-19 17:29:20Z dennisl $
Author:
Fabrizio Giustina, Dennis Lundberg

Field Summary
private  java.io.File basedir
           
private  java.util.List converters
          Available converters for specific plugin configurations
private  java.lang.String fileName
           
private  java.util.List listeners
           
private  java.io.File outputdir
           
private  PluginRelocatorManager pluginRelocatorManager
          Plexus component that manages plugin relocators
 
Constructor Summary
Maven1Converter()
           
 
Method Summary
 void addListener(ConverterListener listener)
           
 void execute()
           
private  void fireSavePomEvent(java.io.File pomFile, boolean alreadyExist)
           
 java.io.File getBasedir()
           
 java.io.File getOutputdir()
           
 java.lang.String getProjectFileName()
           
private  boolean isEmpty(java.lang.String value)
           
private  void loadProperties(java.util.Properties properties, java.io.File propertiesFile)
           
private  org.apache.maven.model.v3_0_0.Model loadV3Pom(java.io.File inputFile)
           
private  void removeDistributionManagementStatus(org.apache.maven.model.Model v4Model)
          The status element of the distributionManagement section must not be set in local projects.
private  void sendInfoMessage(java.lang.String message)
           
private  void sendWarnMessage(java.lang.String message)
           
 void setBasedir(java.io.File basedir)
           
 void setOutputdir(java.io.File outputdir)
           
 void setProjectFile(java.io.File projectFile)
           
 void setProjectFileName(java.lang.String projectFileName)
           
private  void writeV4Pom(org.apache.maven.model.Model v4Model)
          Write the pom to ${basedir}/pom.xml.
 
Methods inherited from class org.codehaus.plexus.logging.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

converters

private java.util.List converters
Available converters for specific plugin configurations


pluginRelocatorManager

private PluginRelocatorManager pluginRelocatorManager
Plexus component that manages plugin relocators


basedir

private java.io.File basedir

outputdir

private java.io.File outputdir

fileName

private java.lang.String fileName

listeners

private java.util.List listeners
Constructor Detail

Maven1Converter

public Maven1Converter()
Method Detail

execute

public void execute()
             throws ProjectConverterException
Throws:
ProjectConverterException

isEmpty

private boolean isEmpty(java.lang.String value)

loadProperties

private void loadProperties(java.util.Properties properties,
                            java.io.File propertiesFile)

loadV3Pom

private org.apache.maven.model.v3_0_0.Model loadV3Pom(java.io.File inputFile)
                                               throws java.lang.Exception
Throws:
java.lang.Exception

removeDistributionManagementStatus

private void removeDistributionManagementStatus(org.apache.maven.model.Model v4Model)
The status element of the distributionManagement section must not be set in local projects. This method removes that element from the model.


writeV4Pom

private void writeV4Pom(org.apache.maven.model.Model v4Model)
                 throws ProjectConverterException,
                        java.io.IOException
Write the pom to ${basedir}/pom.xml. If the file exists it will be overwritten.

Parameters:
v4Model -
Throws:
ProjectConverterException
java.io.IOException

getBasedir

public java.io.File getBasedir()

setBasedir

public void setBasedir(java.io.File basedir)

getProjectFileName

public java.lang.String getProjectFileName()

setProjectFileName

public void setProjectFileName(java.lang.String projectFileName)

setProjectFile

public void setProjectFile(java.io.File projectFile)

getOutputdir

public java.io.File getOutputdir()

setOutputdir

public void setOutputdir(java.io.File outputdir)

addListener

public void addListener(ConverterListener listener)

sendInfoMessage

private void sendInfoMessage(java.lang.String message)

sendWarnMessage

private void sendWarnMessage(java.lang.String message)

fireSavePomEvent

private void fireSavePomEvent(java.io.File pomFile,
                              boolean alreadyExist)