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

Maven plugin fails if changesOut is set and points to a directory which doesn't exist #799

Open
alerosmile opened this issue Jan 3, 2025 · 3 comments

Comments

@alerosmile
Copy link
Contributor

The file stream is opened without ensuring that the parent directory for the changes file exists.

I'd also suggest to remove the default value for this parameter to get the same behavior as if the the DebMaker is used directly (use the name of the Debian file and not the artifact id).

What about a property to disable the generation of the changes file at all?

@tcurdt
Copy link
Owner

tcurdt commented Jan 4, 2025

I think it would be could to either give a proper error message or create the intermediate directories a la mkdir -p.

Switching from artifact id to the Debian file name I am hesitant. Unless I am missing something this could break a quite few build pipelines.

A property to disable the changes would be fine. But I would need to check the code. I cannot remember it being always generated.

@alerosmile
Copy link
Contributor Author

We could use Files.createDirectories(Path) for this.

If multiple Debian files are created in on project, the deb property must be set for each execution, otherwise they will overwrite each other. The same is true for the changesOut property. If you don't need the changes files, you either get ONE useless file or you have to overwrite the changesOut property. For this reason I suggested creating the file name from the Debian file name.

If I get an option to disable the creation of the changes file we can leave the rest as is and I'm fine. However, the directory for the change file should be created first.

Shall I create a PR for this?

@tcurdt
Copy link
Owner

tcurdt commented Jan 6, 2025

We could use Files.createDirectories(Path) for this.

+1

If multiple Debian files are created in on project, the deb property must be set for each execution, otherwise they will overwrite each other. The same is true for the changesOut property. If you don't need the changes files, you either get ONE useless file or you have to overwrite the changesOut property. For this reason I suggested creating the file name from the Debian file name.

But I am not even sure there are (m)any people create multiple Debian packages from a single maven project. And switching to the Debian file would be a breaking change. If we could find a migration path I might be open to the idea though.

If I get an option to disable the creation of the changes file we can leave the rest as is and I'm fine.

Since a changes files is optional I am happy to have switch for it.

However, the directory for the change file should be created first.
Shall I create a PR for this?

That would be great!

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

2 participants