Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Architecture not set on file correctly #180

Open
spinus opened this issue Aug 19, 2014 · 12 comments
Open

Architecture not set on file correctly #180

spinus opened this issue Aug 19, 2014 · 12 comments
Milestone

Comments

@spinus
Copy link

spinus commented Aug 19, 2014

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.

@spinus
Copy link
Author

spinus commented Aug 28, 2014

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?

@pellcorp
Copy link

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.

@tcurdt
Copy link
Owner

tcurdt commented Sep 19, 2014

I guess that counts as request for improvement :)

@spinus
Copy link
Author

spinus commented Sep 19, 2014

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.

@tcurdt
Copy link
Owner

tcurdt commented Sep 19, 2014

right - it would still be better to pass this though

@tcurdt tcurdt added this to the 1.4 milestone Dec 15, 2014
@tcurdt tcurdt modified the milestones: 2.0, 1.5 Jan 16, 2016
@TuireHolappa
Copy link

I was not able to successfully use the workaround for defining for SNAPSHOT builds.

@tcurdt
Copy link
Owner

tcurdt commented Aug 26, 2016

@TuireHolappa you have to be a little more specific in case you want help.

@TuireHolappa
Copy link

No help needed I just wanted to inform you the situation.

The workaround for setting the like in the comment from Spinus did
not work for with the -SNAPSHOT versions:

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 notifications@github.com:

@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
#180 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/ANOmDD3mJZ9SPrIwY3_QMPA3a7U-o3gYks5qjro6gaJpZM4CYtk4
.

@tcurdt
Copy link
Owner

tcurdt commented Aug 26, 2016

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)

@TuireHolappa
Copy link

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 notifications@github.com:

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
#180 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/ANOmDAYzchuMIM2jM8RookSnP-j_cgO7ks5qjs7SgaJpZM4CYtk4
.

@tcurdt
Copy link
Owner

tcurdt commented Aug 26, 2016

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).

@leif81
Copy link

leif81 commented Feb 20, 2018

@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>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants