Re: ImportError: No module named re

Michael Chisholm <[email protected]> Thu, 7 Jul 2016 19:27:41 -0400
Newsgroups gmane.comp.lang.jython.user
Message-ID <[email protected]>
On 7/7/2016 6:08 PM, Stefan Richthofer wrote:
> This looks like you placed a jar-file inside a jar-file.
> I never tried this, but I doubt that Jython (actually Java?) can handle such
> nesting of jars (maybe this feature was added and I am overlooking it, sorry in
> that case).

It's possible; spring-boot does it [1].  I guess with the ability to 
write custom classloaders, the sky's the limit :)

  According to
> http://www.jython.org/jythonbook/en/1.0/SimpleWebApps.html?highlight=explode#distributing-via-standalone-jar
> (which is somewhat dated though) you should "explode" jython-standalone, add
> your code-files and then jar it again. I suppose you would have to do this with
> your other dependencies too or distribute them as separate files.
> (Maybe you better try this with a toy-example first, before re-packing all the
> jars).

That's sometimes referred to as a "shaded" jar.  [1] mentions that 
approach too.

> Looking at this, the need for some kind of deployment-tool that would automate
> such a process comes to my mind. You should maybe check, whether such a thing
> already exists (maybe for Java-apps in general).

I know Maven has a plugin for it [2].  Other build tools might too.

I don't know if this is helpful for Ranga's actual problem, but from the 
quoted email, I thought it would be of interest.

Andy

1. 
http://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#executable-jar
2. http://maven.apache.org/plugins/maven-shade-plugin/



------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape