sqlMapGenerator to place XML files under project/src/main/resources

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

sqlMapGenerator to place XML files under project/src/main/resources

rwfischer
How can I place the generated SqlMap XML files intothe  project/src/main/resources directory (folder)?

When I only specify the project in the generator config file, the XML files are generated under project/src/main/java (like the generated Java files).

When I use a relative path, I get an error that the folder does not exist (despite domain/src/main/resources/xml being there).

<sqlMapGenerator targetPackage="xml.fabric" targetProject="domain/src/main/resources" >
</sqlMapGenerator>
Cannot find source folder domain/src/main/resources
I have not tried an absolute path for targetProject, and for obvious reasons I don't want to.
PS: I am using a Maven plugin to copy the XML files into src/main/resources. That is a work-around, but not ideal.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: sqlMapGenerator to place XML files under project/src/main/resources

Jeff Butler
Please let me know what your project structure is.  Specifically, where is generatorConfig.xml in relation to the other directories?  Also, how are you running the generator - from the command line? the Maven plugin?

Jeff Butler


On Wed, Apr 26, 2017 at 6:22 PM rwfischer <[hidden email]> wrote:
How can I place the generated SqlMap XML files intothe  project/src/main/resources directory (folder)?

When I only specify the project in the generator config file, the XML files are generated under project/src/main/java (like the generated Java files).

When I use a relative path, I get an error that the folder does not exist (despite domain/src/main/resources/xml being there).

<sqlMapGenerator targetPackage="xml.fabric" targetProject="domain/src/main/resources" >
</sqlMapGenerator>
Cannot find source folder domain/src/main/resources
I have not tried an absolute path for targetProject, and for obvious reasons I don't want to.
PS: I am using a Maven plugin to copy the XML files into src/main/resources. That is a work-around, but not ideal.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: sqlMapGenerator to place XML files under project/src/main/resources

rwfischer
+--project
   +--etc
   |  +--generatorConfig.xml
   +--src
      +--main
      |  +--java
      |  |  +--com/enterprise/product
      |  |     +--models
      |  |     |  +--tableModel.java
      |  |     +--mappers
      |  |        +--tableMapper.java
      |  +--resources
      |     +--com/enterprise/product
      |        +--mappers
      |           +--tableMapper.xml
      |           +--mapperConfig.xml
      +--test

It would also be fine to have the run-time XML files directly in the resources directory (without the com/enterprise/product part).

I am running the generator from Eclipse, because we want customizations to be merged in the java files. I would like to run from maven, but for that we need a plugin to merge the java files.

Roger


On Wednesday, April 26, 2017 at 5:39:12 PM UTC-7, Jeff Butler wrote:
Please let me know what your project structure is.  Specifically, where is generatorConfig.xml in relation to the other directories?  Also, how are you running the generator - from the command line? the Maven plugin?

Jeff Butler


On Wed, Apr 26, 2017 at 6:22 PM rwfischer <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="4APeeOwSBAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">rwfi...@...> wrote:
How can I place the generated SqlMap XML files intothe  project/src/main/resources directory (folder)?

When I only specify the project in the generator config file, the XML files are generated under project/src/main/java (like the generated Java files).

When I use a relative path, I get an error that the folder does not exist (despite domain/src/main/resources/xml being there).

<sqlMapGenerator targetPackage="xml.fabric" targetProject="domain/src/main/resources" >
</sqlMapGenerator>
Cannot find source folder domain/src/main/resources
I have not tried an absolute path for targetProject, and for obvious reasons I don't want to.
PS: I am using a Maven plugin to copy the XML files into src/main/resources. That is a work-around, but not ideal.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="4APeeOwSBAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">mybatis-user...@googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: sqlMapGenerator to place XML files under project/src/main/resources

Jeff Butler
Is src/main/resources configured as a source folder in the project?  I can duplicate this if I create the folder structure, but don't setup the eclipse project to have both src/main/java and src/main/resources configured as source folders.

It should look like this:

image.png

Jeff Butler

On Thu, Apr 27, 2017 at 6:00 PM rwfischer <[hidden email]> wrote:
+--project
   +--etc
   |  +--generatorConfig.xml
   +--src
      +--main
      |  +--java
      |  |  +--com/enterprise/product
      |  |     +--models
      |  |     |  +--tableModel.java
      |  |     +--mappers
      |  |        +--tableMapper.java
      |  +--resources
      |     +--com/enterprise/product
      |        +--mappers
      |           +--tableMapper.xml
      |           +--mapperConfig.xml
      +--test

