You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by "Henning Schmiedehausen (JIRA)" <ji...@apache.org> on 2008/05/15 19:13:55 UTC

[jira] Created: (SHINDIG-269) package all features in a single jar, load from classpath

package all features in a single jar, load from classpath
---------------------------------------------------------

                 Key: SHINDIG-269
                 URL: https://issues.apache.org/jira/browse/SHINDIG-269
             Project: Shindig
          Issue Type: Improvement
          Components: Features (Javascript), Gadget Rendering Server (Java)
            Reporter: Henning Schmiedehausen


The attached patch creates a Maven project for the features directory. This allows automatic packaging up of the features into a single jar, which then can be placed on the classpath for the gadget server and the demo container. 

This removes the need for the various javascript related plugins from the gadget rendering server and also a number of the cross-project linking and copying. The features directory itself is not modified, so the PHP version should still run fine. 

In the long run, it might be good to move the features out of the root directory and into e.g. src/javascript to allow better control of the jar creation. 



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SHINDIG-269) package all features in a single jar, load from classpath

Posted by "Henning Schmiedehausen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SHINDIG-269?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henning Schmiedehausen updated SHINDIG-269:
-------------------------------------------

    Attachment: javascript-jar.patch

create a shindig-features POM, add this as a dependency to the gadget server and the demo container.

> package all features in a single jar, load from classpath
> ---------------------------------------------------------
>
>                 Key: SHINDIG-269
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-269
>             Project: Shindig
>          Issue Type: Improvement
>          Components: Features (Javascript), Gadget Rendering Server (Java)
>            Reporter: Henning Schmiedehausen
>         Attachments: javascript-jar.patch
>
>
> The attached patch creates a Maven project for the features directory. This allows automatic packaging up of the features into a single jar, which then can be placed on the classpath for the gadget server and the demo container. 
> This removes the need for the various javascript related plugins from the gadget rendering server and also a number of the cross-project linking and copying. The features directory itself is not modified, so the PHP version should still run fine. 
> In the long run, it might be good to move the features out of the root directory and into e.g. src/javascript to allow better control of the jar creation. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SHINDIG-269) package all features in a single jar, load from classpath

Posted by "Henning Schmiedehausen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SHINDIG-269?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12597434#action_12597434 ] 

Henning Schmiedehausen commented on SHINDIG-269:
------------------------------------------------

Cool. Thanks. 

