activerecord-jdbc-adapter-ficoh 1.3.21-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (191) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +35 -0
  3. data/.travis.yml +462 -0
  4. data/.yardopts +4 -0
  5. data/Appraisals +36 -0
  6. data/CONTRIBUTING.md +49 -0
  7. data/Gemfile +68 -0
  8. data/History.md +1191 -0
  9. data/LICENSE.txt +25 -0
  10. data/README.md +277 -0
  11. data/RUNNING_TESTS.md +88 -0
  12. data/Rakefile +298 -0
  13. data/Rakefile.jdbc +20 -0
  14. data/activerecord-jdbc-adapter.gemspec +63 -0
  15. data/lib/active_record/connection_adapters/as400_adapter.rb +2 -0
  16. data/lib/active_record/connection_adapters/db2_adapter.rb +1 -0
  17. data/lib/active_record/connection_adapters/derby_adapter.rb +1 -0
  18. data/lib/active_record/connection_adapters/firebird_adapter.rb +1 -0
  19. data/lib/active_record/connection_adapters/h2_adapter.rb +1 -0
  20. data/lib/active_record/connection_adapters/hsqldb_adapter.rb +1 -0
  21. data/lib/active_record/connection_adapters/informix_adapter.rb +1 -0
  22. data/lib/active_record/connection_adapters/jdbc_adapter.rb +1 -0
  23. data/lib/active_record/connection_adapters/jndi_adapter.rb +1 -0
  24. data/lib/active_record/connection_adapters/mariadb_adapter.rb +1 -0
  25. data/lib/active_record/connection_adapters/mssql_adapter.rb +1 -0
  26. data/lib/active_record/connection_adapters/mysql2_adapter.rb +1 -0
  27. data/lib/active_record/connection_adapters/mysql_adapter.rb +1 -0
  28. data/lib/active_record/connection_adapters/oracle_adapter.rb +1 -0
  29. data/lib/active_record/connection_adapters/postgresql_adapter.rb +1 -0
  30. data/lib/active_record/connection_adapters/sqlite3_adapter.rb +1 -0
  31. data/lib/active_record/connection_adapters/sqlserver_adapter.rb +1 -0
  32. data/lib/activerecord-jdbc-adapter.rb +1 -0
  33. data/lib/arel/visitors/compat.rb +64 -0
  34. data/lib/arel/visitors/db2.rb +137 -0
  35. data/lib/arel/visitors/derby.rb +112 -0
  36. data/lib/arel/visitors/firebird.rb +79 -0
  37. data/lib/arel/visitors/h2.rb +25 -0
  38. data/lib/arel/visitors/hsqldb.rb +32 -0
  39. data/lib/arel/visitors/postgresql_jdbc.rb +6 -0
  40. data/lib/arel/visitors/sql_server.rb +225 -0
  41. data/lib/arel/visitors/sql_server/ng42.rb +293 -0
  42. data/lib/arjdbc.rb +22 -0
  43. data/lib/arjdbc/db2.rb +4 -0
  44. data/lib/arjdbc/db2/adapter.rb +802 -0
  45. data/lib/arjdbc/db2/as400.rb +137 -0
  46. data/lib/arjdbc/db2/column.rb +177 -0
  47. data/lib/arjdbc/db2/connection_methods.rb +45 -0
  48. data/lib/arjdbc/derby.rb +3 -0
  49. data/lib/arjdbc/derby/active_record_patch.rb +13 -0
  50. data/lib/arjdbc/derby/adapter.rb +567 -0
  51. data/lib/arjdbc/derby/connection_methods.rb +16 -0
  52. data/lib/arjdbc/derby/schema_creation.rb +15 -0
  53. data/lib/arjdbc/discover.rb +104 -0
  54. data/lib/arjdbc/firebird.rb +4 -0
  55. data/lib/arjdbc/firebird/adapter.rb +468 -0
  56. data/lib/arjdbc/firebird/connection_methods.rb +20 -0
  57. data/lib/arjdbc/h2.rb +3 -0
  58. data/lib/arjdbc/h2/adapter.rb +335 -0
  59. data/lib/arjdbc/h2/connection_methods.rb +22 -0
  60. data/lib/arjdbc/hsqldb.rb +3 -0
  61. data/lib/arjdbc/hsqldb/adapter.rb +304 -0
  62. data/lib/arjdbc/hsqldb/connection_methods.rb +23 -0
  63. data/lib/arjdbc/hsqldb/explain_support.rb +35 -0
  64. data/lib/arjdbc/hsqldb/schema_creation.rb +11 -0
  65. data/lib/arjdbc/informix.rb +5 -0
  66. data/lib/arjdbc/informix/adapter.rb +160 -0
  67. data/lib/arjdbc/informix/connection_methods.rb +9 -0
  68. data/lib/arjdbc/jdbc.rb +62 -0
  69. data/lib/arjdbc/jdbc/adapter.rb +997 -0
  70. data/lib/arjdbc/jdbc/adapter_require.rb +46 -0
  71. data/lib/arjdbc/jdbc/arel_support.rb +149 -0
  72. data/lib/arjdbc/jdbc/base_ext.rb +34 -0
  73. data/lib/arjdbc/jdbc/callbacks.rb +52 -0
  74. data/lib/arjdbc/jdbc/column.rb +83 -0
  75. data/lib/arjdbc/jdbc/connection.rb +26 -0
  76. data/lib/arjdbc/jdbc/connection_methods.rb +59 -0
  77. data/lib/arjdbc/jdbc/driver.rb +44 -0
  78. data/lib/arjdbc/jdbc/error.rb +75 -0
  79. data/lib/arjdbc/jdbc/extension.rb +69 -0
  80. data/lib/arjdbc/jdbc/java.rb +13 -0
  81. data/lib/arjdbc/jdbc/type_cast.rb +154 -0
  82. data/lib/arjdbc/jdbc/type_converter.rb +142 -0
  83. data/lib/arjdbc/mssql.rb +7 -0
  84. data/lib/arjdbc/mssql/adapter.rb +822 -0
  85. data/lib/arjdbc/mssql/column.rb +207 -0
  86. data/lib/arjdbc/mssql/connection_methods.rb +72 -0
  87. data/lib/arjdbc/mssql/explain_support.rb +99 -0
  88. data/lib/arjdbc/mssql/limit_helpers.rb +231 -0
  89. data/lib/arjdbc/mssql/lock_methods.rb +77 -0
  90. data/lib/arjdbc/mssql/types.rb +343 -0
  91. data/lib/arjdbc/mssql/utils.rb +82 -0
  92. data/lib/arjdbc/mysql.rb +3 -0
  93. data/lib/arjdbc/mysql/adapter.rb +998 -0
  94. data/lib/arjdbc/mysql/bulk_change_table.rb +150 -0
  95. data/lib/arjdbc/mysql/column.rb +167 -0
  96. data/lib/arjdbc/mysql/connection_methods.rb +137 -0
  97. data/lib/arjdbc/mysql/explain_support.rb +82 -0
  98. data/lib/arjdbc/mysql/schema_creation.rb +58 -0
  99. data/lib/arjdbc/oracle.rb +4 -0
  100. data/lib/arjdbc/oracle/adapter.rb +968 -0
  101. data/lib/arjdbc/oracle/column.rb +136 -0
  102. data/lib/arjdbc/oracle/connection_methods.rb +21 -0
  103. data/lib/arjdbc/postgresql.rb +3 -0
  104. data/lib/arjdbc/postgresql/_bc_time_cast_patch.rb +21 -0
  105. data/lib/arjdbc/postgresql/adapter.rb +1498 -0
  106. data/lib/arjdbc/postgresql/base/array_parser.rb +95 -0
  107. data/lib/arjdbc/postgresql/base/oid.rb +412 -0
  108. data/lib/arjdbc/postgresql/base/pgconn.rb +8 -0
  109. data/lib/arjdbc/postgresql/base/schema_definitions.rb +132 -0
  110. data/lib/arjdbc/postgresql/column.rb +640 -0
  111. data/lib/arjdbc/postgresql/connection_methods.rb +44 -0
  112. data/lib/arjdbc/postgresql/explain_support.rb +53 -0
  113. data/lib/arjdbc/postgresql/oid/bytea.rb +3 -0
  114. data/lib/arjdbc/postgresql/oid_types.rb +265 -0
  115. data/lib/arjdbc/postgresql/schema_creation.rb +60 -0
  116. data/lib/arjdbc/railtie.rb +11 -0
  117. data/lib/arjdbc/sqlite3.rb +3 -0
  118. data/lib/arjdbc/sqlite3/adapter.rb +654 -0
  119. data/lib/arjdbc/sqlite3/connection_methods.rb +36 -0
  120. data/lib/arjdbc/sqlite3/explain_support.rb +29 -0
  121. data/lib/arjdbc/sybase.rb +2 -0
  122. data/lib/arjdbc/sybase/adapter.rb +47 -0
  123. data/lib/arjdbc/tasks.rb +13 -0
  124. data/lib/arjdbc/tasks/database_tasks.rb +66 -0
  125. data/lib/arjdbc/tasks/databases.rake +91 -0
  126. data/lib/arjdbc/tasks/databases3.rake +239 -0
  127. data/lib/arjdbc/tasks/databases4.rake +39 -0
  128. data/lib/arjdbc/tasks/db2_database_tasks.rb +104 -0
  129. data/lib/arjdbc/tasks/derby_database_tasks.rb +95 -0
  130. data/lib/arjdbc/tasks/h2_database_tasks.rb +31 -0
  131. data/lib/arjdbc/tasks/hsqldb_database_tasks.rb +70 -0
  132. data/lib/arjdbc/tasks/jdbc_database_tasks.rb +169 -0
  133. data/lib/arjdbc/tasks/mssql_database_tasks.rb +46 -0
  134. data/lib/arjdbc/tasks/oracle/enhanced_structure_dump.rb +297 -0
  135. data/lib/arjdbc/tasks/oracle_database_tasks.rb +65 -0
  136. data/lib/arjdbc/util/quoted_cache.rb +60 -0
  137. data/lib/arjdbc/util/serialized_attributes.rb +98 -0
  138. data/lib/arjdbc/util/table_copier.rb +108 -0
  139. data/lib/arjdbc/version.rb +8 -0
  140. data/lib/generators/jdbc/USAGE +9 -0
  141. data/lib/generators/jdbc/jdbc_generator.rb +17 -0
  142. data/pom.xml +285 -0
  143. data/rails_generators/jdbc_generator.rb +15 -0
  144. data/rails_generators/templates/config/initializers/jdbc.rb +10 -0
  145. data/rails_generators/templates/lib/tasks/jdbc.rake +11 -0
  146. data/rakelib/01-tomcat.rake +51 -0
  147. data/rakelib/02-test.rake +151 -0
  148. data/rakelib/bundler_ext.rb +11 -0
  149. data/rakelib/db.rake +58 -0
  150. data/rakelib/rails.rake +77 -0
  151. data/src/java/arjdbc/ArJdbcModule.java +288 -0
  152. data/src/java/arjdbc/db2/DB2Module.java +77 -0
  153. data/src/java/arjdbc/db2/DB2RubyJdbcConnection.java +128 -0
  154. data/src/java/arjdbc/derby/DerbyModule.java +180 -0
  155. data/src/java/arjdbc/derby/DerbyRubyJdbcConnection.java +153 -0
  156. data/src/java/arjdbc/firebird/FirebirdRubyJdbcConnection.java +190 -0
  157. data/src/java/arjdbc/h2/H2Module.java +50 -0
  158. data/src/java/arjdbc/h2/H2RubyJdbcConnection.java +86 -0
  159. data/src/java/arjdbc/hsqldb/HSQLDBModule.java +74 -0
  160. data/src/java/arjdbc/informix/InformixRubyJdbcConnection.java +76 -0
  161. data/src/java/arjdbc/jdbc/AdapterJavaService.java +43 -0
  162. data/src/java/arjdbc/jdbc/Callable.java +44 -0
  163. data/src/java/arjdbc/jdbc/ConnectionFactory.java +77 -0
  164. data/src/java/arjdbc/jdbc/DataSourceConnectionFactory.java +156 -0
  165. data/src/java/arjdbc/jdbc/DriverConnectionFactory.java +63 -0
  166. data/src/java/arjdbc/jdbc/DriverWrapper.java +128 -0
  167. data/src/java/arjdbc/jdbc/JdbcConnectionFactory.java +32 -0
  168. data/src/java/arjdbc/jdbc/RubyJdbcConnection.java +4541 -0
  169. data/src/java/arjdbc/jdbc/SQLBlock.java +54 -0
  170. data/src/java/arjdbc/jdbc/WithResultSet.java +37 -0
  171. data/src/java/arjdbc/mssql/MSSQLModule.java +91 -0
  172. data/src/java/arjdbc/mssql/MSSQLRubyJdbcConnection.java +193 -0
  173. data/src/java/arjdbc/mysql/MySQLModule.java +140 -0
  174. data/src/java/arjdbc/mysql/MySQLRubyJdbcConnection.java +456 -0
  175. data/src/java/arjdbc/oracle/OracleModule.java +81 -0
  176. data/src/java/arjdbc/oracle/OracleRubyJdbcConnection.java +477 -0
  177. data/src/java/arjdbc/postgresql/ByteaUtils.java +171 -0
  178. data/src/java/arjdbc/postgresql/DriverImplementation.java +78 -0
  179. data/src/java/arjdbc/postgresql/PGDriverImplementation.java +535 -0
  180. data/src/java/arjdbc/postgresql/PostgreSQLModule.java +189 -0
  181. data/src/java/arjdbc/postgresql/PostgreSQLRubyJdbcConnection.java +489 -0
  182. data/src/java/arjdbc/sqlite3/SQLite3Module.java +93 -0
  183. data/src/java/arjdbc/sqlite3/SQLite3RubyJdbcConnection.java +405 -0
  184. data/src/java/arjdbc/util/CallResultSet.java +826 -0
  185. data/src/java/arjdbc/util/DateTimeUtils.java +517 -0
  186. data/src/java/arjdbc/util/NumberUtils.java +50 -0
  187. data/src/java/arjdbc/util/ObjectSupport.java +65 -0
  188. data/src/java/arjdbc/util/QuotingUtils.java +139 -0
  189. data/src/java/arjdbc/util/StringCache.java +60 -0
  190. data/src/java/arjdbc/util/StringHelper.java +155 -0
  191. metadata +288 -0
