Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 389785

Summary: add maven archetype
Product: [Tools] Xtend Reporter: Christian Huelsmeier <eclipse>
Component: CoreAssignee: Project Inbox <xtend-inbox>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: clay, dennis.huebner, moritz.eysholdt, sven.efftinge
Version: 2.3.1Keywords: helpwanted
Target Milestone: M5Flags: sven.efftinge: kepler+
Hardware: PC   
OS: Windows 7   
Whiteboard:
Bug Depends on: 390073    
Bug Blocks:    
Attachments:
Description Flags
prototype of xtend maven archetype sven.efftinge: iplog+

Description Christian Huelsmeier CLA 2012-09-18 02:58:29 EDT
A maven archetype for a quickstart project would be helpful, e.g. like it's provided by the Wicket project (http://wicket.apache.org/start/quickstart.html).
This would shorten the startup time for using Xtend in a maven based project.
Comment 1 Sven Efftinge CLA 2012-09-18 03:04:19 EDT
contributions are most welcome ;-)
Comment 2 Christian Huelsmeier CLA 2012-09-18 03:49:44 EDT
Sven, I know ;-). It's on my task list, but I decided to enter a bug mostly to not forget it and to make the issue visible to the Xtend team ;-).
Comment 3 Sven Efftinge CLA 2012-09-18 04:09:02 EDT
Perfect! Looking forward to your contributions!
Comment 4 Christian Huelsmeier CLA 2012-09-18 15:19:59 EDT
Created attachment 221215 [details]
prototype of xtend maven archetype
Comment 5 Christian Huelsmeier CLA 2012-09-18 15:29:41 EDT
I tested the attached archetype implementation against my local repository, e.g.

mvn archetype:generate -DarchetypeGroupId=org.eclipse.xtend -DarchetypeArtifactId=xtend-maven-archetype-quickstart -DarchetypeVersion=2.3.1 -DgroupId=com.mycompany -DartifactId=myproject -DarchetypeRepository=local -DinteractiveMode=false

After executing this command a maven project with a HelloXtend.xtend file has been created.
Comment 6 Michael Clay CLA 2012-09-18 16:11:21 EDT
hi christian, not sure but i think you can omit the build-helper-maven-plugin since the xtend-compiler mojo already adds the 2 src/test-src folders to the project. can you confirm this?

thank you!


(In reply to comment #5)
> I tested the attached archetype implementation against my local repository,
> e.g.
> 
> mvn archetype:generate -DarchetypeGroupId=org.eclipse.xtend
> -DarchetypeArtifactId=xtend-maven-archetype-quickstart
> -DarchetypeVersion=2.3.1 -DgroupId=com.mycompany -DartifactId=myproject
> -DarchetypeRepository=local -DinteractiveMode=false
> 
> After executing this command a maven project with a HelloXtend.xtend file
> has been created.
Comment 7 Christian Huelsmeier CLA 2012-09-18 16:50:25 EDT
Hi Michael,

you're right. It could be omitted. I added it to the pom, because it src/main/xtend-gen wasn't on the build path after importing the project as a maven project in Eclipse. If the build-helper-maven-plugin is in the pom, the xtend-gen folder is on the build path.
I don't now whether this is a bug in m2e or in the xtend-plugin or the behaviour is correct.

btw. I forgot the following lines in the pom-Template:
<plugin>
	<artifactId>maven-compiler-plugin</artifactId>
	<version>2.3.2</version>
	<configuration>
		<source>1.5</source>
		<target>1.5</target>
	</configuration>
</plugin>

Christian


(In reply to comment #6)
> hi christian, not sure but i think you can omit the
> build-helper-maven-plugin since the xtend-compiler mojo already adds the 2
> src/test-src folders to the project. can you confirm this?
> 
> thank you!
> 
> 
> (In reply to comment #5)
> > I tested the attached archetype implementation against my local repository,
> > e.g.
> > 
> > mvn archetype:generate -DarchetypeGroupId=org.eclipse.xtend
> > -DarchetypeArtifactId=xtend-maven-archetype-quickstart
> > -DarchetypeVersion=2.3.1 -DgroupId=com.mycompany -DartifactId=myproject
> > -DarchetypeRepository=local -DinteractiveMode=false
> > 
> > After executing this command a maven project with a HelloXtend.xtend file
> > has been created.
Comment 8 Michael Clay CLA 2012-09-19 07:36:28 EDT
it's a missing feature of the existing xtend m2e extension i.e. we have to extend the existing lifecycleMappingMetadata with an org.eclipse.m2e.jdt.AbstractJavaProjectConfigurator to automatically add the xtend-gen folders to the build path.

the build-helper-maven-plugin is only a workaround to accomplish the same

(In reply to comment #7)
> Hi Michael,
> 
> you're right. It could be omitted. I added it to the pom, because it
> src/main/xtend-gen wasn't on the build path after importing the project as a
> maven project in Eclipse. If the build-helper-maven-plugin is in the pom,
> the xtend-gen folder is on the build path.
> I don't now whether this is a bug in m2e or in the xtend-plugin or the
> behaviour is correct.
> 
> btw. I forgot the following lines in the pom-Template:
> <plugin>
> 	<artifactId>maven-compiler-plugin</artifactId>
> 	<version>2.3.2</version>
> 	<configuration>
> 		<source>1.5</source>
> 		<target>1.5</target>
> 	</configuration>
> </plugin>
> 
> Christian
> 
> 
> (In reply to comment #6)
> > hi christian, not sure but i think you can omit the
> > build-helper-maven-plugin since the xtend-compiler mojo already adds the 2
> > src/test-src folders to the project. can you confirm this?
> > 
> > thank you!
> > 
> > 
> > (In reply to comment #5)
> > > I tested the attached archetype implementation against my local repository,
> > > e.g.
> > > 
> > > mvn archetype:generate -DarchetypeGroupId=org.eclipse.xtend
> > > -DarchetypeArtifactId=xtend-maven-archetype-quickstart
> > > -DarchetypeVersion=2.3.1 -DgroupId=com.mycompany -DartifactId=myproject
> > > -DarchetypeRepository=local -DinteractiveMode=false
> > > 
> > > After executing this command a maven project with a HelloXtend.xtend file
> > > has been created.
Comment 9 Christian Huelsmeier CLA 2012-09-19 07:46:52 EDT
ok. so (basically) the build-helper-maven-plugin can be omitted, but the maven-compiler-plugin config needs to be provided.
should I provide more artefacts to successfully make the archetype available in the xtend maven repo? ;-)
Comment 10 Dennis Huebner CLA 2012-09-19 08:17:45 EDT
(In reply to comment #9)
> should I provide more artefacts to successfully make the archetype available
> in the xtend maven repo? ;-)
We need your avatar as png or jpeg, which can be published within the xtend maven repository metadata. As this is a public repo please only licensed or self made photos.
Comment 11 Christian Huelsmeier CLA 2012-09-19 10:15:17 EDT
http://www.huelsmeier.info/profilfoto_christianhuelsmeier.jpg

(In reply to comment #10)
> (In reply to comment #9)
> > should I provide more artefacts to successfully make the archetype available
> > in the xtend maven repo? ;-)
> We need your avatar as png or jpeg, which can be published within the xtend
> maven repository metadata. As this is a public repo please only licensed or
> self made photos.
Comment 12 Dennis Huebner CLA 2012-09-19 11:29:08 EDT
@Michael
Could you please review the whole thing? So I can push and try it out in our maven build job.
Comment 13 Michael Clay CLA 2012-09-19 16:50:44 EDT
sure
(In reply to comment #12)
> @Michael
> Could you please review the whole thing? So I can push and try it out in our
> maven build job.
Comment 14 Dennis Huebner CLA 2012-09-21 04:35:25 EDT
Tried attached archetype with Juno SR1 right now, works very well!
Thanks for contribution Christian!
Comment 15 Moritz Eysholdt CLA 2013-01-24 10:28:26 EST
contribution applied in 'master':
http://git.eclipse.org/c/tmf/org.eclipse.xtext.git/commit/?id=7598225404ffc0f73b30a76e26525a88517af5de

Thank you, Christian!
Comment 16 Dennis Huebner CLA 2013-02-19 05:21:29 EST
Archetype catalog was published to build.eclipse.org.

Add new remote catalog with eclipse m2e:
URL: http://build.eclipse.org/common/xtend/maven/
Descr.: Xtend archetypes

Start new m2e project wizard, select "Xtend archetypes" from the Catalog drop-down, activate "Include snapshot archetypes", select xtend-archetype, have fun.
Comment 17 Eclipse Webmaster CLA 2017-10-31 11:25:41 EDT
Requested via bug 522520.

-M.