I feel that opening a features/features.txt file and parsing this is a bit awkward. Would you accept some logic that checks the feature/** tree for features.xml files at startup and opens everything found in there?

> package all features in a single jar, load from classpath
> ---------------------------------------------------------
>
>                 Key: SHINDIG-269
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-269
>             Project: Shindig
>          Issue Type: Improvement
>          Components: Features (Javascript), Gadget Rendering Server (Java)
>            Reporter: Henning Schmiedehausen
>         Attachments: javascript-jar.patch
>
>
> The attached patch creates a Maven project for the features directory. This allows automatic packaging up of the features into a single jar, which then can be placed on the classpath for the gadget server and the demo container. 
> This removes the need for the various javascript related plugins from the gadget rendering server and also a number of the cross-project linking and copying. The features directory itself is not modified, so the PHP version should still run fine. 
> In the long run, it might be good to move the features out of the root directory and into e.g. src/javascript to allow better control of the jar creation. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SHINDIG-269) package all features in a single jar, load from classpath

Posted by "Chris Chabot (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SHINDIG-269?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12597272#action_12597272 ] 

Chris Chabot commented on SHINDIG-269:
--------------------------------------

> In the long run, it might be good to move the features out of the root directory and into e.g. src/javascript

The javascript directory contains mostly just javascript sample files, not stuff that's really required by shindig, putting features in them would be slightly confusing .. plus  I can't say how the java side deals with this, but on the PHP side the /gadgets/files/* files are served directly from the <shindig_root>/javascript directory. So if you would put the features there, you could access them directly through /gadgets/files/features/<something>, probably not something we want :)

All in all, leave the features where they are I'd say 



> package all features in a single jar, load from classpath
> ---------------------------------------------------------
>
>                 Key: SHINDIG-269
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-269
>             Project: Shindig
>          Issue Type: Improvement
>          Components: Features (Javascript), Gadget Rendering Server (Java)
>            Reporter: Henning Schmiedehausen
>         Attachments: javascript-jar.patch
>
>
> The attached patch creates a Maven project for the features directory. This allows automatic packaging up of the features into a single jar, which then can be placed on the classpath for the gadget server and the demo container. 
> This removes the need for the various javascript related plugins from the gadget rendering server and also a number of the cross-project linking and copying. The features directory itself is not modified, so the PHP version should still run fine. 
> In the long run, it might be good to move the features out of the root directory and into e.g. src/javascript to allow better control of the jar creation. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SHINDIG-269) package all features in a single jar, load from classpath

Posted by "Kevin Brown (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SHINDIG-269?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12597400#action_12597400 ] 

Kevin Brown commented on SHINDIG-269:
-------------------------------------

It doesn't need to do all that. Every file in the features/ directory should be included in the jar (except for the pom that is being added, of course). Features aren't necessarily just javascript. The following would be fine:

<resources>
      <resource>
        <targetPath>/features</targetPath>
        <directory>${basedir}</directory>
        <excludes>
           <exclude>pom.xml</exclude>
           <exclude>target/**</exclude>
        </excludes>
      </resource>
</resources> 

This will pick up everything else in the directory. Adding two extra directory levels to compensate for maven limitations is unnecessary, as only the java implementation gains anything from this. If <directory> can take the form ${basedir}/** or the like, even the pom.xml and target/** exclusions are unnecessary as well, but from what I can tell that doesn't appear to be possible. 

The idea behind the patch itself is great -- but that doesn't mean that the directory structure needs to change.

> package all features in a single jar, load from classpath
> ---------------------------------------------------------
>
>                 Key: SHINDIG-269
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-269
>             Project: Shindig
>          Issue Type: Improvement
>          Components: Features (Javascript), Gadget Rendering Server (Java)
>            Reporter: Henning Schmiedehausen
>         Attachments: javascript-jar.patch
>
>
> The attached patch creates a Maven project for the features directory. This allows automatic packaging up of the features into a single jar, which then can be placed on the classpath for the gadget server and the demo container. 
> This removes the need for the various javascript related plugins from the gadget rendering server and also a number of the cross-project linking and copying. The features directory itself is not modified, so the PHP version should still run fine. 
> In the long run, it might be good to move the features out of the root directory and into e.g. src/javascript to allow better control of the jar creation. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SHINDIG-269) package all features in a single jar, load from classpath

Posted by "Kevin Brown (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SHINDIG-269?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12597578#action_12597578 ] 

Kevin Brown commented on SHINDIG-269:
-------------------------------------

The features.txt file is very awkward, but nobody seemed to have a good alternative solution other than loading from disk. For my own deployments, I always use the disk-based loading to avoid dealing with the text file.

If you know a better way to recursively load the xml files, that would be very helpful. Various wildcard matching on resource loaders didn't seem to work.

> package all features in a single jar, load from classpath
> ---------------------------------------------------------
>
>                 Key: SHINDIG-269
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-269
>             Project: Shindig
>          Issue Type: Improvement
>          Components: Features (Javascript), Gadget Rendering Server (Java)
>            Reporter: Henning Schmiedehausen
>         Attachments: javascript-jar.patch
>
>
> The attached patch creates a Maven project for the features directory. This allows automatic packaging up of the features into a single jar, which then can be placed on the classpath for the gadget server and the demo container. 
> This removes the need for the various javascript related plugins from the gadget rendering server and also a number of the cross-project linking and copying. The features directory itself is not modified, so the PHP version should still run fine. 
> In the long run, it might be good to move the features out of the root directory and into e.g. src/javascript to allow better control of the jar creation. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SHINDIG-269) package all features in a single jar, load from classpath

Posted by "Kevin Brown (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SHINDIG-269?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12597376#action_12597376 ] 

Kevin Brown commented on SHINDIG-269:
-------------------------------------

I don't think you understand how the features directory is used. Each sub-directory is effectively a separate project in and of itself. We could put separate source directories into each feature directory, but that would just be moving a file or two with no real benefit.

> package all features in a single jar, load from classpath
> ---------------------------------------------------------
>
>                 Key: SHINDIG-269
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-269
>             Project: Shindig
>          Issue Type: Improvement
>          Components: Features (Javascript), Gadget Rendering Server (Java)
>            Reporter: Henning Schmiedehausen
>         Attachments: javascript-jar.patch
>
>
> The attached patch creates a Maven project for the features directory. This allows automatic packaging up of the features into a single jar, which then can be placed on the classpath for the gadget server and the demo container. 
> This removes the need for the various javascript related plugins from the gadget rendering server and also a number of the cross-project linking and copying. The features directory itself is not modified, so the PHP version should still run fine. 
> In the long run, it might be good to move the features out of the root directory and into e.g. src/javascript to allow better control of the jar creation. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SHINDIG-269) package all features in a single jar, load from classpath

Posted by "Kevin Brown (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SHINDIG-269?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12597297#action_12597297 ] 

Kevin Brown commented on SHINDIG-269:
-------------------------------------

"features" is intentionally a separate directory, and not everything in there is going to be javascript. The main piece of data in the features directory is XML. The javascript files themselves could be placed into javascript/, but that makes globbing files more difficult.

trunk/javascript is entirely for sample files and the like.

> package all features in a single jar, load from classpath
> ---------------------------------------------------------
>
>                 Key: SHINDIG-269
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-269
>             Project: Shindig
>          Issue Type: Improvement
>          Components: Features (Javascript), Gadget Rendering Server (Java)
>            Reporter: Henning Schmiedehausen
>         Attachments: javascript-jar.patch
>
>
> The attached patch creates a Maven project for the features directory. This allows automatic packaging up of the features into a single jar, which then can be placed on the classpath for the gadget server and the demo container. 
> This removes the need for the various javascript related plugins from the gadget rendering server and also a number of the cross-project linking and copying. The features directory itself is not modified, so the PHP version should still run fine. 
> In the long run, it might be good to move the features out of the root directory and into e.g. src/javascript to allow better control of the jar creation. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SHINDIG-269) package all features in a single jar, load from classpath

Posted by "Henning Schmiedehausen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SHINDIG-269?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12597383#action_12597383 ] 

Henning Schmiedehausen commented on SHINDIG-269:
------------------------------------------------

So how is it used? As far as I can see, it is linked into the example server (in the pom) and the gadget server (again in the pom) and the javascript files end up in the gadget server jar. They are all treated equal. I do understand that every subdirectory in the features directory is a feature that is offered by the gadget server and that you can modify the features.txt file to turn features on or off. What this patch does is simply change the way the features are packaged up.

Now: 
- the gadget server build runs the feature test suite
- the features javascript files end up in the shindig-gadgets.jar
- the files are copied around in a number of places
- replacing the javascript files in production is difficult because you either have to swap the gadget server jar or replace single files on the FS

With the patch:
- the features test suite is run in its own project
- the features javascript ends up in its own jar which gets placed on the classpath
- no javascript files are copied around, the sample server just has the shindig-features jar on the classpath
- replacing the javascript files in production is swapping out the shindig-features jar.

I fail to see why this is a big deal. And moving the feature subdirectories out of the root would allow you to write

    <resources>
      <resource>
        <targetPath>/features</targetPath>
        <directory>${basedir}/src/javascript</directory>
      </resource>
    </resources>

instead of

    <resources>
      <resource>
        <targetPath>/features</targetPath>
        <directory>${basedir}</directory>
        <includes>
          <include>**/*.js</include>
          <include>**/*.xml</include>
          <include>features.txt</include>
        </includes>
        <excludes>
          <exclude>pom.xml</exclude>
          <exclude>target/**</exclude>
        </excludes>
      </resource>
    </resources>

Did you actually look at the patch?

> package all features in a single jar, load from classpath
> ---------------------------------------------------------
>
>                 Key: SHINDIG-269
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-269
>             Project: Shindig
>          Issue Type: Improvement
>          Components: Features (Javascript), Gadget Rendering Server (Java)
>            Reporter: Henning Schmiedehausen
>         Attachments: javascript-jar.patch
>
>
> The attached patch creates a Maven project for the features directory. This allows automatic packaging up of the features into a single jar, which then can be placed on the classpath for the gadget server and the demo container. 
> This removes the need for the various javascript related plugins from the gadget rendering server and also a number of the cross-project linking and copying. The features directory itself is not modified, so the PHP version should still run fine. 
> In the long run, it might be good to move the features out of the root directory and into e.g. src/javascript to allow better control of the jar creation. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SHINDIG-269) package all features in a single jar, load from classpath

Posted by "Henning Schmiedehausen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SHINDIG-269?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12597366#action_12597366 ] 

Henning Schmiedehausen commented on SHINDIG-269:
------------------------------------------------

Nah, you both got me wrong.

I mean 

features/src/javascript/<stuff> or features/src/js/<stuff> or features/src/foo/<stuff> instead of features/<stuff>. Like the other java parts use src/java for the java code.

That makes globbing easier. I did *not* propose moving the features code into the (misnamed?) javascript directory.

> package all features in a single jar, load from classpath
> ---------------------------------------------------------
>
>                 Key: SHINDIG-269
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-269
>             Project: Shindig
>          Issue Type: Improvement
>          Components: Features (Javascript), Gadget Rendering Server (Java)
>            Reporter: Henning Schmiedehausen
>         Attachments: javascript-jar.patch
>
>
> The attached patch creates a Maven project for the features directory. This allows automatic packaging up of the features into a single jar, which then can be placed on the classpath for the gadget server and the demo container. 
> This removes the need for the various javascript related plugins from the gadget rendering server and also a number of the cross-project linking and copying. The features directory itself is not modified, so the PHP version should still run fine. 
> In the long run, it might be good to move the features out of the root directory and into e.g. src/javascript to allow better control of the jar creation. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (SHINDIG-269) package all features in a single jar, load from classpath

Posted by "Kevin Brown (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SHINDIG-269?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kevin Brown closed SHINDIG-269.
-------------------------------

    Resolution: Fixed

Applied patch as is, but removed <includes> so that all files are always pulled in.

> package all features in a single jar, load from classpath
> ---------------------------------------------------------
>
>                 Key: SHINDIG-269
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-269
>             Project: Shindig
>          Issue Type: Improvement
>          Components: Features (Javascript), Gadget Rendering Server (Java)
>            Reporter: Henning Schmiedehausen
>         Attachments: javascript-jar.patch
>
>
> The attached patch creates a Maven project for the features directory. This allows automatic packaging up of the features into a single jar, which then can be placed on the classpath for the gadget server and the demo container. 
> This removes the need for the various javascript related plugins from the gadget rendering server and also a number of the cross-project linking and copying. The features directory itself is not modified, so the PHP version should still run fine. 
> In the long run, it might be good to move the features out of the root directory and into e.g. src/javascript to allow better control of the jar creation. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.