You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by Karan Malhi <ka...@gmail.com> on 2011/06/01 05:25:17 UTC
Re: IDE specific examples
I think an all-in-one jar would be great for examples.
On Tue, May 31, 2011 at 3:34 PM, David Blevins <da...@gmail.com>wrote:
>
> On May 31, 2011, at 12:15 PM, Romain Manni-Bucau wrote:
>
> > i don't really like all in one jars, it doesn't help the user to
> understand
> > IMHO.
>
> I don't care for them much myself, mostly because you get a lot of other
> dependencies and have pretty much no way to remove them.
>
> But I'm sure some people will find them useful. A lot of people really
> like the all in one javaee-api jar.
>
>
> -David
>
> > 2011/5/31 David Blevins <da...@gmail.com>
> >
> >>
> >> On May 31, 2011, at 11:03 AM, Romain Manni-Bucau wrote:
> >>
> >>> ok so we simply need to add a dependency:copy-dependencies + a sed.
> >>
> >> Sed or perl or some such magic. Or we grab a copy of the plugin and
> change
> >> the code to our needs. Or we add this feature to the plugins
> themselves.
> >> Or since most of the projects have the same classpath -- all of them
> need
> >> the same libraries -- maybe just generate it once and copy it into each
> >> example and sed/perl the project name.
> >>
> >> Side note, we have this all-in-one jar now. We might be able to start
> >> switching examples over to it.
> >>
> >>
> >>
> http://svn.apache.org/repos/asf/openejb/trunk/openejb3/assembly/openejb-lite/
> >>
> >> At least it would make the manual setup of projects easier. We could
> make
> >> more of those kinds of all-in-one jars that contain different chunks of
> >> features, perhaps webservices, jms, remoting, etc.
> >>
> >>
> >> -David
> >>
> >>> 2011/5/31 David Blevins <da...@gmail.com>
> >>>
> >>>>
> >>>> On May 30, 2011, at 11:42 PM, Romain Manni-Bucau wrote:
> >>>>
> >>>>> It is still a bit hard for me to understand what is the goal of it? a
> >>>> simple
> >>>>> hook calling maven is enough i think, no?
> >>>>>
> >>>>> hook could look like (i didn't test it, it is just the idea):
> >>>>>
> >>>>> for ide in $(cat $IDE_LIST); do
> >>>>> cd $FOLDER
> >>>>> mvn $ide:$ide
> >>>>> svn status | grep '^\?' | cut -d " " -f 8 | xargs -i -t cp {} $ide
> >>>>> svn revert -R .
> >>>>> done
> >>>>
> >>>> Only issue with that is the generated project requires a maven repo.
> >> There
> >>>> might still be some way we can use that technique, but the goal would
> be
> >> to
> >>>> have all the required libraries in the examples zip and all the
> >> generated
> >>>> projects setup to use those libraries.
> >>>>
> >>>> -David
> >>>>
> >>>>> 2011/5/31 David Blevins <da...@gmail.com>
> >>>>>
> >>>>>> Great way to take things a step further :)
> >>>>>>
> >>>>>> If we did everything this way we might have better documentation :)
> >>>>>>
> >>>>>> -David
> >>>>>>
> >>>>>> On May 30, 2011, at 7:13 PM, kmalhi@apache.org wrote:
> >>>>>>
> >>>>>>> Author: kmalhi
> >>>>>>> Date: Tue May 31 02:13:47 2011
> >>>>>>> New Revision: 1129468
> >>>>>>>
> >>>>>>> URL: http://svn.apache.org/viewvc?rev=1129468&view=rev
> >>>>>>> Log:
> >>>>>>> Adding a project to build ide-specific-examples bundle
> >>>>>>>
> >>>>>>> Added:
> >>>>>>> openejb/trunk/sandbox/ide-specific-examples/
> >>>>>>> openejb/trunk/sandbox/ide-specific-examples/README.txt
> >>>>>>>
> >>>>>>> Added: openejb/trunk/sandbox/ide-specific-examples/README.txt
> >>>>>>> URL:
> >>>>>>
> >>>>
> >>
> http://svn.apache.org/viewvc/openejb/trunk/sandbox/ide-specific-examples/README.txt?rev=1129468&view=auto
> >>>>>>>
> >>>>>>
> >>>>
> >>
> ==============================================================================
> >>>>>>> --- openejb/trunk/sandbox/ide-specific-examples/README.txt (added)
> >>>>>>> +++ openejb/trunk/sandbox/ide-specific-examples/README.txt Tue May
> 31
> >>>>>> 02:13:47 2011
> >>>>>>> @@ -0,0 +1,13 @@
> >>>>>>> +Here is a perspective on why we might want to generate IDE
> examples
> >>>> zip
> >>>>>> separately, "in addition to " the maven archetypes, ant samples.
> >>>>>>> +
> >>>>>>> +Following is taken from a dev list discussion:
> >>>>>>> +
> >>>>>>> +We also need to keep the user in mind - specially the one who does
> >>>> most
> >>>>>> of their learning at work. I teach for a living and at client sites,
> I
> >>>>>> cannot run maven - downloading jars is an issue. Nobody uses
> >> subversion
> >>>> - a
> >>>>>> very famous commercial SCM is used . Automated downloading of stuff
> >> from
> >>>>>> central repo is totally blocked and you can get into a lot of
> trouble
> >>>> for
> >>>>>> attempting to bypass security. These are financial and insurance
> firms
> >>>> and
> >>>>>> due to legal requirements, they cannot have a desktop configuration
> of
> >>>> their
> >>>>>> choice, they have to meet certain very stringent security
> parameters.
> >> If
> >>>> i
> >>>>>> need to show openejb examples, I have to show them on my laptop.
> Prior
> >>>> to
> >>>>>> coming to class, I have to run the examples on my laptop and
> download
> >>>>>> dependencies, since i am not allowed to connect my laptop to the
> >> network
> >>>> or
> >>>>>> plugin a CD/floppy/USB on the client machine.
> >>>>>>> +
> >>>>>>> +What I can do though is get a pre-approved set of zip files and
> put
> >>>> them
> >>>>>> on a share, so that they can access it and use it. It becomes even
> >>>> easier to
> >>>>>> utilize that zip if it is known that it is for education and
> learning
> >>>> and
> >>>>>> none of those jars are permitted to be used in the real project
> until
> >>>> that
> >>>>>> particular software/jar is formally approved.
> >>>>>>> +
> >>>>>>> +Getting a pre-approved zip also sometimes takes its own sweet
> time,
> >>>>>> thats why having the ability to browse our examples online is just
> >>>>>> fantastic. People might not get to run them immediately, but they
> add
> >> a
> >>>>>> great value to folks who cannot download stuff on their work
> machines.
> >>>>>>> +
> >>>>>>> + So imagine we putting up all these maven archetypes, maven based
> >>>>>> projects and quite a few folks do not get to use our examples at
> work.
> >>>>>> Maven, ant , subversion are great ways to share examples, no doubt
> >> about
> >>>>>> that. I fully agree with you on the demerits of putting IDE files
> into
> >>>>>> subversion (although in some cases - specially in a learning
> >> environment
> >>>> it
> >>>>>> is easier and does make sense to put them in svn - wont go there at
> >> this
> >>>>>> moment).
> >>>>>>> +
> >>>>>>> +As for support for maven in IDE's, thats great, but again, 100% of
> >> the
> >>>>>> companies I go to use eclipse based IDE's. How many are open to
> >>>> installing a
> >>>>>> plugin of your choice like m2eclipse? -- 10% probably, others are
> >> pretty
> >>>>>> locked down. So even though Intellij and Netbeans have fantastic
> >> support
> >>>> and
> >>>>>> m2eclipse is awesome, the truth out there is that all the above
> >> software
> >>>> can
> >>>>>> only be installed on a personal laptop, in a corporate environment -
> >>>>>> specially certain verticals, its a challenge.
> >>>>>>> \ No newline at end of file
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>
> >>>>>>
> >>>>
> >>>>
> >>
> >>
>
>
--
Karan Singh Malhi
Re: IDE specific examples
Posted by Romain Manni-Bucau <rm...@gmail.com>.
IDEA needs work, i don't have netbeans today to work on it should work for
eclipse.
#! /bin/bash
TMP=/tmp
# ide specific files exclude from svn so it doesn't work
# svn status | grep '?' | cut -d " " -f 8 | xargs -i cp -R {} $current
#
# TODO: with this script IDE specific files are generated into $TMP/$ide
# => it uses ./libs/ folder, should we zip it? zip all the example?
#
IDEA_FILES="iws iml ipr"
ECLIPSE_FILES=".settings .project .classpath"
cd examples
for ide in $IDE; do
for i in $(grep '<module>' pom.xml | sed 's#
*<module>\(.*\)</module>#\1#g'); do
echo "generating $i";
cd $i;
mkdir libs
mvn dependency:copy-dependencies -DoutputDirectory=libs
mvn idea:idea
current="$TMP/$i/idea"
mkdir $current
sed -i 's#jar://.*/\(.*\)!#libs/\1!#g' *.iml
sed -i
's#org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true"#org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="false"#g'
*.iml # should be totally removed, maybe it is easier to generated the whole
idea file than to use the maven plugin
for ext in $IDEA_FILES; do
find . -name "*.$ext" | xargs -i cp {} $current
done
mvn eclipse:eclipse
current="$TMP/$i/eclipse"
mkdir $current
sed -i 's#M2_REPO/.*/\(.*\).jar#libs/\1.jar#g' .classpath
for file in $ECLIPSE_FILES; do
find . -name "$file" | xargs -i cp {} $current
done
cd-;
done
done
echo "ide specific files generated in $TMP"
2011/6/1 Karan Malhi <ka...@gmail.com>
> I think an all-in-one jar would be great for examples.
>
> On Tue, May 31, 2011 at 3:34 PM, David Blevins <david.blevins@gmail.com
> >wrote:
>
> >
> > On May 31, 2011, at 12:15 PM, Romain Manni-Bucau wrote:
> >
> > > i don't really like all in one jars, it doesn't help the user to
> > understand
> > > IMHO.
> >
> > I don't care for them much myself, mostly because you get a lot of other
> > dependencies and have pretty much no way to remove them.
> >
> > But I'm sure some people will find them useful. A lot of people really
> > like the all in one javaee-api jar.
> >
> >
> > -David
> >
> > > 2011/5/31 David Blevins <da...@gmail.com>
> > >
> > >>
> > >> On May 31, 2011, at 11:03 AM, Romain Manni-Bucau wrote:
> > >>
> > >>> ok so we simply need to add a dependency:copy-dependencies + a sed.
> > >>
> > >> Sed or perl or some such magic. Or we grab a copy of the plugin and
> > change
> > >> the code to our needs. Or we add this feature to the plugins
> > themselves.
> > >> Or since most of the projects have the same classpath -- all of them
> > need
> > >> the same libraries -- maybe just generate it once and copy it into
> each
> > >> example and sed/perl the project name.
> > >>
> > >> Side note, we have this all-in-one jar now. We might be able to start
> > >> switching examples over to it.
> > >>
> > >>
> > >>
> >
> http://svn.apache.org/repos/asf/openejb/trunk/openejb3/assembly/openejb-lite/
> > >>
> > >> At least it would make the manual setup of projects easier. We could
> > make
> > >> more of those kinds of all-in-one jars that contain different chunks
> of
> > >> features, perhaps webservices, jms, remoting, etc.
> > >>
> > >>
> > >> -David
> > >>
> > >>> 2011/5/31 David Blevins <da...@gmail.com>
> > >>>
> > >>>>
> > >>>> On May 30, 2011, at 11:42 PM, Romain Manni-Bucau wrote:
> > >>>>
> > >>>>> It is still a bit hard for me to understand what is the goal of it?
> a
> > >>>> simple
> > >>>>> hook calling maven is enough i think, no?
> > >>>>>
> > >>>>> hook could look like (i didn't test it, it is just the idea):
> > >>>>>
> > >>>>> for ide in $(cat $IDE_LIST); do
> > >>>>> cd $FOLDER
> > >>>>> mvn $ide:$ide
> > >>>>> svn status | grep '^\?' | cut -d " " -f 8 | xargs -i -t cp {} $ide
> > >>>>> svn revert -R .
> > >>>>> done
> > >>>>
> > >>>> Only issue with that is the generated project requires a maven repo.
> > >> There
> > >>>> might still be some way we can use that technique, but the goal
> would
> > be
> > >> to
> > >>>> have all the required libraries in the examples zip and all the
> > >> generated
> > >>>> projects setup to use those libraries.
> > >>>>
> > >>>> -David
> > >>>>
> > >>>>> 2011/5/31 David Blevins <da...@gmail.com>
> > >>>>>
> > >>>>>> Great way to take things a step further :)
> > >>>>>>
> > >>>>>> If we did everything this way we might have better documentation
> :)
> > >>>>>>
> > >>>>>> -David
> > >>>>>>
> > >>>>>> On May 30, 2011, at 7:13 PM, kmalhi@apache.org wrote:
> > >>>>>>
> > >>>>>>> Author: kmalhi
> > >>>>>>> Date: Tue May 31 02:13:47 2011
> > >>>>>>> New Revision: 1129468
> > >>>>>>>
> > >>>>>>> URL: http://svn.apache.org/viewvc?rev=1129468&view=rev
> > >>>>>>> Log:
> > >>>>>>> Adding a project to build ide-specific-examples bundle
> > >>>>>>>
> > >>>>>>> Added:
> > >>>>>>> openejb/trunk/sandbox/ide-specific-examples/
> > >>>>>>> openejb/trunk/sandbox/ide-specific-examples/README.txt
> > >>>>>>>
> > >>>>>>> Added: openejb/trunk/sandbox/ide-specific-examples/README.txt
> > >>>>>>> URL:
> > >>>>>>
> > >>>>
> > >>
> >
> http://svn.apache.org/viewvc/openejb/trunk/sandbox/ide-specific-examples/README.txt?rev=1129468&view=auto
> > >>>>>>>
> > >>>>>>
> > >>>>
> > >>
> >
> ==============================================================================
> > >>>>>>> --- openejb/trunk/sandbox/ide-specific-examples/README.txt
> (added)
> > >>>>>>> +++ openejb/trunk/sandbox/ide-specific-examples/README.txt Tue
> May
> > 31
> > >>>>>> 02:13:47 2011
> > >>>>>>> @@ -0,0 +1,13 @@
> > >>>>>>> +Here is a perspective on why we might want to generate IDE
> > examples
> > >>>> zip
> > >>>>>> separately, "in addition to " the maven archetypes, ant samples.
> > >>>>>>> +
> > >>>>>>> +Following is taken from a dev list discussion:
> > >>>>>>> +
> > >>>>>>> +We also need to keep the user in mind - specially the one who
> does
> > >>>> most
> > >>>>>> of their learning at work. I teach for a living and at client
> sites,
> > I
> > >>>>>> cannot run maven - downloading jars is an issue. Nobody uses
> > >> subversion
> > >>>> - a
> > >>>>>> very famous commercial SCM is used . Automated downloading of
> stuff
> > >> from
> > >>>>>> central repo is totally blocked and you can get into a lot of
> > trouble
> > >>>> for
> > >>>>>> attempting to bypass security. These are financial and insurance
> > firms
> > >>>> and
> > >>>>>> due to legal requirements, they cannot have a desktop
> configuration
> > of
> > >>>> their
> > >>>>>> choice, they have to meet certain very stringent security
> > parameters.
> > >> If
> > >>>> i
> > >>>>>> need to show openejb examples, I have to show them on my laptop.
> > Prior
> > >>>> to
> > >>>>>> coming to class, I have to run the examples on my laptop and
> > download
> > >>>>>> dependencies, since i am not allowed to connect my laptop to the
> > >> network
> > >>>> or
> > >>>>>> plugin a CD/floppy/USB on the client machine.
> > >>>>>>> +
> > >>>>>>> +What I can do though is get a pre-approved set of zip files and
> > put
> > >>>> them
> > >>>>>> on a share, so that they can access it and use it. It becomes even
> > >>>> easier to
> > >>>>>> utilize that zip if it is known that it is for education and
> > learning
> > >>>> and
> > >>>>>> none of those jars are permitted to be used in the real project
> > until
> > >>>> that
> > >>>>>> particular software/jar is formally approved.
> > >>>>>>> +
> > >>>>>>> +Getting a pre-approved zip also sometimes takes its own sweet
> > time,
> > >>>>>> thats why having the ability to browse our examples online is just
> > >>>>>> fantastic. People might not get to run them immediately, but they
> > add
> > >> a
> > >>>>>> great value to folks who cannot download stuff on their work
> > machines.
> > >>>>>>> +
> > >>>>>>> + So imagine we putting up all these maven archetypes, maven
> based
> > >>>>>> projects and quite a few folks do not get to use our examples at
> > work.
> > >>>>>> Maven, ant , subversion are great ways to share examples, no doubt
> > >> about
> > >>>>>> that. I fully agree with you on the demerits of putting IDE files
> > into
> > >>>>>> subversion (although in some cases - specially in a learning
> > >> environment
> > >>>> it
> > >>>>>> is easier and does make sense to put them in svn - wont go there
> at
> > >> this
> > >>>>>> moment).
> > >>>>>>> +
> > >>>>>>> +As for support for maven in IDE's, thats great, but again, 100%
> of
> > >> the
> > >>>>>> companies I go to use eclipse based IDE's. How many are open to
> > >>>> installing a
> > >>>>>> plugin of your choice like m2eclipse? -- 10% probably, others are
> > >> pretty
> > >>>>>> locked down. So even though Intellij and Netbeans have fantastic
> > >> support
> > >>>> and
> > >>>>>> m2eclipse is awesome, the truth out there is that all the above
> > >> software
> > >>>> can
> > >>>>>> only be installed on a personal laptop, in a corporate environment
> -
> > >>>>>> specially certain verticals, its a challenge.
> > >>>>>>> \ No newline at end of file
> > >>>>>>>
> > >>>>>>>
> > >>>>>>>
> > >>>>>>
> > >>>>>>
> > >>>>
> > >>>>
> > >>
> > >>
> >
> >
>
>
> --
> Karan Singh Malhi
>