fvarrui / JavaPackager

:package: Gradle/Maven plugin to package Java applications as native Windows, MacOS, or Linux executables and create installers for them.
GNU General Public License v3.0
1.07k stars 133 forks source link

Missing or wrong launch4j dependency #378

Closed Pesegato closed 11 months ago

Pesegato commented 1 year ago

I'm submitting a…

Short description of the issue/suggestion:

This dependency does not exists on Maven Central, so unless you have something on maven local, version 1.7.3+ won't run

implementation 'edu.sc.seis.launch4j:launch4j:2.5.2'

Steps to reproduce the issue/enhancement:

  1. create a project that uses version 1.7.4 on a brand new machine
  2. run gradle
  3. gradle will complain for the missing dependency

What is the expected behavior?

To resolve the dependency

What is the current behavior?

To not resolve the dependency

Do you have outputs, screenshots, demos or samples which demonstrate the problem or enhancement?

Could not determine the dependencies of null. Could not resolve all task dependencies for configuration ':classpath'. Could not find edu.sc.seis.launch4j:launch4j:2.5.2. Searched in the following locations:

What is the motivation / use case for changing the behavior?

See above

Please tell us about your environment:

Other information (e.g. related issues, suggestions how to fix, links for us to have context)

fvarrui commented 12 months ago

Hi @Pesegato! thanks for reporting this issue ... I'm trying to figure out what's wrong.

fvarrui commented 12 months ago

Sorry, I'm not able to reproduce your issue. I've just build a sample project with JP 1.7.5 without problems, after removing launch4j-2.5.2.jar from my local repo.

This library is not on Maven Central, but in Gradle Portal, and this repo is specified in JP's POM:

<repositories>
    <repository>
      <id>gradle</id>
      <name>Gradle Plugin Portal</name>
      <url>https://plugins.gradle.org/m2/</url>
    </repository>
  </repositories>

image

I've also seen that this dependency is resolved when building the plugin:

C:\Users\fvarrui\.m2\repository>tree /f edu
Listado de rutas de carpetas
El número de serie del volumen es C8BB-EDFA
C:\USERS\FVARRUI\.M2\REPOSITORY\EDU
└───sc
    └───seis
        └───launch4j
            └───launch4j
                └───2.5.2
                        launch4j-2.5.2.jar
                        launch4j-2.5.2.jar.sha1
                        launch4j-2.5.2.pom
                        launch4j-2.5.2.pom.sha1
                        _remote.repositories

Just build JP on a freshly installed Windows

Pesegato commented 12 months ago

Thank you, it was my fault of searching the library on Maven Central.

Pesegato commented 12 months ago

Still, the README is incorrect. The build.gradle should be:

plugins {
    id 'io.github.fvarrui.javapackager.plugin' version '1.7.5'
    id 'edu.sc.seis.launch4j' version '2.5.2'
}
fvarrui commented 11 months ago

Hi @Pesegato! I'm happy that you had managed to fix it!! 😃

Have you tried this way?

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'io.github.fvarrui:javapackager:1.7.5'
    }
}

apply plugin: 'io.github.fvarrui.javapackager.plugin'

As is explained in README.

Pesegato commented 11 months ago

Oh this works. I probably have a messy build.gradle, with multiple plugin blocks. Thanks!