jdeb
jdeb copied to clipboard
Architecture not set on file correctly
In debian control file I set:
Package: [[debian.package.name]]-[[debian.package.version]]
Version: [[debian.package.version]]
Section: admin
Priority: optional
Depends: [[debian.package.dependencies]]
Architecture: amd64
Maintainer: xxx
Description: [[debian.package.description]]
Distribution: [[debian.package.distribution]]
But the file has name like
project-name_version_all.deb
I'm not sure it's an issue or I cannot configure it properly.
https://github.com/tcurdt/jdeb/blob/master/src/main/java/org/vafer/jdeb/maven/DebMojo.java#L80 - here is the problem. It may be hard to extract it from control file so maybe it would be nice to add maven architecture property which fills control file?
yep would be even better if within an execution could control the architecture. Also for packaging up java projects which have native code - such as a JSW wrapper, would want to be able to control what files are included based on the architecture. Just like the rpm maven plugin does with the targetArchitecture in the source definition.
I guess that counts as request for improvement :)
btw, for now I'm just overriding the name with
<deb>${project.artifactId}-${project.version}_amd64.deb</deb>
And also I do in the control file.
right - it would still be better to pass this though
I was not able to successfully use the workaround for defining
@TuireHolappa you have to be a little more specific in case you want help.
No help needed I just wanted to inform you the situation.
The workaround for setting the
Caused by: org.vafer.jdeb.PackagingException: Failed to create debian package mysoftware-0.0.4-SNAPSHOT_i386.deb at org.vafer.jdeb.DebMaker.makeDeb(DebMaker.java:333) at org.vafer.jdeb.maven.DebMojo.execute(DebMojo.java:567) ... 22 more Caused by: org.vafer.jdeb.PackagingException: Could not create deb package at org.vafer.jdeb.DebMaker.createSignedDeb(DebMaker.java:554) at org.vafer.jdeb.DebMaker.createDeb(DebMaker.java:448) at org.vafer.jdeb.DebMaker.makeDeb(DebMaker.java:329) ... 23 more Caused by: java.lang.NullPointerException at org.vafer.jdeb.DebMaker.createSignedDeb(DebMaker.java:499)
So I ended up using a dirty solution of renaming the .deb file afterwards
So the functionality to take the architecture to the file name from the configuration (control or even more preferably from Maven configuration to both) would be appreciated.
2016-08-26 13:04 GMT+03:00 Torsten Curdt [email protected]:
@TuireHolappa https://github.com/TuireHolappa you have to be a little more specific in case you want help.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/tcurdt/jdeb/issues/180#issuecomment-242688386, or mute the thread https://github.com/notifications/unsubscribe-auth/ANOmDD3mJZ9SPrIwY3_QMPA3a7U-o3gYks5qjro6gaJpZM4CYtk4 .
I would check why this is happening - but this stacktrace either does not match master or is cut off
Caused by: java.lang.NullPointerException
at org.vafer.jdeb.DebMaker.createSignedDeb(DebMaker.java:499)
I suspect it could be related to the -SNAPSHOT in the version instead of the normally produced ~SNAPSHOT.
The jdeb version is 1.5 and otherwise it works nicely :). I really like it and hope it will be accepted to be taken it in to use in our projects.
Yes I did cut the trace. Sorry. Here the whole thing:
[ERROR] Failed to execute goal org.vafer:jdeb:1.5:jdeb (default) on project train-topology-data: Failed to create debian package mypackage-0 .0.4-SNAPSHOT_i386.deb: Could not create deb package: NullPointerException -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.vafer:jdeb:1.5:jdeb (default) on project mypackage: Faile d to create debian package mypackage-0.0.4-SNAPSHOT_i386.deb at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288) at org.apache.maven.cli.MavenCli.main(MavenCli.java:199) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to create debian package mypackage-0.0.4-SNAPSHOT_i386.deb at org.vafer.jdeb.maven.DebMojo.execute(DebMojo.java:581) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207) ... 20 more Caused by: org.vafer.jdeb.PackagingException: Failed to create debian package mypackage-0.0.4-SNAPSHOT_i386.deb at org.vafer.jdeb.DebMaker.makeDeb(DebMaker.java:333) at org.vafer.jdeb.maven.DebMojo.execute(DebMojo.java:567) ... 22 more Caused by: org.vafer.jdeb.PackagingException: Could not create deb package at org.vafer.jdeb.DebMaker.createSignedDeb(DebMaker.java:554) at org.vafer.jdeb.DebMaker.createDeb(DebMaker.java:448) at org.vafer.jdeb.DebMaker.makeDeb(DebMaker.java:329) ... 23 more Caused by: java.lang.NullPointerException at org.vafer.jdeb.DebMaker.createSignedDeb(DebMaker.java:499) ... 25 more
2016-08-26 14:32 GMT+03:00 Torsten Curdt [email protected]:
I would check why this is happening - but this stacktrace either does not match master or is cut off
Caused by: java.lang.NullPointerException at org.vafer.jdeb.DebMaker.createSignedDeb(DebMaker.java:499)
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/tcurdt/jdeb/issues/180#issuecomment-242709300, or mute the thread https://github.com/notifications/unsubscribe-auth/ANOmDAYzchuMIM2jM8RookSnP-j_cgO7ks5qjs7SgaJpZM4CYtk4 .
So here is where it fails
deb.getParentFile().mkdirs();
https://docs.oracle.com/javase/7/docs/api/java/io/File.html#getParentFile()
Returns the abstract pathname of this abstract pathname's parent, or null if this pathname does not name a parent directory. The parent of an abstract pathname consists of the pathname's prefix, if any, and each name in the pathname's name sequence except for the last. If the name sequence is empty then the pathname does not name a parent directory.
So either deb
is null
or getParentFile
returns null
(which jdeb
should check and is not).
@tcurdt @TuireHolappa I had the same issue until I added the directory name in the deb
field.
e.g. <deb>${project.build.directory}/foobar.deb</deb>