<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>I think this involves doing what's defined in&nbsp;<a href="https://docs.jboss.org/author/display/WFLY8/JPA+Reference+Guide">https://docs.jboss.org/author/display/WFLY8/JPA+Reference+Guide</a>&nbsp;</div><div>We should be able to do the necessary changes in the project, however I think we may need to point users to this documentation to handle the changes in the AS itself (or ask Forge to do that itself)<br><br><br></div><div><br>Em 27/11/2014, às 19:58, Ivan St. Ivanov &lt;<a href="mailto:ivan.st.ivanov@gmail.com">ivan.st.ivanov@gmail.com</a>&gt; escreveu:<br><br></div><blockquote type="cite"><div><div dir="ltr">Thanks George!<div><br></div><div>So I have attached the test. You can put it in the javaee addon, under the test folder. It's located in the&nbsp;org.jboss.forge.addon.javaee.jpa.ui.setup package. After you run it, look for the 'dependencies = ' string in the output. I've set it up to use EclipseLink on Wildfly container. I suppose it is not going to work with the JPA API dependency only, is it?</div><div><br></div><div>Cheers,</div><div>Ivan</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 27, 2014 at 11:35 PM, George Gastaldi <span dir="ltr">&lt;<a href="mailto:ggastald@redhat.com" target="_blank">ggastald@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div>Try doing project.getFacet(MavenFacet.class).getModel() and you should have the pom.xml model available<br><br><br></div><div><br>Em 27/11/2014, às 19:28, Ivan St. Ivanov &lt;<a href="mailto:ivan.st.ivanov@gmail.com" target="_blank">ivan.st.ivanov@gmail.com</a>&gt; escreveu:<br><br></div><div><div class="h5"><blockquote type="cite"><div><div dir="ltr">So I was preparing the test. I wanted to create a test case that prints the content of the pom.xml after it invokes the setup command. Here is how I prepare everything:<div><br></div><div><pre style="color:rgb(0,0,0);font-family:Inconsolata;background-color:rgb(255,255,230)"><font size="4"><span style="color:rgb(0,128,64)">@Inject<br></span><span style="color:rgb(0,0,160);font-weight:bold">private </span><span style="color:rgb(128,0,0)">UITestHarness </span><span style="color:rgb(86,104,116)">testHarness</span>;<br><br><span style="color:rgb(0,128,64)">@Inject<br></span><span style="color:rgb(0,0,160);font-weight:bold">private </span><span style="color:rgb(24,170,222)">ProjectFactory </span><span style="color:rgb(86,104,116)">projectFactory</span>;<br><br><span style="color:rgb(0,128,64)">@Inject<br></span><span style="color:rgb(0,0,160);font-weight:bold">private </span><span style="color:rgb(128,0,0)">EclipseLinkProvider </span><span style="color:rgb(86,104,116)">provider</span>;<br><br><span style="color:rgb(0,128,64)">@Inject<br></span><span style="color:rgb(0,0,160);font-weight:bold">private </span><span style="color:rgb(128,0,0)">WildflyContainer </span><span style="color:rgb(86,104,116)">wildflyContainer</span>;<br></font></pre></div><div><pre style="color:rgb(0,0,0);font-family:Inconsolata;background-color:rgb(255,255,230)"><font size="4"><span style="color:rgb(0,128,64)">@Test<br></span><span style="color:rgb(0,0,160);font-weight:bold">public void </span><span style="color:rgb(68,68,68);font-weight:bold">testPomXmlContent</span><span style="color:rgb(68,68,68)">() </span><span style="color:rgb(0,0,160);font-weight:bold">throws </span><span style="color:rgb(128,0,0)">Exception<br></span><span style="color:rgb(68,68,68)">{<br></span><span style="color:rgb(68,68,68)">   </span><span style="color:rgb(24,170,222)">Project </span>project = <span style="color:rgb(86,104,116)">projectFactory</span>.createTempProject<span style="color:rgb(68,68,68)">()</span>;<br>   <span style="color:rgb(24,170,222)">WizardCommandController </span>tester = <span style="color:rgb(86,104,116)">testHarness</span>.createWizardController<span style="color:rgb(68,68,68)">(</span><span style="color:rgb(24,170,222)">JPASetupWizard</span>.<span style="color:rgb(0,0,160);font-weight:bold">class</span>,<br>            project.getRoot<span style="color:rgb(68,68,68)">())</span>;<br><br>   tester.initialize<span style="color:rgb(68,68,68)">()</span>;<br><br>   <span style="color:rgb(56,181,181)">// Setting UI values<br></span><span style="color:rgb(56,181,181)">   </span>tester.setValueFor<span style="color:rgb(68,68,68)">(</span><span style="color:rgb(1,138,138)">"jpaVersion"</span>, <span style="color:rgb(1,138,138)">"2.1"</span><span style="color:rgb(68,68,68)">)</span>;<br>   tester.setValueFor<span style="color:rgb(68,68,68)">(</span><span style="color:rgb(1,138,138)">"provider"</span>, <span style="color:rgb(86,104,116)">provider</span><span style="color:rgb(68,68,68)">)</span>;<br>   tester.setValueFor<span style="color:rgb(68,68,68)">(</span><span style="color:rgb(1,138,138)">"container"</span>, <span style="color:rgb(86,104,116)">wildflyContainer</span><span style="color:rgb(68,68,68)">)</span>;<br><br>   tester.next<span style="color:rgb(68,68,68)">()</span>.initialize<span style="color:rgb(68,68,68)">()</span>;<br><br>   <span style="color:rgb(128,0,0)">Assert</span>.<span style="color:rgb(0,79,39);font-weight:bold">assertTrue</span><span style="color:rgb(68,68,68)">(</span>tester.isValid<span style="color:rgb(68,68,68)">())</span>;<br>   tester.execute<span style="color:rgb(68,68,68)">()</span>;<br></font><span style="color:rgb(68,68,68)"><font size="4">}</font><span style="font-size:22pt"><br></span></span></pre></div><div>And now I want to somehow get the dependency facet or some other facet and print the content of pom.xml (or the dependencies). How can I do that?<br></div><div><br></div><div>Thanks,</div><div>Ivan</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 26, 2014 at 10:56 AM, Ivan St. Ivanov <span dir="ltr">&lt;<a href="mailto:ivan.st.ivanov@gmail.com" target="_blank">ivan.st.ivanov@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi George,<div><br></div><div>I can work on providing those tests and crafting a solution for the case when the JPA provider is not packed with the target container. Will jump in the IRC channel this week and discuss in more details with you.</div><div><br></div><div>I see that the JavaEEDefaultContainer implements methods that imply JTA data source. No matter that SAP HCP is built on top of Tomcat, we have our own persistence service, which provides JTA data source. So, generally you are right that I should not extend that abstract class, but in this concrete case with HANA Cloud Platform it is the right thing to do.</div><div><br></div><div>Cheers,</div><div>Ivan</div></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 24, 2014 at 3:26 PM, George Gastaldi <span dir="ltr">&lt;<a href="mailto:ggastald@redhat.com" target="_blank">ggastald@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    <div>Right, I think this makes sense. We might need to add more
      tests under these conditions. This area sure needs a bit of
      improvement.<br>
    </div>
    <div><br>
    </div>
    <div>It looks like SAPHanaCloudPlatformContainer shouldn't be
      extending JavaEEDefaultContainer, afaik that is only meant to be
      extended by implementations of JavaEE servers (TomEE, Wildfly,
      EAP, Weblogic, GlassFish).<br>
      <br>
    </div><div><div>
    <div>On 11/24/2014 10:39 AM, Ivan St. Ivanov
      wrote:<br>
    </div>
    <blockquote type="cite">
      <div dir="ltr">Hi George,
        <div><br>
        </div>
        <div>I was thinking of something general in the area of tying up
          somehow&nbsp;(not coupling)&nbsp;the JPA containers and providers. The
          containers know very well whether they have JPA support at all
          or, if they have, what is their native provider (e.g.
          Hibernate for Wildfly). So IMHO whenever the user specifies a
          container with a provider the setup command should do the
          following:</div>
        <div><br>
        </div>
        <div>1) Validate whether this combination is possible at all
          (e.g. not sure what will happen if we specify Wildfly with
          EclipseLink, at the moment it fails)</div>
        <div>2) If the current container does not have built-in support
          for JPA (i.e. it is based on Tomcat, like SAP HCP) or it
          supports natively different JPA provider, then add the
          listDependencies() content to the pom.xml in the appropriate
          scope</div>
        <div><br>
        </div>
        <div>Something like this. Not sure though how was this whole
          thing intended to work: do we need to fully decouple providers
          and containers in the JPA addon?</div>
        <div><br>
        </div>
        <div>Cheers,</div>
        <div>Ivan</div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Mon, Nov 24, 2014 at 1:11 PM, George
          Gastaldi <span dir="ltr">&lt;<a href="mailto:ggastald@redhat.com" target="_blank">ggastald@redhat.com</a>&gt;</span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Ivan,<br>
            <br>
            Yes, that's the idea. It's strange that this method is not
            being called. I'll investigate further.<br>
            <br>
            Another solution would be to create a new Forge's
            PersistenceProvider implementation in a separate addon and
            select that instead when running Jpa:Setup.<br>
            <br>
            Best Regards,<br>
            <br>
            George Gastaldi<br>
            <br>
            <br>
            &gt; Em 24/11/2014, às 08:25, Ivan St. Ivanov &lt;<a href="mailto:ivan.st.ivanov@gmail.com" target="_blank">ivan.st.ivanov@gmail.com</a>&gt;
            escreveu:<br>
            <div>
              <div>&gt;<br>
                &gt; Hi everybody,<br>
                &gt;<br>
                &gt; I have the following usecase. I am developing a web
                application that uses JPA with Eclipse Link and will be
                deployed on SAP HANA Cloud Platform (think of it as
                Tomcat). Which means that I need the Eclipse Link
                dependencies in the pom.xml in the compile scope. When I
                generated the project and set up Eclipse Link, I got
                this in the pom:<br>
                &gt;<br>
                &gt;&nbsp; &nbsp;&lt;dependencies&gt;<br>
                &gt;&nbsp; &nbsp; &nbsp;&lt;dependency&gt;<br>
                &gt;&nbsp; &nbsp; &nbsp;
                &nbsp;&lt;groupId&gt;org.hibernate.javax.persistence&lt;/groupId&gt;<br>
                &gt;&nbsp; &nbsp; &nbsp;
                &nbsp;&lt;artifactId&gt;hibernate-jpa-2.0-api&lt;/artifactId&gt;<br>
                &gt;&nbsp; &nbsp; &nbsp; &nbsp;&lt;scope&gt;provided&lt;/scope&gt;<br>
                &gt;&nbsp; &nbsp; &nbsp;&lt;/dependency&gt;<br>
                &gt;&nbsp; &nbsp;&lt;/dependencies&gt;<br>
                &gt;<br>
                &gt; However, I rather need something like:<br>
                &gt;<br>
                &gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;dependency&gt;<br>
                &gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                &nbsp;&lt;groupId&gt;org.eclipse.persistence&lt;/groupId&gt;<br>
                &gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                &nbsp;&lt;artifactId&gt;javax.persistence&lt;/artifactId&gt;<br>
                &gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/dependency&gt;<br>
                &gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;dependency&gt;<br>
                &gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                &nbsp;&lt;groupId&gt;org.eclipse.persistence&lt;/groupId&gt;<br>
                &gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                &nbsp;&lt;artifactId&gt;eclipselink&lt;/artifactId&gt;<br>
                &gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/dependency&gt;<br>
                &gt;<br>
                &gt; I see in
                org.jboss.forge.addon.javaee.jpa.providers.EclipseLinkProvider:<br>
                &gt;<br>
                &gt;<br>
                &gt;&nbsp; &nbsp; @Override<br>
                &gt;&nbsp; &nbsp; public List&lt;Dependency&gt; listDependencies()<br>
                &gt;&nbsp; &nbsp; {<br>
                &gt;&nbsp; &nbsp; &nbsp; &nbsp;return Arrays.asList((Dependency)
                DependencyBuilder.create("org.eclipse.persistence:eclipselink"),<br>
                &gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (Dependency)
                DependencyBuilder.create("org.eclipse.persistence:javax.persistence"));<br>
                &gt;&nbsp; &nbsp; }<br>
                &gt;<br>
                &gt; So we already have functionality on provider level
                that knows which are the dependencies. However, it seems
                that this method is not called. What was the idea of
                having it? How can I make sure that the dependencies are
                correctly configured?<br>
                &gt;<br>
                &gt; I think that it has something to do with the type
                of the container: if it is SAP HANA Cloud Platform, then
                find the dependencies for the JPA provider and add them
                in the default scope of the pom.xml instead of adding
                hibernate-jpa-2.0-api. If it is a full fledged
                application server, then we can go with the API in
                provided scope. Something like this.<br>
                &gt;<br>
                &gt; WDYT?<br>
                &gt;<br>
                &gt; Thanks,<br>
                &gt; Ivan<br>
              </div>
            </div>
            &gt; _______________________________________________<br>
            &gt; forge-dev mailing list<br>
            &gt; <a href="mailto:forge-dev@lists.jboss.org" target="_blank">forge-dev@lists.jboss.org</a><br>
            &gt; <a href="https://lists.jboss.org/mailman/listinfo/forge-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/forge-dev</a><br>
            <br>
            _______________________________________________<br>
            forge-dev mailing list<br>
            <a href="mailto:forge-dev@lists.jboss.org" target="_blank">forge-dev@lists.jboss.org</a><br>
            <a href="https://lists.jboss.org/mailman/listinfo/forge-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/forge-dev</a></blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset></fieldset>
      <br>
      <pre>_______________________________________________
forge-dev mailing list
<a href="mailto:forge-dev@lists.jboss.org" target="_blank">forge-dev@lists.jboss.org</a>
<a href="https://lists.jboss.org/mailman/listinfo/forge-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/forge-dev</a></pre>
    </blockquote>
    <br>
  </div></div></div>

<br>_______________________________________________<br>
forge-dev mailing list<br>
<a href="mailto:forge-dev@lists.jboss.org" target="_blank">forge-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/forge-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/forge-dev</a><br></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>forge-dev mailing list</span><br><span><a href="mailto:forge-dev@lists.jboss.org" target="_blank">forge-dev@lists.jboss.org</a></span><br><span><a href="https://lists.jboss.org/mailman/listinfo/forge-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/forge-dev</a></span></div></blockquote></div></div></div><br>_______________________________________________<br>
forge-dev mailing list<br>
<a href="mailto:forge-dev@lists.jboss.org">forge-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/forge-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/forge-dev</a><br></blockquote></div><br></div>
</div></blockquote><blockquote type="cite"><div>&lt;JPASetupDifferentProviderTest.java&gt;</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>forge-dev mailing list</span><br><span><a href="mailto:forge-dev@lists.jboss.org">forge-dev@lists.jboss.org</a></span><br><span><a href="https://lists.jboss.org/mailman/listinfo/forge-dev">https://lists.jboss.org/mailman/listinfo/forge-dev</a></span></div></blockquote></body></html>