IT/Software career thread: Invert binary trees for dollars.

Deathwing

<Bronze Donator>
16,379
7,383
Need some help from Java experts. Knowing SCons might help too.

I'm trying to create a top-level jar from other jars and some classes I compiled. I don't want actual jarA in jarB, I want jarA's contents at the top level of jarB. It doesn't seem possible from the jar command itself and that only ant(the build I'm trying to translate into SCons) with <zipgroupfileset> and maven can do this kind of jaring natively.

So, if this isn't possible in SCons or the jar command...is there an elegant way of doing this? SCons is basically Python, so that's what I have available.
 

Cad

<Bronze Donator>
24,487
45,378
As I remember jars are just zip files. Unpack the jars you want to include and put the class files wherever you want and then re-jar all that together. Am I misunderstanding what you want?
 

Deathwing

<Bronze Donator>
16,379
7,383
No, that's it, was just hoping there was a less manual way. Seems like something that should be more easily automated in popular build systems.
 

alavaz

Trakanon Raider
2,001
713
Can you run a script as part of your build process? Seems easy enough to script out the unzip, copy extra stuff and re-jar steps.
 

Deathwing

<Bronze Donator>
16,379
7,383
Yeah, that parts easy even if it is annoyingly not automated. What I'd really prefer to have automated is the handling of information in META-INF. Did you know you can hide dependencies via the 'Class Path' field in manifest.mf?
 

Tenks

Bronze Knight of the Realm
14,163
606
Need some help from Java experts. Knowing SCons might help too.

I'm trying to create a top-level jar from other jars and some classes I compiled. I don't want actual jarA in jarB, I want jarA's contents at the top level of jarB. It doesn't seem possible from the jar command itself and that only ant(the build I'm trying to translate into SCons) with <zipgroupfileset> and maven can do this kind of jaring natively.

So, if this isn't possible in SCons or the jar command...is there an elegant way of doing this? SCons is basically Python, so that's what I have available.


I *think* what you're asking for is shading your JAR. Try the maven shade plugin.
 

Deathwing

<Bronze Donator>
16,379
7,383
Trying not to use another build system if possible. While SCons is great for building everything, it's not great at building everything. For now, we're stuffing all the dependency jars into our third-party folder and I'm going to alter the class-path in the manifest to reference them. Which, of course, I'm now running into some of the silly restrictions Oracle has put on the manifest file. 72 character width...why that specific number?
 

Tenks

Bronze Knight of the Realm
14,163
606
Can you not call Maven from SCon? I have no experience with it but it sounds like if you're calling java jar you should be able to just call mvn package.
 

Tenks

Bronze Knight of the Realm
14,163
606
So instead they're telling you to cobble together home made scripts to try and be a ghetto maven? Sounds legit.
 

Deathwing

<Bronze Donator>
16,379
7,383
Part of the problem is how do you expose dependencies to SCons that maven or ant would inherently handle?
 

Eidal

Molten Core Raider
2,001
213
Anyone here familiar with C++ enough to give me some advice on a project? It's a 300 level class on OOP.
 

Deathwing

<Bronze Donator>
16,379
7,383
I'm familiar with C++, not an expert though. There's bound to be at least a few here. Ask away, I'm sure others will like figuring it out anyway.
 

agripa

Molten Core Raider
587
498
One of our new security analyst's defaced our company's blog with a newly released exploit hoping to get a promotion by showing that he could "hack" Needless to say he was shown the door, don't be daft man.
 
  • 3Like
Reactions: 2 users

chaos

Buzzfeed Editor
17,324
4,839
One of our new security analyst's defaced our company's blog with a newly released exploit hoping to get a promotion by showing that he could "hack" Needless to say he was shown the door, don't be daft man.
lolololol
priceless
 

Ao-

¯\_(ツ)_/¯
<WoW Guild Officer>
7,879
507
One of our new security analyst's defaced our company's blog with a newly released exploit hoping to get a promotion by showing that he could "hack" Needless to say he was shown the door, don't be daft man.
Bwahahahahahaha
 

LulzSect

Well-Known Memer
<Banned>
2,714
3,283
hey guys look i vandalized your bulletin board in the lunch room because you left a sharpie pen on the table

i deserve a promotion since i alerted you of this security exploit you failed to secure

:confused:
 
  • 1Like
Reactions: 1 user