@@ -0,0 +1,98 @@
1
+ module ArJdbc
2
+ module Util
3
+ # Gets included into `ActiveRecord::Base` to support sending LOB values
4
+ # in a separate update SQL statement for DB adapters that need this.
5
+ module SerializedAttributes
6
+
7
+ # protected
8
+
9
+ def update_lob_columns
10
+ klass = self.class
11
+ return unless type = klass.lob_type # e.g. /blob/i
12
+ connection = klass.connection
13
+ if connection.respond_to?(:update_lob_values?)
14
+ return false unless connection.update_lob_values?
15
+ end
16
+ klass.columns.each do |column|
17
+ next if column.sql_type !~ type
18
+ next if ( value = dump_column_value(column) ).nil?
19
+ if connection.respond_to?(:update_lob_value?)
20
+ next unless connection.update_lob_value?(value, column)
21
+ end
22
+ connection.update_lob_value(self, column, value)
23
+ end
24
+ end
25
+
26
+ private
27
+
28
+ def dump_column_value(column)
29
+ SerializedAttributes.dump_column_value(self, column)
30
+ end
31
+
32
+ if defined? ActiveRecord::Type::Serialized # ArJdbc::AR42
33
+
34
+ def self.dump_column_value(record, column)
35
+ value = record[ column.name.to_s ]
36
+ column.cast_type.type_cast_for_database(value)
37
+ end
38
+
39
+ else
40
+
41
+ def self.dump_column_value(record, column)
42
+ value = record[ name = column.name.to_s ]
43
+ if record.class.respond_to?(:serialized_attributes)
44
+ if coder = record.class.serialized_attributes[name]
45
+ value = coder.respond_to?(:dump) ? coder.dump(value) : value.to_yaml
46
+ end
47
+ else
48
+ if record.respond_to?(:unserializable_attribute?)
49
+ value = value.to_yaml if record.unserializable_attribute?(name, column)
50
+ else
51
+ value = value.to_yaml if value.is_a?(Hash)
52
+ end
53
+ end
54
+ value
55
+ end
56
+
57
+ end
58
+
59
+ def self.setup(lob_type = nil, after_save_alias = nil)
60
+ ActiveRecord::Base.send :include, self # include SerializedAttributes
61
+ ActiveRecord::Base.lob_type = lob_type unless lob_type.nil?
62
+ if after_save_alias
63
+ ActiveRecord::Base.class_eval do
64
+ alias_method after_save_alias, 'update_lob_columns'
65
+ end
66
+ ActiveRecord::Base.after_save after_save_alias
67
+ else
68
+ ActiveRecord::Base.after_save 'update_lob_columns'
69
+ end
70
+ end
71
+
72
+ def self.included(base)
73
+ base.extend ClassMethods
74
+ end
75
+
76
+ module ClassMethods
77
+
78
+ def lob_type
79
+ @lob_type ||= begin
80
+ if superclass.respond_to?(:lob_type)
81
+ superclass.lob_type
82
+ else
83
+ /blob|clob/i
84
+ end
85
+ end
86
+ end
87
+
88
+ def lob_type=(type)
89
+ @lob_type = type
90
+ end
91
+
92
+ end
93
+
94
+ end
95
+ end
96
+ # @private only due backwards compatibility
97
+ SerializedAttributesHelper = Util::SerializedAttributes
98
+ end
@@ -0,0 +1,108 @@
1
+ module ArJdbc
2
+ module Util
3
+ module TableCopier
4
+
5
+ # taken from SQLite adapter, code loosely based on http://git.io/P7tFQA
6
+
7
+ # Performs changes for table by first copying (and preserving contents)
8
+ # into another (temporary) table, than alters and copies all data back.
9
+ def alter_table(table_name, options = {})
10
+ table_name = table_name.to_s.downcase
11
+ altered_table_name = "a#{table_name}"
12
+ caller = lambda { |definition| yield definition if block_given? }
13
+
14
+ transaction do
15
+ # A temporary table might improve performance here, but
16
+ # it doesn't seem to maintain indices across the whole move.
17
+ move_table(table_name, altered_table_name, options)
18
+ move_table(altered_table_name, table_name, &caller)
19
+ end
20
+ end
21
+
22
+ # Move a table into another while preserving all content.
23
+ # @see #copy_table
24
+ def move_table(from, to, options = {}, &block)
25
+ copy_table(from, to, options, &block)
26
+ drop_table(from)
27
+ end
28
+
29
+ # @see #copy_table_contents
30
+ # @see #copy_table_indexes
31
+ def copy_table(from, to, options = {})
32
+ from_primary_key = primary_key(from)
33
+ create_table(to, options.merge(:id => false)) do |definition|
34
+ @definition = definition
35
+ @definition.primary_key(from_primary_key) if from_primary_key.present?
36
+ columns(from).each do |column|
37
+ column_name = options[:rename] ?
38
+ (options[:rename][column.name] ||
39
+ options[:rename][column.name.to_sym] ||
40
+ column.name) : column.name
41
+
42
+ next if column_name == from_primary_key
43
+
44
+ @definition.column(column_name, column.type,
45
+ :limit => column.limit, :default => column.default,
46
+ :precision => column.precision, :scale => column.scale,
47
+ :null => column.null)
48
+ end
49
+ yield @definition if block_given?
50
+ end
51
+
52
+ copy_table_indexes(from, to, options[:rename] || {})
53
+ copy_table_contents(from, to,
54
+ @definition.columns.map {|column| column.name},
55
+ options[:rename] || {})
56
+ end
57
+
58
+ # Copies indexes for a given table.
59
+ def copy_table_indexes(from, to, rename = {})
60
+ indexes(from).each do |index|
61
+ name = index.name.downcase
62
+ if to == "a#{from}"
63
+ name = "t#{name}"
64
+ elsif from == "a#{to}"
65
+ name = name[1..-1]
66
+ end
67
+
68
+ to_column_names = columns(to).map(&:name)
69
+ columns = index.columns.map { |column| rename[column] || column }
70
+ columns = columns.select { |column| to_column_names.include?(column) }
71
+
72
+ unless columns.empty?
73
+ # index name can't be the same
74
+ opts = { :name => name.gsub(/(^|_)(#{from})_/, "\\1#{to}_"), :internal => true }
75
+ opts[:unique] = true if index.unique
76
+ add_index(to, columns, opts)
77
+ end
78
+ end
79
+ end
80
+
81
+ # Copies the content of a table into another.
82
+ def copy_table_contents(from, to, columns, rename = {})
83
+ column_mappings = Hash[ columns.map { |name| [name, name] } ]
84
+ rename.each { |a| column_mappings[a.last] = a.first }
85
+ from_columns = columns(from).collect {|col| col.name}
86
+ columns = columns.find_all{ |col| from_columns.include?(column_mappings[col]) }
87
+ quoted_columns = columns.map { |col| quote_column_name(col) } * ','
88
+
89
+ quoted_to = quote_table_name(to)
90
+
91
+ raw_column_mappings = Hash[ columns(from).map { |c| [c.name, c] } ]
92
+
93
+ execute("SELECT * FROM #{quote_table_name(from)}", 'Copy Table').each do |row|
94
+ sql = "INSERT INTO #{quoted_to} (#{quoted_columns}) VALUES ("
95
+
96
+ column_values = columns.map do |col|
97
+ quote(row[column_mappings[col]], raw_column_mappings[col])
98
+ end
99
+
100
+ sql << column_values * ', '
101
+ sql << ')'
102
+ exec_insert sql, 'Copy Table', []
103
+ end
104
+ end
105
+
106
+ end
107
+ end
108
+ end
@@ -0,0 +1,8 @@
1
+ module ArJdbc
2
+ VERSION = "1.3.21"
3
+ # @deprecated
4
+ module Version
5
+ # @private 1.2.x compatibility
6
+ VERSION = ArJdbc::VERSION
7
+ end
8
+ end
@@ -0,0 +1,9 @@
1
+ Description:
2
+ Creates stubs that ensure AR-JDBC is bootstrapped in your Rails application.
3
+
4
+ Example:
5
+ ./script/generate jdbc
6
+
7
+ This will create:
8
+ config/initializers/jdbc.rb
9
+ lib/tasks/jdbc.rake
@@ -0,0 +1,17 @@
1
+ class JdbcGenerator < Rails::Generators::Base
2
+ def self.source_root
3
+ @source_root ||= File.expand_path('../../../../rails_generators/templates', __FILE__)
4
+ end
5
+
6
+ def create_jdbc_files
7
+ directory '.', '.'
8
+ end
9
+
10
+ def self.desc(description=nil)
11
+ return super if description
12
+ "Description:\n" <<
13
+ " Creates stubs that ensure AR-JDBC is bootstrapped in your Rails application.\n" <<
14
+ " NOTE: you should not need this if you're on Rails >= 3.0 (using Bundler) ..."
15
+ end
16
+
17
+ end
data/pom.xml ADDED
@@ -0,0 +1,285 @@
1
+ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3
+ <modelVersion>4.0.0</modelVersion>
4
+
5
+ <groupId>rubygems</groupId>
6
+ <artifactId>activerecord-jdbc-adapter</artifactId>
7
+ <version>1.4.0-SNAPSHOT</version>
8
+ <name>activerecord-jdbc-adapter</name>
9
+ <description>
10
+ JDBC adapter for ActiveRecord, for use within JRuby on Rails.
11
+ </description>
12
+
13
+ <url>http://github.com/jruby/activerecord-jdbc-adapter/wiki</url>
14
+
15
+ <issueManagement>
16
+ <system>GitHub</system>
17
+ <url>http://github.com/jruby/activerecord-jdbc-adapter/issues</url>
18
+ </issueManagement>
19
+
20
+ <scm>
21
+ <connection>https://github.com/jruby/activerecord-jdbc-adapter.git</connection>
22
+ <developerConnection>scm:git:git@github.com:jruby/activerecord-jdbc-adapter.git</developerConnection>
23
+ <url>https://github.com/jruby/activerecord-jdbc-adapter</url>
24
+ </scm>
25
+
26
+ <licenses>
27
+ <license>
28
+ <name>MIT License</name>
29
+ <url>http://opensource.org/licenses/MIT</url>
30
+ <distribution>repo</distribution>
31
+ </license>
32
+ </licenses>
33
+
34
+ <developers>
35
+ <developer>
36
+ <id>nicksieger</id>
37
+ <name>Nick Sieger</name>
38
+ <email>nicksieger@gmail.com</email>
39
+ </developer>
40
+ <developer>
41
+ <id>kares</id>
42
+ <name>Karol Bucek</name>
43
+ <email>self@kares.org</email>
44
+ </developer>
45
+ </developers>
46
+
47
+ <properties>
48
+ <jruby.version>1.7.16</jruby.version>
49
+ <jruby.plugins.version>1.0.6</jruby.plugins.version>
50
+ <invoker.skip>${maven.test.skip}</invoker.skip>
51
+ <compiler.source>1.6</compiler.source>
52
+ <compiler.target>1.6</compiler.target>
53
+ <gen.sources>${basedir}/target/generated-sources</gen.sources>
54
+ </properties>
55
+
56
+ <repositories>
57
+ <repository>
58
+ <id>rubygems-releases</id>
59
+ <url>http://rubygems-proxy.torquebox.org/releases</url>
60
+ </repository>
61
+ <!--
62
+ <repository>
63
+ <releases>
64
+ <enabled>false</enabled>
65
+ </releases>
66
+ <snapshots>
67
+ <enabled>true</enabled>
68
+ </snapshots>
69
+ <id>sonatype</id>
70
+ <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
71
+ </repository>-->
72
+ </repositories>
73
+
74
+ <dependencies>
75
+ <dependency>
76
+ <groupId>org.jruby</groupId>
77
+ <artifactId>jruby-core</artifactId>
78
+ <version>${jruby.version}</version>
79
+ <scope>provided</scope>
80
+ </dependency>
81
+
82
+ <dependency>
83
+ <groupId>org.postgresql</groupId>
84
+ <artifactId>postgresql</artifactId>
85
+ <version>9.2-1003-jdbc4</version>
86
+ <scope>provided</scope>
87
+ </dependency>
88
+
89
+ <dependency>
90
+ <groupId>mysql</groupId>
91
+ <artifactId>mysql-connector-java</artifactId>
92
+ <version>5.1.32</version>
93
+ <scope>provided</scope>
94
+ </dependency>
95
+
96
+ <!--
97
+ <dependency>
98
+ <groupId>rubygems</groupId>
99
+ <artifactId>test-unit</artifactId>
100
+ <version>2.5.4</version>
101
+ <type>gem</type>
102
+ <scope>test</scope>
103
+ </dependency>
104
+ <dependency>
105
+ <groupId>rubygems</groupId>
106
+ <artifactId>test-unit-context</artifactId>
107
+ <version>0.4.0</version>
108
+ <type>gem</type>
109
+ <scope>test</scope>
110
+ </dependency>-->
111
+ <!--
112
+ <dependency>
113
+ <groupId>junit</groupId>
114
+ <artifactId>junit</artifactId>
115
+ <version>4.11</version>
116
+ <scope>test</scope>
117
+ </dependency>-->
118
+ </dependencies>
119
+
120
+ <!--<packaging>gem</packaging>-->
121
+
122
+ <build>
123
+ <!--
124
+ <extensions>
125
+ <extension>
126
+ <groupId>de.saumya.mojo</groupId>
127
+ <artifactId>gem-with-jar-extension</artifactId>
128
+ <version>${jruby.plugins.version}</version>
129
+ </extension>
130
+ </extensions>-->
131
+
132
+ <defaultGoal>prepare-package</defaultGoal>
133
+
134
+ <sourceDirectory>src/java</sourceDirectory>
135
+ <resources>
136
+ <resource>
137
+ <directory>src/resources</directory>
138
+ </resource>
139
+ </resources>
140
+ <testSourceDirectory>test/java</testSourceDirectory>
141
+ <!--
142
+ <testResources>
143
+ <testResource>
144
+ <directory>test</directory>
145
+ </testResource>
146
+ </testResources>-->
147
+
148
+ <!--<directory>${basedir}/pkg</directory>-->
149
+ <!--
150
+ <directory>${basedir}/target</directory>
151
+ <outputDirectory>target/classes</outputDirectory>-->
152
+
153
+ <plugins>
154
+
155
+ <plugin>
156
+ <artifactId>maven-jar-plugin</artifactId>
157
+ <version>2.4</version>
158
+ <executions>
159
+ <execution>
160
+ <phase>prepare-package</phase>
161
+ <goals>
162
+ <goal>jar</goal>
163
+ </goals>
164
+ </execution>
165
+ </executions>
166
+ <configuration>
167
+ <outputDirectory>lib/arjdbc/jdbc</outputDirectory>
168
+ <finalName>adapter_java</finalName>
169
+ </configuration>
170
+ </plugin>
171
+
172
+ <plugin>
173
+ <artifactId>maven-clean-plugin</artifactId>
174
+ <version>2.4</version>
175
+ <configuration>
176
+ <filesets>
177
+ <fileset>
178
+ <directory>lib/arjdbc/jdbc</directory>
179
+ <includes>
180
+ <include>adapter_java.jar</include>
181
+ </includes>
182
+ </fileset>
183
+ <!--
184
+ <fileset>
185
+ <directory>target</directory>
186
+ <includes>
187
+ <include>*</include>
188
+ </includes>
189
+ </fileset>-->
190
+ </filesets>
191
+ </configuration>
192
+ </plugin>
193
+
194
+ <plugin>
195
+ <groupId>org.codehaus.mojo</groupId>
196
+ <artifactId>exec-maven-plugin</artifactId>
197
+ <version>1.3.2</version>
198
+ <executions>
199
+ <execution>
200
+ <id>invoker-generator</id>
201
+ <phase>process-classes</phase>
202
+ <goals>
203
+ <goal>exec</goal>
204
+ </goals>
205
+ <configuration>
206
+ <executable>java</executable>
207
+ <classpathScope>compile</classpathScope>
208
+ <arguments>
209
+ <argument>-Djruby.bytecode.version=${compiler.target}</argument>
210
+ <argument>-classpath</argument>
211
+ <classpath />
212
+ <argument>org.jruby.anno.InvokerGenerator</argument>
213
+ <!-- NOTE: needs to be "${basedir}/target/generated-sources/..." -->
214
+ <argument>${gen.sources}/annotated_classes.txt</argument>
215
+ <argument>${project.build.outputDirectory}</argument>
216
+ </arguments>
217
+ </configuration>
218
+ </execution>
219
+ </executions>
220
+ </plugin>
221
+
222
+ <plugin>
223
+ <groupId>org.codehaus.mojo</groupId>
224
+ <artifactId>build-helper-maven-plugin</artifactId>
225
+ <version>1.9</version>
226
+ <executions>
227
+ <execution>
228
+ <!--<id>add-populators</id>-->
229
+ <phase>process-classes</phase>
230
+ <goals>
231
+ <goal>add-source</goal>
232
+ </goals>
233
+ <configuration>
234
+ <sources>
235
+ <source>${gen.sources}</source>
236
+ </sources>
237
+ </configuration>
238
+ </execution>
239
+ </executions>
240
+ </plugin>
241
+
242
+ <plugin>
243
+ <artifactId>maven-compiler-plugin</artifactId>
244
+ <version>3.1</version>
245
+ <configuration>
246
+ <source>${compiler.source}</source>
247
+ <target>${compiler.target}</target>
248
+ <encoding>UTF-8</encoding>
249
+ <debug>true</debug>
250
+ <showWarnings>true</showWarnings>
251
+ <showDeprecation>true</showDeprecation>
252
+ <!--<useIncrementalCompilation>false</useIncrementalCompilation>-->
253
+ <generatedSourcesDirectory>${gen.sources}</generatedSourcesDirectory>
254
+ <!-- TODO: no go from JRuby due ... if qualifiedName.contains("org$jruby") -->
255
+ <annotationProcessors>
256
+ <annotationProcessor>org.jruby.anno.AnnotationBinder</annotationProcessor>
257
+ </annotationProcessors>
258
+ </configuration>
259
+ <executions>
260
+ <execution>
261
+ <id>compile-populators</id>
262
+ <phase>process-classes</phase>
263
+ <goals>
264
+ <goal>compile</goal>
265
+ </goals>
266
+ <configuration>
267
+ <includes>
268
+ <include>org/jruby/gen/**/*.java</include>
269
+ </includes>
270
+ <showDeprecation>false</showDeprecation>
271
+ <compilerArgs>
272
+ <compilerArg>-XDignore.symbol.file=true</compilerArg>
273
+ </compilerArgs>
274
+ <optimize>true</optimize>
275
+ <proc>none</proc>
276
+ </configuration>
277
+ </execution>
278
+ </executions>
279
+ </plugin>
280
+
281
+ </plugins>
282
+
283
+ </build>
284
+
285
+ </project>