<html>
<head>
    <base href="https://docs.jboss.org/author">
            <link rel="stylesheet" href="/author/s/en/2172/19/5/_/styles/combined.css?spaceKey=TEIID&amp;forWysiwyg=true" type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://docs.jboss.org/author/display/TEIID/Archetype+Template+Translator+Project">Archetype Template Translator Project</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://docs.jboss.org/author/display/~shawkins">Steven Hawkins</a>
    </h4>
        <br/>
                         <h4>Changes (0)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-snipped" >...<br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <p>One way to start developing a custom translator is to create a project using the Teiid archetype template.   When the project is created from the template, it will contain the essential classes (i.e., ExecutionFactory) and resources for you to begin adding your custom logic.  Additionally, the maven dependencies are defined in the pom.xml so that you can begin compiling the classes.  </p>

<p>To create your custom translator project, you can run the following from the command line:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Confluence; brush: java; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">
mvn archetype:generate                                 \
  -DarchetypeGroupId=org.jboss.teiid.arche-types               \
  -DarchetypeArtifactId=translator-archetype          \
  -DarchetypeVersion=8.6.0               \
  -DgroupId=${groupId}                                   \
  -DartifactId=translator-${translator-name}        \
  -Dpackage=org.teiid.translator.${translator-name}    \
  -Dversion=8.7.0.Alpha2-SNAPSHOT    \
  -Dtranslator-name=${translator-name}   
</pre>
</div></div>

<p>where:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Confluence; brush: java; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">
  -DarchetypeGroupId    -  is the group ID for the arche type to use to generate
  -DarchetypeArtifactId -  is the artifact ID for the arche type to use to generate
  -DarchetypeVersion        -  is the version for the arche type to use to generate
  -DgroupId                    -  (user defined) group ID for the new translator project pom.xml
  -DartifactId                -  (user defined) artifact ID for the new translator project pom.xml
  -Dpackage                    -  (user defined) the package structure where the java and resource files will be created
  -Dversion                    -  (user defined) the version for the new translator project pom.xml
  -Dtranslator-name        -  (user defined) the name (type) of the new translator project, used to create the java class names
</pre>
</div></div>

<p>The following is an example:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Confluence; brush: java; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">
mvn archetype:generate                                  \
  -DarchetypeGroupId=org.jboss.teiid.arche-types               \
  -DarchetypeArtifactId=translator-archetype          \
  -DarchetypeVersion=8.6.0           \
  -DgroupId=org.jboss.teiid.connector          \
  -DartifactId=translator-myType        \
  -Dpackage=org.teiid.translator.myType    \
  -Dversion=8.7.0.Alpha2-SNAPSHOT        \
  -Dtranslator-name=MyType  
</pre>
</div></div>

<p>When executed, you will be asked to confirm the properties</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Confluence; brush: java; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">
Confirm properties configuration:
groupId: org.jboss.teiid.connector
artifactId: translator-myType
version: 8.7.0.Alpha2-SNAPSHOT
package: org.teiid.translator.myType
translator-name: MyType
 Y: : 
</pre>
</div></div>

<p>type Y (yes) and press enter, and the creation of the translator project will be done</p>

<p>Upon creation, a directory based on the <em><b>artifactId</b></em> will be created, that will contain the project.  'cd' into that directory and execute a test build to confirm the project was created correctly:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Confluence; brush: java; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;"> mvn clean install</pre>
</div></div>

<p>This should build successfully, and now you are ready to start adding your custom code.</p>
    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;" class="grey">
                        <a href="https://docs.jboss.org/author/users/removespacenotification.action?spaceKey=TEIID">Stop watching space</a>
            <span style="padding: 0px 5px;">|</span>
                <a href="https://docs.jboss.org/author/users/editmyemailsettings.action">Change email notification preferences</a>
</div>
        <a href="https://docs.jboss.org/author/display/TEIID/Archetype+Template+Translator+Project">View Online</a>
        |
        <a href="https://docs.jboss.org/author/pages/diffpagesbyversion.action?pageId=77234286&revisedVersion=2&originalVersion=1">View Changes</a>
                |
        <a href="https://docs.jboss.org/author/display/TEIID/Archetype+Template+Translator+Project?showComments=true&amp;showCommentArea=true#addcomment">Add Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>