All Downloads are FREE. Search and download functionalities are using the official Maven repository.

coursier.maven.WritePom.scala Maven / Gradle / Ivy

The newest version!
package coursier.maven

import coursier.core.{Configuration, Dependency, Project}

object WritePom {

  // format: off
  def project(proj: Project, packaging: Option[String]) = {

    def dependencyNode(config: Configuration, dep: Dependency) = {
      
        {dep.module.organization}
        {dep.module.name}
        {
          if (dep.version.isEmpty)
            Nil
          else
            Seq({dep.version})
        }
        {
          if (config.isEmpty)
            Nil
          else
            Seq({config.value})
        }
      
    }

    
      // parent
      {proj.module.organization}
      {proj.module.name}
        {
          packaging
            .map(p => {p})
            .toSeq
        }
      {proj.info.description}
      {proj.info.homePage}
      {proj.version}
      // licenses
      {proj.module.name}
      
        {proj.module.name}
        {proj.info.homePage}
      
      // SCM
      // developers
        {
          if (proj.dependencies.isEmpty)
            Nil
          else
            
              {
                proj.dependencies.map {
                  case (config, dep) =>
                    dependencyNode(config, dep)
                }
              }
            
        }
        {
          if (proj.dependencyManagement.isEmpty)
            Nil
          else
            
              
                {
                  proj.dependencyManagement.map {
                    case (config, dep) =>
                      dependencyNode(config, dep)
                  }
                }
              
            
        }
      // properties
      // repositories
    
  }
  // format: on

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy