Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Buckminster » Using Buckminster to Build a Web Application
Using Buckminster to Build a Web Application [message #502729] Wed, 09 December 2009 14:59 Go to next message
TW  is currently offline TW Friend
Messages: 62
Registered: November 2009
Member
Hi,

I did use Buckminster to build my RCP application. Now I was wondering if it is also possible to build web applications with buckminster.

Building with RCP Apps is quite easy because you only have to add a p2.site feature and add some files. Buckminster does the rest for you.

So is it possible to do something like that with web app projects too? Or do I have to user lots of Ant-Skripts to get my *.war file?

Thanks for your support.

[Updated on: Thu, 10 December 2009 11:57]

Report message to a moderator

Re: Using Buckminster to Build a Web Application [message #502747 is a reply to message #502729] Wed, 09 December 2009 15:10 Go to previous messageGo to next message
Thomas Hallgren is currently offline Thomas HallgrenFriend
Messages: 3240
Registered: July 2009
Senior Member
Hi TW,
Buckminster has no meta-data extractor for WAR/EAR projects today. This has been on our wish list for some time and now
we might finally get there. We have some very interesting collaboration going on with the Eclipse MoDisco project (model
discovery) that I think will be of great help when doing automatic discovery of what a WAR app is all about.

Until that happens, you will need to write your own CSPEC's to make things fit together. And yes, you will probably need
to provide some ant-tasks too, that you then call from the cspec actions. One ant-script can be reused by all cspecs to
you will be able to keep things together.

Regards,
Thomas Hallgren


On 2009-12-09 15:59, TW wrote:
> Hi,
>
> I did use Buckminster to build my RCP application. Now I was wondering
> if it is also possible to build web applications with buckminster.
>
> Building with RCP Apps is quite easy because you only have to add a
> p2.site feature and add some files. Buckminster does the rest for you.
>
> So is it possible to do something link that with web app projects too?
> Or do I have to user lots of Ant-Skripts to get my *.war file?
>
> Thanks for your support.
Re: Using Buckminster to Build a Web Application [message #502858 is a reply to message #502747] Thu, 10 December 2009 01:07 Go to previous messageGo to next message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
Hi,
As thomas said, we are very interested in supporting this.
You will get help naturally if you want to go ahead and try this.
Just fire away with questions...

Regards
- henrik

On 12/9/09 4:10 PM, Thomas Hallgren wrote:
> Hi TW,
> Buckminster has no meta-data extractor for WAR/EAR projects today. This
> has been on our wish list for some time and now we might finally get
> there. We have some very interesting collaboration going on with the
> Eclipse MoDisco project (model discovery) that I think will be of great
> help when doing automatic discovery of what a WAR app is all about.
>
> Until that happens, you will need to write your own CSPEC's to make
> things fit together. And yes, you will probably need to provide some
> ant-tasks too, that you then call from the cspec actions. One ant-script
> can be reused by all cspecs to you will be able to keep things together.
>
> Regards,
> Thomas Hallgren
>
>
> On 2009-12-09 15:59, TW wrote:
>> Hi,
>>
>> I did use Buckminster to build my RCP application. Now I was wondering
>> if it is also possible to build web applications with buckminster.
>>
>> Building with RCP Apps is quite easy because you only have to add a
>> p2.site feature and add some files. Buckminster does the rest for you.
>>
>> So is it possible to do something link that with web app projects too?
>> Or do I have to user lots of Ant-Skripts to get my *.war file?
>>
>> Thanks for your support.
>
Re: Using Buckminster to Build a Web Application [message #502872 is a reply to message #502858] Thu, 10 December 2009 07:24 Go to previous messageGo to next message
TW  is currently offline TW Friend
Messages: 62
Registered: November 2009
Member
Hi,

OK so I've one last question just to understand the whole thing better.

In my CSPEC's files I can define my own actions. In the Eclipse RCP Project I defined an action to build my product (create.product).

This action basically did the following:
- Call an ANT-Script (standard product.ant so nothing self-written)
- set some prerequisite to the site.p2 action (which was already defined and is know to buckminster)

If I would write a CPSEC file in my web application I could link the action with an ANT-Script.

I can build my product using ANT-Scripts. I call one script and it collects all the information and calls some other ANT-Scripts which are located in my project.

If I now would use a Buckminster-Action I would get something like this:

Buckminster Action -> ANT-Script -> *(Many ANT-Scripts).

So what's the advantage of calling the ANT-Script with a Buckminster action?
If I user Hudson I could call an ANT-Script or a buckminster action and both should do the same?

Am I right with that?


Re: Using Buckminster to Build a Web Application [message #502886 is a reply to message #502872] Thu, 10 December 2009 08:01 Go to previous messageGo to next message
Thomas Hallgren is currently offline Thomas HallgrenFriend
Messages: 3240
Registered: July 2009
Senior Member
On 2009-12-10 08:25, TW wrote:
> So what's the advantage of calling the ANT-Script with a Buckminster
> action?
> If I user Hudson I could call an ANT-Script or a buckminster action and
> both should do the same?
>
> Am I right with that?
>
There are a couple of things that Buckminster brings into the picture.

1. Automated provisioning of your target platform and workspace. Dependency chains etc. are automatically traversed,
binary dependencies can be separated from source, etc.

2. Build orchestration. The same meta-data that is used when doing the provisioning will also control
2a In what order things will be built
2b Where everything ends up (which vouches for correct classpaths etc.)

3. Separation of concern. Each project is self descriptive and that description can in turn be used by other projects.
I.e. you get well defined meta-data that enables good visualization of the component, of dependency graph, and the build
flow.

The way I would go about it is to describe the things that Buckminster has strong support for (dependencies and build
workflow) in CSPEC's and the actual workers as reusable ant-tasks.

Regards,
Thomas Hallgren
Re: Using Buckminster to Build a Web Application [message #502887 is a reply to message #502886] Thu, 10 December 2009 08:23 Go to previous messageGo to next message
TW  is currently offline TW Friend
Messages: 62
Registered: November 2009
Member
Ok,

I don't know If I should invest the time to change my product build to a buckminster build when there is no automatic dependency detection. I have to think about that again.

But I think it's not as useful as in eclipse rcp applications by now.

What I liked about buckminster is, that it recognizes dependencies on its own. So If I change my projects structure I do not have to re-factor my Ant-Scripts or CSPEC'S (Web Appliction) dependencies.

You said that there is a plan to make things easier when building web applications.
Will this be as comfortable as building eclipse rcp apps with buckminster and when is the release planned?

[Updated on: Thu, 10 December 2009 08:24]

Report message to a moderator

Re: Using Buckminster to Build a Web Application [message #502896 is a reply to message #502887] Thu, 10 December 2009 08:47 Go to previous messageGo to next message
TW  is currently offline TW Friend
Messages: 62
Registered: November 2009
Member
I did read some articles in the bucky book about cspec files. I think I'm going to try to create some cspec files but have some questions

I've checked the metadata cpsec from my eclipse rcp project. Here buckminster collects the necessarry data on its own.

So hat I have to do is:
- Create a CSPEC file for every project in my workspace.

The first thing I will have to do is to check the dependencies of my projects and add the same dependencies to the cspec which I have to create or every project.

The second question is what else do I have to add?

I'm quite sure that I also have to add a action. But I don't understand is how do I manage my build workflow?

I have to create one main action which could call an ant-script. But If I understood you right, the ant-scripts shout not call other ant-scripts because these dependency management is done by my cspec files.

But I've only defined a dependency from one project to other projects. So how does buckminster manage to start the build process and runs everything in the right order or call the ant-scripts of the other projects?

Maybe you can give me some help.

-
Re: Using Buckminster to Build a Web Application [message #502900 is a reply to message #502896] Thu, 10 December 2009 09:00 Go to previous messageGo to next message
Thomas Hallgren is currently offline Thomas HallgrenFriend
Messages: 3240
Registered: July 2009
Senior Member
Hi Toby,

On 2009-12-10 09:47, TW wrote:
> I did read some articles in the bucky book about cspec files. I think
> I'm going to try to create some cspec files but have some questions
>
> I've checked the metadata cpsec from my eclipse rcp project. Here
> buckminster collects the necessarry data on its own.
>
> So hat I have to do is:
> - Create a CSPEC file for every project in my workspace.
>
> The first thing I will have to do is to check the dependencies of my
> projects and add the same dependencies to the cspec which I have to
> create or every project.
>
Yes.

> The second question is what else do I have to add?
>
> I'm quite sure that I also have to add a action. But I don't understand
> is how do I manage my build workflow?
> I have to create one main action which could call an ant-script. But If
> I understood you right, the ant-scripts shout not call other ant-scripts
> because these dependency management is done by my cspec files.
> But I've only defined a dependency from one project to other projects.
> So how does buckminster manage to start the build process and runs
> everything in the right order or call the ant-scripts of the other
> projects?
>
> Maybe you can give me some help.
>
An action can have prerequisites. A prerequisite can be any attribute (action, artifact, or group). What more is, a
prerequisite can be any attribute in any component that is reachable using the dependencies.

So an action can be dependent on something that another components action is producing.

I think you can get good clues on how this is done by viewing the cspec's generated for your RCP app.

Regards,
Thomas Hallgren
Re: Using Buckminster to Build a Web Application [message #502942 is a reply to message #502900] Thu, 10 December 2009 11:36 Go to previous messageGo to next message
Johannes Utzig is currently offline Johannes UtzigFriend
Messages: 329
Registered: July 2009
Senior Member
Hi,

I'm not so sure if that helps you but I recently hacked something
together to package a RAP based web application (their demo application)
with buckminster.

It's a little different because it's still eclipse based, but the idea
is the same, you'd just need a few extra files because you get less
things for free for non-osgi bundles.

This feeds a simple ant script with the build materials:

<artifacts>
<public name="templates" path="templates" />
</artifacts>
<actions>
<public name="create.webapp" actor="ant" >
<actorProperties>
<property key="buildFile" value="build/create.webapp.xml"/>
</actorProperties>
<prerequisites alias="materials">
<attribute name="feature.exports" alias="bundles"/>
<attribute name="templates" alias="templates"/>
<attribute name="bundle.jar"
component="org.eclipse.equinox.servletbridge" alias="library"/>
</prerequisites>
<products alias="webapp" base="${buckminster.output}">
<path path="WebApp/"/>
</products>
</public>
</actions>


And the ant script is just that:

<?xml version="1.0"?>
<project name="project">
<target name="create.webapp">
<mkdir dir="${sp:webapp}"/>
<copy todir="${sp:webapp}" verbose="true">
<fileset dir="${sp:templates}" />
</copy>
<buckminster.copy todir="${sp:webapp}/WEB-INF/eclipse"
overwrite="true">
<buckminster.filesetgroup value="${fs:bundles}" />
</buckminster.copy>
<buckminster.copy todir="${sp:webapp}/WEB-INF/lib" overwrite="true">
<buckminster.filesetgroup value="${fs:library}" />
</buckminster.copy>
</target>
</project>


Best regards,
Johannes
Re: Using Buckminster to Build a Web Application [message #502974 is a reply to message #502942] Thu, 10 December 2009 13:44 Go to previous messageGo to next message
TW  is currently offline TW Friend
Messages: 62
Registered: November 2009
Member
HI Johannes,

thanks for your help.

I think the first thing I will have to do is to write the CSPEC files.

I analyzed my RCP Project and tried to think how everything has to be made in the web app project.

=>Main
- What component type is a normal java project? Is this just "unknown"

=>Actions
Johannes defined one action create.webabb and calls the ant-script in this action.

The action has also some prerequisites. I inspected my rcp app and there are many actions which do something but I don't have any plan what they do. Do I need that much actions?

=>Dependencies

When I go to Properties of a project I click on "Jave EE Module Dependency" and can see all active dependencies. Are there any other dependencies which are not listed here?

Whats with project that use external libs how do I set a dependency in this case?

---
How do I know which Groups i have to build, which Artifacts i need to build and which actions have to be defined?

Are there any tutorials on the web which explain how building with buckminster works if you want to build a web application ?

How can I optimize my project structure to make the buckminster specification easier?

[Updated on: Thu, 10 December 2009 13:59]

Report message to a moderator

Re: Using Buckminster to Build a Web Application [message #502983 is a reply to message #502974] Thu, 10 December 2009 14:14 Go to previous messageGo to next message
Thomas Hallgren is currently offline Thomas HallgrenFriend
Messages: 3240
Registered: July 2009
Senior Member
On 2009-12-10 14:44, TW wrote:
> HI Johannes,
>
> thanks for your help.
>
> I think the first thing I will have to do is to write the CSPEC files.
>
> I analyzed my RCP Project and tried to think how everything has to be
> made in the web app project.
>
> =>Main
> - What component type is a normal java project? Is this just "unknown"
>
From buckminsters standpoint, an 'unknown' component is a component that contains no known meta-data. If you add a
buckminster.cspec, the component is of type 'buckminster'.

> =>Dependencies
>
> When I go to Properties of a project I click on "Jave EE Module
> Dependency" and can see all active dependencies. Are there any other
> dependencies which are not listed here?
>
> Whats with project that use external libs how do I set a dependency in
> this case?
>
You would probably treat those as external dependencies and fetch them from Maven Central or the like (using the maven
reader type in the RMAP).

> ---
> How do I know which Groups i have to build, which Artifacts i need to
> build and which actions have to be defined?
>
I guess that knowledge is gained as part of structuring your component. It's entirely up to you.


> Are there any tutorials on the web which explain how building with
> buckminster works if you want to build a web application ?
>
Not that I known of.

> How can I optimize my project structure to make the buckminster
> specification easier?

Any modular layout is fine I guess. Don't be afraid of using many projects. Huge monolithic projects are hard to make
sense of.

Regards,
Thomas Hallgren
Re: Using Buckminster to Build a Web Application [message #502994 is a reply to message #502983] Thu, 10 December 2009 14:37 Go to previous messageGo to next message
TW  is currently offline TW Friend
Messages: 62
Registered: November 2009
Member
Hi Thomas,

you wrote that you plan to collect the metadata for web applications automatically in the future. I think I have to wait until then.

I could set the internal dependencies but I haven't used maven.

Also I have no plan which actions, artifacts or groups I need to add.

For you as a developer of buckminster it is easy to understand this but without a tutorial or some easy sample project its very hard to get the knowledge to build a large web application.

Are there any plans when this feature is included in the buckminster plugin?
Re: Using Buckminster to Build a Web Application [message #503016 is a reply to message #502994] Thu, 10 December 2009 14:56 Go to previous message
Thomas Hallgren is currently offline Thomas HallgrenFriend
Messages: 3240
Registered: July 2009
Senior Member
Hi Toby,

On 2009-12-10 15:37, TW wrote:
> Hi Thomas,
>
> you wrote that you plan to collect the metadata for web applications
> automatically in the future. I think I have to wait until then.
> I could set the internal dependencies but I haven't used maven.

You don't need to use Maven. Using the Buckminster maven reader to gain access to things published at Maven Central is
just one convenient way of getting some of the jars that you might need. If you get them from some other place today,
you can of course continue with that. It was just a suggestion.

> Also I have no plan which actions, artifacts or groups I need to add.
>
I'm afraid you'll need to figure that out anyway. You will need some way of building the war. If it's ant, then you will
need to come up with the ant tasks, file locations, etc. This is not that different.

> For you as a developer of buckminster it is easy to understand this but
> without a tutorial or some easy sample project its very hard to get the
> knowledge to build a large web application.
>
> Are there any plans when this feature is included in the buckminster
> plugin?

I'm afraid we have no time frame yet. We're an open source community and very much dependent on that people like
yourself perform experiments and contribute knowledge and ideas back. That really speeds things up.

Regards,
Thomas Hallgren
Previous Topic:Aggregator, scalability, and validation
Next Topic:Java path issue with buckminster hudson plugin
Goto Forum:
  


Current Time: Wed Jan 15 20:31:50 GMT 2025

Powered by FUDForum. Page generated in 0.03627 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top