File tree Expand file tree Collapse file tree 6 files changed +28
-28
lines changed
mybatis-generator-maven-plugin/src/main/java/org/mybatis/generator/maven
mybatis-generator-systests-domtests/src/main/java/mbg/domtest
org.mybatis.generator.eclipse.site
org.mybatis.generator.eclipse.test.utilities/src/org/mybatis/generator/eclipse/test Expand file tree Collapse file tree 6 files changed +28
-28
lines changed Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ public void executeScript() throws MojoExecutionException {
79
79
80
80
try {
81
81
Class <?> driverClass = ObjectFactory .externalClassForName (driver );
82
- Driver theDriver = (Driver ) driverClass .newInstance ();
82
+ Driver theDriver = (Driver ) driverClass .getDeclaredConstructor (). newInstance ();
83
83
84
84
Properties properties = new Properties ();
85
85
if (userid != null ) {
@@ -114,10 +114,8 @@ public void executeScript() throws MojoExecutionException {
114
114
throw new MojoExecutionException ("SqlException: " + e .getMessage (), e );
115
115
} catch (IOException e ) {
116
116
throw new MojoExecutionException ("IOException: " + e .getMessage (), e );
117
- } catch (InstantiationException e ) {
118
- throw new MojoExecutionException ("InstantiationException: " + e .getMessage ());
119
- } catch (IllegalAccessException e ) {
120
- throw new MojoExecutionException ("IllegalAccessException: " + e .getMessage ());
117
+ } catch (ReflectiveOperationException e ) {
118
+ throw new MojoExecutionException ("ReflectiveOperationException: " + e .getMessage ());
121
119
} finally {
122
120
closeConnection (connection );
123
121
}
Original file line number Diff line number Diff line change @@ -48,20 +48,20 @@ public static void main (String[] args) {
48
48
}
49
49
}
50
50
51
- private void gatherGenerators (List <CompilationUnitGenerator > generators ) throws InstantiationException , IllegalAccessException {
51
+ private void gatherGenerators (List <CompilationUnitGenerator > generators ) throws ReflectiveOperationException {
52
52
Reflections reflections = new Reflections ("mbg.domtest.generators" );
53
53
Set <Class <? extends CompilationUnitGenerator >> classes = reflections .getSubTypesOf (CompilationUnitGenerator .class );
54
54
55
55
for (Class <? extends CompilationUnitGenerator > clazz : classes ) {
56
56
if (clazz .getAnnotation (IgnoreDomTest .class ) == null ) {
57
- generators .add (clazz .newInstance ());
57
+ generators .add (clazz .getDeclaredConstructor (). newInstance ());
58
58
} else {
59
59
System .out .println ("Generator " + clazz .getName () + " ignored" );
60
60
}
61
61
}
62
62
}
63
63
64
- private void run (File outputDirectory ) throws IOException , InstantiationException , IllegalAccessException {
64
+ private void run (File outputDirectory ) throws IOException , ReflectiveOperationException {
65
65
setupOutputDirectry (outputDirectory );
66
66
67
67
List <CompilationUnitGenerator > generators = new ArrayList <>();
Original file line number Diff line number Diff line change 111
111
<type >eclipse-feature</type >
112
112
</dependency >
113
113
<dependency >
114
- <artifactId >org.eclipse.equinox.ds </artifactId >
115
- <type >eclipse-plugin </type >
114
+ <artifactId >org.eclipse.equinox.p2.discovery.feature </artifactId >
115
+ <type >eclipse-feature </type >
116
116
</dependency >
117
117
</dependencies >
118
- <applicationsArgs >
119
- <applicationsArg >-application org.eclipse.ant.core.antRunner</applicationsArg >
120
- <applicationsArg >-buildfile updateP2CompositeRepo.ant</applicationsArg >
121
- <applicationsArg >-Dproject.artifactId=${project.artifactId} </applicationsArg >
122
- <applicationsArg >-DqualifiedVersion=${qualifiedVersion} </applicationsArg >
123
- <applicationsArg >-Dproject.build.directory=${project.build.directory} </applicationsArg >
124
- <applicationsArg >-Dp2.repo.base.directory=${p2.repo.base.directory} </applicationsArg >
125
- </applicationsArgs >
118
+ <applicationArgs >
119
+ <arg >-application</arg >
120
+ <arg >org.eclipse.ant.core.antRunner</arg >
121
+ <arg >-buildfile</arg >
122
+ <arg >updateP2CompositeRepo.ant</arg >
123
+ </applicationArgs >
124
+ <jvmArgs >
125
+ <arg >-Dproject.artifactId=${project.artifactId} </arg >
126
+ <arg >-DqualifiedVersion=${qualifiedVersion} </arg >
127
+ <arg >-Dproject.build.directory=${project.build.directory} </arg >
128
+ <arg >-Dp2.repo.base.directory=${p2.repo.base.directory} </arg >
129
+ </jvmArgs >
126
130
</configuration >
127
131
<executions >
128
132
<execution >
Original file line number Diff line number Diff line change 31
31
by pulling a current copy from jfrog)
32
32
33
33
-->
34
- <project name =" project" default =" updateRepo" >
34
+ <project name =" project" default =" writeScript" >
35
+ <condition property =" isUnix" >
36
+ <os family =" unix" />
37
+ </condition >
38
+
35
39
<target name =" init" >
36
40
<property name =" repo.drops.dir" value =" ${p2.repo.base.directory}/drops" />
37
41
<property name =" repo.zipped.dir" value =" ${p2.repo.base.directory}/zipped" />
78
82
<include name =" *.xml" />
79
83
</fileset >
80
84
</replaceregexp >
85
+ </target >
81
86
87
+ <target name =" writeScript" depends =" updateRepo" if =" isUnix" >
82
88
<!-- setup the shebang and variables -->
83
89
<echo message =" #!/bin/bash${line.separator}" file =" ${p2.repo.base.directory}/jfrogUpload.sh" />
84
90
<echo message =" USER=xxxx${line.separator}" file =" ${p2.repo.base.directory}/jfrogUpload.sh" append =" true" />
102
108
103
109
<!-- make it executable -->
104
110
<chmod perm =" +x" file =" ${p2.repo.base.directory}/jfrogUpload.sh" />
105
-
106
111
</target >
107
112
</project >
Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ public static String getResourceAsString(InputStream resource) throws IOExceptio
60
60
61
61
public static <T > T newInstance (Class <? extends T > type ) {
62
62
try {
63
- return type .newInstance ();
63
+ return type .getDeclaredConstructor (). newInstance ();
64
64
} catch (Exception e ) {
65
65
throw new CantCreateInstanceException ("error creating instance of class " + type .getName (), e );
66
66
}
Original file line number Diff line number Diff line change 190
190
<artifactId >target-platform-configuration</artifactId >
191
191
<version >${tycho-version} </version >
192
192
<configuration >
193
- <target >
194
- <artifact >
195
- <groupId >org.mybatis.generator</groupId >
196
- <artifactId >org.mybatis.generator.eclipse.target.platform</artifactId >
197
- <version >${project.version} </version >
198
- </artifact >
199
- </target >
200
193
<target >
201
194
<file >../releng/2021-06.target</file >
202
195
</target >
You can’t perform that action at this time.
0 commit comments