having problems installing local dependency via GitHub Actions

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

having problems installing local dependency via GitHub Actions

Alex Ford
I have been trying to automate testing for our Maven project on GitHub
using Actions, but we have a local dependency and the install:install-file
command seems to be generating the path incorrectly. It doesn't do this on
my own Windows machine, so I'm at a loss on what it's doing, or why, and
how to fix it.

I give it the following command:
mvn install:install-file  -Dfile=libs/jfreechart-1.0.19.jar
-DgroupId=com.jfreechart.1 -DartifactId=jfreechart-1 -Dversion=1.0.19
-Dpackaging=jar -DgeneratePom=true

And when I look at the error messages, it says this:
Error:  The specified file 'D:\a\bt\bt\OUGS_java_code\libs\jfreechart-1'
not exists

I haven't been able to figure out why it seems to be using the artifact id
instead of the full path; this is also the result after a few weeks of
messing around with the repository structure, during which it came up with
several other paths that were even less similar to the file path in the
command. I tried changing the artifact ID to match the path, but it's
coming up with the exact same path in the error; the POM file doesn't let
me use the path as the artifact ID because it's the wrong structure, so I'm
not sure if that's where it's trying to pull the path from??

The dependency definition matches what I'm putting into the install command
above, here's the block:
        <dependency>
            <groupId>com.jcommon.1</groupId>
            <artifactId>jcommon-1.jar</artifactId>
            <version>1.0.23</version>
        </dependency>

I feel like I'm going crazy at this point because again, it works FINE on
my local computer. Actions is set to use the latest version of Windows &
JDK 8, and from the log it looks to be using Maven 2.5.2. If there's more
information I can provide please let me know, I just really have no idea
what else to even try at this point.
Reply | Threaded
Open this post in threaded view
|

Re: having problems installing local dependency via GitHub Actions

Tamás Cservenák
Howdy,

Am just shooting in the dark, am actually unsure how GH Action "local repo"
behaves, but
you might be installing your dep and THEN getting local repo from cache
action maybe?

Do you use cache action? If so, is it invoked before or after you install
this local depo?

T

On Tue, Jan 19, 2021 at 8:04 AM Alex Ford <[hidden email]> wrote:

> I have been trying to automate testing for our Maven project on GitHub
> using Actions, but we have a local dependency and the install:install-file
> command seems to be generating the path incorrectly. It doesn't do this on
> my own Windows machine, so I'm at a loss on what it's doing, or why, and
> how to fix it.
>
> I give it the following command:
> mvn install:install-file  -Dfile=libs/jfreechart-1.0.19.jar
> -DgroupId=com.jfreechart.1 -DartifactId=jfreechart-1 -Dversion=1.0.19
> -Dpackaging=jar -DgeneratePom=true
>
> And when I look at the error messages, it says this:
> Error:  The specified file 'D:\a\bt\bt\OUGS_java_code\libs\jfreechart-1'
> not exists
>
> I haven't been able to figure out why it seems to be using the artifact id
> instead of the full path; this is also the result after a few weeks of
> messing around with the repository structure, during which it came up with
> several other paths that were even less similar to the file path in the
> command. I tried changing the artifact ID to match the path, but it's
> coming up with the exact same path in the error; the POM file doesn't let
> me use the path as the artifact ID because it's the wrong structure, so I'm
> not sure if that's where it's trying to pull the path from??
>
> The dependency definition matches what I'm putting into the install command
> above, here's the block:
>         <dependency>
>             <groupId>com.jcommon.1</groupId>
>             <artifactId>jcommon-1.jar</artifactId>
>             <version>1.0.23</version>
>         </dependency>
>
> I feel like I'm going crazy at this point because again, it works FINE on
> my local computer. Actions is set to use the latest version of Windows &
> JDK 8, and from the log it looks to be using Maven 2.5.2. If there's more
> information I can provide please let me know, I just really have no idea
> what else to even try at this point.
>
Reply | Threaded
Open this post in threaded view
|

RE: having problems installing local dependency via GitHub Actions

Jeremy Landis
In reply to this post by Alex Ford
Just curious, why are those specifically being installed in that way?  Both are available in maven central as-is.  groupId you are using is wrong but they are in central.

At any rate, the location noted on github actions is where your repo is cloned to.  Its just stating that the file doesn't exist.  As you noted, you are using github actions on windows node.  You need to quote around the entries where you have periods.  You can sort of see that by the fact that .jar is missing from the artifact.

Example.

mvn install:install-file  -Dfile="libs/jfreechart-1.0.19.jar" -DgroupId="com.jfreechart.1" -DartifactId=jfreechart-1 -Dversion="1.0.19" -Dpackaging=jar -DgeneratePom=true

-----Original Message-----
From: Alex Ford <[hidden email]>
Sent: Monday, January 18, 2021 12:59 PM
To: [hidden email]
Subject: having problems installing local dependency via GitHub Actions

I have been trying to automate testing for our Maven project on GitHub using Actions, but we have a local dependency and the install:install-file command seems to be generating the path incorrectly. It doesn't do this on my own Windows machine, so I'm at a loss on what it's doing, or why, and how to fix it.

I give it the following command:
mvn install:install-file  -Dfile=libs/jfreechart-1.0.19.jar
-DgroupId=com.jfreechart.1 -DartifactId=jfreechart-1 -Dversion=1.0.19 -Dpackaging=jar -DgeneratePom=true

And when I look at the error messages, it says this:
Error:  The specified file 'D:\a\bt\bt\OUGS_java_code\libs\jfreechart-1'
not exists

I haven't been able to figure out why it seems to be using the artifact id instead of the full path; this is also the result after a few weeks of messing around with the repository structure, during which it came up with several other paths that were even less similar to the file path in the command. I tried changing the artifact ID to match the path, but it's coming up with the exact same path in the error; the POM file doesn't let me use the path as the artifact ID because it's the wrong structure, so I'm not sure if that's where it's trying to pull the path from??

The dependency definition matches what I'm putting into the install command above, here's the block:
        <dependency>
            <groupId>com.jcommon.1</groupId>
            <artifactId>jcommon-1.jar</artifactId>
            <version>1.0.23</version>
        </dependency>

I feel like I'm going crazy at this point because again, it works FINE on my local computer. Actions is set to use the latest version of Windows & JDK 8, and from the log it looks to be using Maven 2.5.2. If there's more information I can provide please let me know, I just really have no idea what else to even try at this point.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]