[jbosstools-issues] [JBoss JIRA] (JBIDE-9863) ProjectExamplesFix assumes the Eclipse project name is identical to the Example name

Snjezana Peco (Resolved) (JIRA) jira-events at lists.jboss.org
Sat Nov 26 09:32:40 EST 2011


     [ https://issues.jboss.org/browse/JBIDE-9863?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Snjezana Peco resolved JBIDE-9863.
----------------------------------

    Resolution: Done


Eclipse projects that are created by importing a project example are defined using the includedProjects element (the project example name and the name of the created eclipse project don't have to be the same). The ProjectExamplesFix class uses the includedProjects list. The project example name is used only if the includedProjects element doesn't exist.

Now, the project example engine will dynamically add included projects for a project example of the maven and mavenArchetype type. 
The project example engine uses the Maven API to calculate included projects after importing a project example. 
If a dynamic project needs to be used in /project/fixes/fix/property at name=eclipseProjects, you can use a syntax like ${project[N]}. ${project[0]} will be replaced with the first project in the includedProjects list, for instance. 
If a fix is related to all included Eclipse projects, you don't have to add the eclipseProjects property.

The following are some examples:

...
  <fix type="wtpruntime">
	<property name="allowed-types">org.jboss.ide.eclipse.as.runtime.70, org.jboss.ide.eclipse.as.runtime.eap.60</property>
	<property name="description">This project example requires JBoss AS 7.0</property>
	<property name="eclipse-projects">${project[1]}, ${project[2]}, ${project[3]} </property>
	<property name="downloadId">org.jboss.tools.runtime.core.as.702</property>
  </fix>
...
...
  <fix type="wtpruntime">
	<property name="allowed-types">org.jboss.ide.eclipse.as.runtime.70, org.jboss.ide.eclipse.as.runtime.eap.60</property>
	<property name="description">This project example requires JBoss AS 7.0</property>
	<property name="eclipse-projects">${project[0]}-ejb, ${project[0]}-web, ${project[0]}-ear </property>
	<property name="downloadId">org.jboss.tools.runtime.core.as.702</property>
  </fix>
...

The following fix will be applied to all created Eclipse projects:
...
  <fix type="wtpruntime">
	<property name="allowed-types">org.jboss.ide.eclipse.as.runtime.70, org.jboss.ide.eclipse.as.runtime.eap.60</property>
	<property name="description">This project example requires JBoss AS 7.0</property>
	
	<property name="downloadId">org.jboss.tools.runtime.core.as.702</property>
  </fix>
...

The same syntax can be used for a cheatsheet. You could, for instance, define a cheatsheet in the root of an archetype as follows:
...
<welcome type="cheatsheets" url="/${project[0]}/cheatsheet.xml"/> 
...

                
> ProjectExamplesFix assumes the Eclipse project name is identical to the Example name  
> --------------------------------------------------------------------------------------
>
>                 Key: JBIDE-9863
>                 URL: https://issues.jboss.org/browse/JBIDE-9863
>             Project: Tools (JBoss Tools)
>          Issue Type: Bug
>          Components: project-examples
>    Affects Versions: 3.3.0.M3
>            Reporter: Fred Bricon
>            Assignee: Snjezana Peco
>             Fix For: 3.3.0.M5
>
>
> When creating a project example from a maven archetype, the created Eclipse project ends up having a different name (user defined) than the original project example.
> Implementations of ProjectExamplesFix rely on ProjectExamplesActivator.getEclipseProject(project, fix); to infer the generated eclipse project. 
> Since eclipse projects and archetype have a different name (more so in the case of archetype creating multiple projects), no fixes can be applied.
> My opinion is we should modify the Import Job API so that it returns the list of created IProjects, then pass that list all along to the ProjectExamplesFix.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jbosstools-issues mailing list