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

warm.archetype.1.0.0.Alpha7.source-code.generate.rb Maven / Gradle / Ivy

There is a newer version: 1.0.0.Alpha8
Show newest version

require('fileutils')

puts "Generating pom.xml list at #{Dir.pwd} for #{ARGV[0]}"

version = ARGV[0];
fractionList = File.open( File.join( '..', 'fraction-list', 'target', 'classes', 'fraction-list.txt' ) ).read;

outputDir = File.join( '.', 'target', 'classes', 'archetype-resources' );
FileUtils.mkdir_p( outputDir )

File.open( File.join( outputDir, 'pom.xml' ), 'w' ) do |f|
  f.puts ''
  f.puts '  4.0.0'
  f.puts ''
  f.puts '  ${groupId}'
  f.puts '  ${artifactId}'
  f.puts ''
  f.puts '  ${version}'
  f.puts ''
  f.puts '  '
  f.puts "    #{version}"
  f.puts '  '
  f.puts ''
  f.puts '  '
  f.puts '    '
  f.puts '      '
  f.puts '        org.wildfly.swarm'
  f.puts '        plugin'
  f.puts '        ${version.wildfly-swarm}'
  f.puts '        '
  f.puts '          ${package}.Main'
  f.puts '        '
  f.puts '        '
  f.puts '          '
  f.puts '            '
  f.puts '              package'
  f.puts '            '
  f.puts '          '
  f.puts '        '
  f.puts '      '
  f.puts '    '
  f.puts '  '
  f.puts ''
  f.puts '  '

  f.puts '    '
  f.puts '      org.wildfly.swarm'
  f.puts '      container'
  f.puts '      ${version.wildfly-swarm}'
  f.puts '    '
  f.puts ''

  fractionList.each_line do |l|
    left = l.split('=')[0].strip
    parts = left.split(':')
    f.puts( '    ' )
  end

  f.puts '    '
  f.puts '      junit'
  f.puts '      junit'
  f.puts '      3.8.1'
  f.puts '      test'
  f.puts '    '
  f.puts '  '
  f.puts ''
end




© 2015 - 2024 Weber Informatics LLC | Privacy Policy