Book a Demo

Author Topic: Generate Package Source Code  (Read 4054 times)

MtxCracow

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Generate Package Source Code
« on: August 05, 2015, 12:56:05 am »
What do I wrong in package source code generating when the code goes to directory C:\temp\org.myproject.training\HelloWorld.java instead of C:\temp\org\myproject\training\HelloWorld.java with package "org.myproject.training" in HelloWorld.java class? Enterprise Architect creates one directory with name "org.myproject.training" instead of creating directories structure.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Generate Package Source Code
« Reply #1 on: August 05, 2015, 08:43:25 am »
The problem is a single package called "org.myproject.training" instead of three nested packages "org", "myproject" and "training".

MtxCracow

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Generate Package Source Code
« Reply #2 on: August 05, 2015, 05:08:00 pm »
Quote
The problem is a single package called "org.myproject.training" instead of three nested packages "org", "myproject" and "training".


Thanks. It works better but I have next problem. I created package structure org/myproject/training and generete the code to my c:\temp\application\src\main\java directory. I check "Include all child Packages" and "Override code". The java files are generated to "c:\temp\application\src\main\java\org\myproject\training\*.java" and it is great. Now I open my generated classes and I can see the problem with package name. In the first line of source code I can see "package org.myproject;" instead of "package org.myproject.training". It seems the generator losts the last part of package path. In my IDE I got "Incorrect package" error".


Should I do sth with Class Diagram "functions" which is located in "functions" package?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Generate Package Source Code
« Reply #3 on: August 05, 2015, 07:24:52 pm »
Absolutely not my area but I'd have a look at the name space root (somewhere in the context of the package).

q.