[jbosstools-dev] [jdf-dev] JDF Quickstarts in JBoss Central?
Fred Bricon
fbricon at redhat.com
Thu Oct 11 11:59:30 EDT 2012
Le 11/10/2012 17:54, Pete Muir a écrit :
> On 11 Oct 2012, at 16:48, Fred Bricon wrote:
>
>> Le 10/10/2012 04:35, Pete Muir a écrit :
>>> On 9 Oct 2012, at 09:45, Sande Gilda wrote:
>>>
>>>> On 10/09/2012 12:32 PM, Max Rydahl Andersen wrote:
>>>>>>>> I do have one question. You say "However our own JBoss AS server adapter ignores the WTP project context root and bases its deployment on the project name, leading to 404s as seen in the video below." Is this a bug with JBoss or something else? Is there a JIRA or Bugzilla for this?
>>>>>>>>
>>>>>>> See https://issues.jboss.org/browse/JBIDE-473
>>>>>> I interpret this to mean there is no intent to fix the issue. Am I reading it correctly? ;)
>>>>> not really - problem is that jboss-web.xml is not a reliable source to get it from since it depends on how/where its deployed.
>>>>>
>>>>> But the quickstarts could for now add:
>>>>>
>>>>> <m2eclipse.wtp.contextRoot>jboss-as-whatever</m2eclipse.wtp.contextRoot>
>>>>>
>>>>> and m2e would be able to adjust it afaik.
>>>> Is this added to the jboss-web.xml file? Very few of the quickstarts
>>>> have a jboss-web.xml file.
>>>>
>>>>> I'm surprised they ever were renamed with jboss-web.xml since that would break its usage instantly from tools...or the "test from jboss tools" was missed when doing that fix ;(
>>>> Pete, correct me if I'm wrong, but I believe this tag
>>>> <finalName>jboss-as-QUICKSTART_NAME></finalName> in the pom.xml file is
>>>> how the context is set.
>>> Right.
>>>
>>> There is generally no convention that the maven artifact id must be the same as the directory name of the project must be the same as the context root. This is something that Eclipse/JBoss Tools/m2e adds as a requirement.
>>>
>>> To date, we've followed the rule that the artifact id (which translates to project name in eclipse) must be the same as the context root, but that the directory name can be different.
>>>
>>> This seems to work for me in Eclipse/m2e/JBoss Tools, and I don't really want to change all quickstart directory names, it's going to make them harder to explore.
>>>
>>> Can we check what the actual problem is here?
>> When the project you import is directly located in your workspace folder, the project name in eclipse must match the folder name. This is a limitation in Eclipse. So when we import quickstarts in the workspace (the default behaviour), eclipse uses the folder name, not the artifact id
>>
>> The context root is set by m2e-wtp according to the maven rules. WTP uses it to open a browser when it receives the signal the app deployment is complete. However, the AS server adapter in JBT does not respect the context root as declared in the project, deploys it using the project name in the workspace instead. This mismatch between war file and context root leads to a 404.
>>
>> Easiest/cheapest solution here (by far) is to add a <finalName> in the pom.xmls that matches the folder name. Leads to shorter context name, leads to less typing, leads to developer happiness.
> Except that this will break the maven import.
Why?
>
>>>>> /max
>>>>>
>>>>>>>> Pete, correct me if I'm wrong, but I believe the context root for the quickstarts was prefixed by jboss-as to make them unique and prevent them from overwriting existing deployments. for example "helloworld". It would be nice if the quickstarts worked the same way in JDBS as they do deployed in command line.
>>>>>>>>
>>>>>>> renaming the module directories to include the jboss-as prefix would actually fix the problem.
>>>>>>>
>>>>>> Yes, it would. That, or losing the jboss-as prefix.
>>>>>>>> On 10/09/2012 11:14 AM, Fred Bricon wrote:
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> we need to clean up the project examples in JBoss Tools 4.0/JBDS 6.0 (as part of https://issues.jboss.org/browse/JBIDE-12554).
>>>>>>>>> So, my idea was to replace all the old examples with the quickstarts from https://github.com/jboss-jdf/jboss-as-quickstart
>>>>>>>>>
>>>>>>>>> Since the quickstarts are not available as standalone zips, for consumption in JBT/JBDS, I created a script (https://github.com/fbricon/jboss-as-quickstart/commit/cb1a0638b352434c48c7ecb6de20ed514e0c31fb) that does that, and it also generates a project example stub we can use almost directly in JBT.
>>>>>>>>>
>>>>>>>>> D:\Dev\GitHub\jboss-as-quickstart>mvn groovy:execute -N -Pzip-modules,requires-postgres,complex-dependencies,requires-full,requires-xts
>>>>>>>>> [INFO] Scanning for projects...
>>>>>>>>> [INFO]
>>>>>>>>> [INFO] ------------------------------------------------------------------------
>>>>>>>>> [INFO] Building JBoss AS Quickstarts Parent 7.1.2-SNAPSHOT
>>>>>>>>> [INFO] ------------------------------------------------------------------------
>>>>>>>>> [INFO]
>>>>>>>>> [INFO] --- gmaven-plugin:1.4:execute (default-cli) @ jboss-as-quickstarts-parent ---
>>>>>>>>> Starting zipping JBoss AS Quickstarts Parent modules
>>>>>>>>> Deleting D:\Dev\GitHub\jboss-as-quickstart\target\zips
>>>>>>>>> Zipped 51 quickstart modules
>>>>>>>>> Generating project examples descriptor for JBoss Tools
>>>>>>>>> [WARNING] module 'bmt' has a non matching artifactId 'jboss-as-bmt'
>>>>>>>>> [WARNING] module 'cdi-injection' has a non matching artifactId 'jboss-as-cdi-injection'
>>>>>>>>> [WARNING] module 'cdi-portable-extension' has a non matching artifactId 'jboss-as-cdi-portable-extension'
>>>>>>>>> [WARNING] module 'ejb-in-ear' has a non matching artifactId 'jboss-as-ejb-in-ear'
>>>>>>>>> [WARNING] module 'ejb-in-war' has a non matching artifactId 'jboss-as-ejb-in-war'
>>>>>>>>> [WARNING] module 'ejb-remote' has a non matching artifactId 'jboss-as-ejb-remote-parent'
>>>>>>>>> [WARNING] module 'ejb-security' has a non matching artifactId 'jboss-as-ejb-security'
>>>>>>>>> [WARNING] module 'greeter' has a non matching artifactId 'jboss-as-greeter'
>>>>>>>>> [WARNING] module 'helloworld' has a non matching artifactId 'jboss-as-helloworld'
>>>>>>>>> [WARNING] module 'helloworld-errai' has a non matching artifactId 'jboss-as-helloworld-errai'
>>>>>>>>> [WARNING] module 'helloworld-gwt' has a non matching artifactId 'jboss-as-helloworld-gwt'
>>>>>>>>> [WARNING] module 'helloworld-html5' has a non matching artifactId 'jboss-as-helloworld-html5'
>>>>>>>>> [WARNING] module 'helloworld-jms' has a non matching artifactId 'jboss-as-helloworld-jms'
>>>>>>>>> [WARNING] module 'helloworld-osgi' has a non matching artifactId 'jboss-as-helloworld-osgi'
>>>>>>>>> [WARNING] module 'helloworld-rs' has a non matching artifactId 'jboss-as-helloworld-rs'
>>>>>>>>> [WARNING] module 'helloworld-singleton' has a non matching artifactId 'jboss-as-helloworld-singleton'
>>>>>>>>> [WARNING] module 'hibernate3' has a non matching artifactId 'jboss-as-hibernate3'
>>>>>>>>> [WARNING] module 'hibernate4' has a non matching artifactId 'jboss-as-hibernate4'
>>>>>>>>> [WARNING] module 'kitchensink' has a non matching artifactId 'jboss-as-kitchensink'
>>>>>>>>> [WARNING] module 'kitchensink-ear' has a non matching artifactId 'jboss-as-kitchensink-ear'
>>>>>>>>> [WARNING] module 'kitchensink-html5-mobile' has a non matching artifactId 'jboss-as-kitchensink-html5-mobile'
>>>>>>>>> [WARNING] module 'kitchensink-jsp' has a non matching artifactId 'jboss-as-kitchensink-jsp'
>>>>>>>>> [WARNING] module 'kitchensink-ml' has a non matching artifactId 'jboss-as-kitchensink-ml'
>>>>>>>>> [WARNING] module 'kitchensink-ml-ear' has a non matching artifactId 'jboss-as-kitchensink-ml-ear'
>>>>>>>>> [WARNING] module 'log4j' has a non matching artifactId 'jboss-as-log4j'
>>>>>>>>> [WARNING] module 'logging-tools' has a non matching artifactId 'jboss-as-logging-tools'
>>>>>>>>> [WARNING] module 'mail' has a non matching artifactId 'jboss-as-mail'
>>>>>>>>> [WARNING] module 'numberguess' has a non matching artifactId 'jboss-as-numberguess'
>>>>>>>>> [WARNING] module 'payment-cdi-event' has a non matching artifactId 'jboss-as-payment-cdi-event'
>>>>>>>>> [WARNING] module 'richfaces-validation' has a non matching artifactId 'jboss-as-richfaces-validation'
>>>>>>>>> [WARNING] module 'servlet-async' has a non matching artifactId 'jboss-as-servlet-async'
>>>>>>>>> [WARNING] module 'servlet-filterlistener' has a non matching artifactId 'jboss-as-servlet-filterlistener'
>>>>>>>>> [WARNING] module 'servlet-security' has a non matching artifactId 'jboss-as-servlet-security'
>>>>>>>>> [WARNING] module 'tasks' has a non matching artifactId 'jboss-as-tasks'
>>>>>>>>> [WARNING] module 'tasks-jsf' has a non matching artifactId 'jboss-as-tasks-jsf'
>>>>>>>>> [WARNING] module 'temperature-converter' has a non matching artifactId 'jboss-as-temperature-converter'
>>>>>>>>> [WARNING] module 'tasks-rs' has a non matching artifactId 'jboss-as-tasks-rs'
>>>>>>>>> [WARNING] module 'wicket-ear' has a non matching artifactId 'jboss-as-wicket-ear-parent'
>>>>>>>>> [WARNING] module 'wicket-war' has a non matching artifactId 'jboss-as-wicket-war'
>>>>>>>>> [WARNING] module 'xml-jaxp' has a non matching artifactId 'jboss-as-xml-jaxp'
>>>>>>>>> [WARNING] module 'xml-dom4j' has a non matching artifactId 'jboss-as-xml-dom4j'
>>>>>>>>> [WARNING] module 'cmt' has a non matching artifactId 'jboss-as-cmt'
>>>>>>>>> [WARNING] module 'jts' has a non matching artifactId 'jboss-as-jts-parent'
>>>>>>>>> [WARNING] module 'jax-rs-client' has a non matching artifactId 'jboss-as-jax-rs-client'
>>>>>>>>> [WARNING] module 'inter-app' has a non matching artifactId 'jboss-as-inter-app-parent'
>>>>>>>>> [WARNING] module 'helloworld-mdb' has a non matching artifactId 'jboss-as-helloworld-mdb'
>>>>>>>>> [WARNING] module 'jta-crash-rec' has a non matching artifactId 'jboss-as-jta-crash-rec'
>>>>>>>>> [WARNING] module 'wsat-simple' has a non matching artifactId 'jboss-as-wsat-simple'
>>>>>>>>> [WARNING] module 'wsba-coordinator-completion-simple' has a non matching artifactId 'jboss-as-wsba-coordinator-completion-simple'
>>>>>>>>> [WARNING] module 'wsba-participant-completion-simple' has a non matching artifactId 'jboss-as-wsba-participant-completion-simple'
>>>>>>>>> D:\Dev\GitHub\jboss-as-quickstart\target\zips\quickstarts.xml generated
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> [WARNING] 50 quickstart artifactIds mismatch with their folder name.
>>>>>>>>> This will prevent WTP from opening the proper url when running on a server.
>>>>>>>>>
>>>>>>>>> [INFO] ------------------------------------------------------------------------
>>>>>>>>> [INFO] BUILD SUCCESS
>>>>>>>>> [INFO] ------------------------------------------------------------------------
>>>>>>>>> [INFO] Total time: 5.506s
>>>>>>>>> [INFO] Finished at: Tue Oct 09 15:02:44 CEST 2012
>>>>>>>>> [INFO] Final Memory: 11M/490M
>>>>>>>>> [INFO] ------------------------------------------------------------------------
>>>>>>>>>
>>>>>>>>> As hinted in the log, the examples wouldn't quite work perfectly OOTB. http://wiki.eclipse.org/M2E-WTP_FAQ#How_do_I_change_the_context_root_of_my_project.3F explains how the context root is inferred from the pom.xml by m2e-wtp. However our own JBoss AS server adapter ignores the WTP project context root and bases its deployment on the project name, leading to 404s as seen in the video below.
>>>>>>>>>
>>>>>>>>> End result in JBT / Central : http://www.screencast.com/users/fbricon/folders/Jing/media/464f8246-84bc-4941-b84c-7ae6420c2ac7
>>>>>>>>>
>>>>>>>>> Now.
>>>>>>>>> * are you guys ok to actually remove and replace the old examples with the JDF quickstarts
>>>>>>>>> * if you're ok, I'll setup a CI job to deploy the quickstarts to download.jboss.org
>>>>>>>>> * who's willing to give me a hand in validating the quickstarts properly work in JBT/JBDS. That includes :
>>>>>>>>> - checking the project belongs (or not) to JBT/JBDS
>>>>>>>>> - checking there's a proper project description
>>>>>>>>> - checking the projects are properly configured (I noticed some EARs are seen as 1.3 instead of 6.0) and compile without errors
>>>>>>>>> - checking the projects deploy OOTB on AS7/EAP6
>>>>>>>>>
>>>>>>>>> Regards,
>>>>>>>>>
>>>>>>>>> Fred Bricon
>>>>>>>>>
>>>>>> _______________________________________________
>>>>>> jdf-dev mailing list
>>>>>> jdf-dev at lists.jboss.org
>>>>>> https://lists.jboss.org/mailman/listinfo/jdf-dev
>>>> _______________________________________________
>>>> jdf-dev mailing list
>>>> jdf-dev at lists.jboss.org
>>>> https://lists.jboss.org/mailman/listinfo/jdf-dev
>>> _______________________________________________
>>> jdf-dev mailing list
>>> jdf-dev at lists.jboss.org
>>> https://lists.jboss.org/mailman/listinfo/jdf-dev
More information about the jbosstools-dev
mailing list