It would also be fine to have the run-time XML files directly in the resources directory (without the com/enterprise/product part).

I am running the generator from Eclipse, because we want customizations to be merged in the java files. I would like to run from maven, but for that we need a plugin to merge the java files.

Roger


On Wednesday, April 26, 2017 at 5:39:12 PM UTC-7, Jeff Butler wrote:
Please let me know what your project structure is.  Specifically, where is generatorConfig.xml in relation to the other directories?  Also, how are you running the generator - from the command line? the Maven plugin?

Jeff Butler


On Wed, Apr 26, 2017 at 6:22 PM rwfischer <[hidden email]> wrote:
How can I place the generated SqlMap XML files intothe  project/src/main/resources directory (folder)?

When I only specify the project in the generator config file, the XML files are generated under project/src/main/java (like the generated Java files).

When I use a relative path, I get an error that the folder does not exist (despite domain/src/main/resources/xml being there).

<sqlMapGenerator targetPackage="xml.fabric" targetProject="domain/src/main/resources" >
</sqlMapGenerator>
Cannot find source folder domain/src/main/resources
I have not tried an absolute path for targetProject, and for obvious reasons I don't want to.
PS: I am using a Maven plugin to copy the XML files into src/main/resources. That is a work-around, but not ideal.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: sqlMapGenerator to place XML files under project/src/main/resources

rwfischer
Ah, that was the problem. I did not see that in my project resources was not identified as a source folder. It now puts the Mapper XML into the src\main\resources folder.

However, there still is a minor annoyance: When generating from Eclipse, I need to include the project in the targetProject, but when generating from maven, I must not have the project.

Eclipse: targetProject="domain/src/main/resources"
Maven: targetProject="src/main/resources"

This applies for both resources and java.

Thanks for your help, Jeff.

Roger



On Thursday, April 27, 2017 at 5:43:24 PM UTC-7, Jeff Butler wrote:
Is src/main/resources configured as a source folder in the project?  I can duplicate this if I create the folder structure, but don't setup the eclipse project to have both src/main/java and src/main/resources configured as source folders.

It should look like this:

image.png

Jeff Butler

On Thu, Apr 27, 2017 at 6:00 PM rwfischer <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="gnZMKFqZBQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">rwfi...@...> wrote:
+--project
   +--etc
   |  +--generatorConfig.xml
   +--src
      +--main
      |  +--java
      |  |  +--com/enterprise/product
      |  |     +--models
      |  |     |  +--tableModel.java
      |  |     +--mappers
      |  |        +--tableMapper.java
      |  +--resources
      |     +--com/enterprise/product
      |        +--mappers
      |           +--tableMapper.xml
      |           +--mapperConfig.xml
      +--test

It would also be fine to have the run-time XML files directly in the resources directory (without the com/enterprise/product part).

I am running the generator from Eclipse, because we want customizations to be merged in the java files. I would like to run from maven, but for that we need a plugin to merge the java files.

Roger


On Wednesday, April 26, 2017 at 5:39:12 PM UTC-7, Jeff Butler wrote:
Please let me know what your project structure is.  Specifically, where is generatorConfig.xml in relation to the other directories?  Also, how are you running the generator - from the command line? the Maven plugin?

Jeff Butler


On Wed, Apr 26, 2017 at 6:22 PM rwfischer <[hidden email]> wrote:
How can I place the generated SqlMap XML files intothe  project/src/main/resources directory (folder)?

When I only specify the project in the generator config file, the XML files are generated under project/src/main/java (like the generated Java files).

When I use a relative path, I get an error that the folder does not exist (despite domain/src/main/resources/xml being there).

<sqlMapGenerator targetPackage="xml.fabric" targetProject="domain/src/main/resources" >
</sqlMapGenerator>
Cannot find source folder domain/src/main/resources
I have not tried an absolute path for targetProject, and for obvious reasons I don't want to.
PS: I am using a Maven plugin to copy the XML files into src/main/resources. That is a work-around, but not ideal.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mybatis-user...@googlegroups.com.

For more options, visit <a href="https://groups.google.com/d/optout" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="gnZMKFqZBQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">mybatis-user...@googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.