Pheotis
Pheotis
JCHJava Community | Help. Code. Learn.
Created by Pheotis on 9/25/2024 in #java-help
Regex on `finalName`
Currently my pom's finalName is ProjectName-${project.version}-${git.branch.caps}-${git.commit.id.abbrev} I want to run a regex replacement on the resolved version of that string before the project builds. Is this possible?
19 replies
JCHJava Community | Help. Code. Learn.
Created by Pheotis on 9/25/2024 in #java-help
Selective finalNames in Maven?
Currently, my pom's finalName is ProjectName-${project.version}-${git.branch.caps}-${git.commit.id.abbrev} I want to make it so that the -${git.commit.id.abbrev} is dropped from the end on every branch other than nightly. Does anyone know of a sane way to do that?
6 replies
JCHJava Community | Help. Code. Learn.
Created by Pheotis on 9/25/2024 in #java-help
Maven and Git?
I really want something like ${git.branch} in my maven pom's finalName. I would prefer not to need to replace the default install and default deploy. Is there still a way to do that, like there used to be, or am I stuck doing an annoying workaround?
4 replies
JCHJava Community | Help. Code. Learn.
Created by Pheotis on 6/17/2024 in #java-help
Gradle Translation
What is the gradle equivalent of this?
mvn org.apache.maven.plugins:maven-install-plugin:3.1.2:install-file -Dfile=LocalDependency.jar
mvn install
mvn org.apache.maven.plugins:maven-install-plugin:3.1.2:install-file -Dfile=LocalDependency.jar
mvn install
I'm a maven loyalist, but my team converted some of our stuff to gradle. I use this maven command in a docker script (which, of course, now doesn't work).
15 replies
JCHJava Community | Help. Code. Learn.
Created by Pheotis on 6/17/2024 in #java-help
Force install dependency.
I have a maven project with a dependency in the pom:
<dependency>
<groupId>tld.domain1</groupId>
<artifactId>name</artifactId>
<version>0.0.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>tld.domain1</groupId>
<artifactId>name</artifactId>
<version>0.0.0.0</version>
<scope>provided</scope>
</dependency>
This dependency does not exist at any of the repositories in the pom; I don't want to change the pom. Instead, I want to fetch the dependency jar from somewhere (wget), store it locally, and build the project with that. This is with mvn in docker.
6 replies
JCHJava Community | Help. Code. Learn.
Created by Pheotis on 4/15/2023 in #java-help
error: cannot access il; class file for il not found.
ArrayList<Item> array = new ArrayList<Item>();
int foo == 0;
int bar == 1;

while (stuff.happens()) {
array.add(new Item(foo, bar));
}
ArrayList<Item> array = new ArrayList<Item>();
int foo == 0;
int bar == 1;

while (stuff.happens()) {
array.add(new Item(foo, bar));
}
Why does this not compile?
- BUILD FAILED (total time: 1 second)
- error: cannot access il
- array.add(new Item(foo, bar));
- class file for il not found
- 1 error
- BUILD FAILED (total time: 1 second)
- error: cannot access il
- array.add(new Item(foo, bar));
- class file for il not found
- 1 error
WTH does this error even mean?
12 replies
JCHJava Community | Help. Code. Learn.
Created by Pheotis on 4/14/2023 in #java-help
Adding ancient dependency to maven.
How does one add a local jar dependency to maven without a package/group ID?
<dependency>
<groupId>tld.domain.Project</groupId>
<artifactId>Name</artifactId>
<version>1.8</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/resources/local.jar</systemPath>
</dependency>
<dependency>
<groupId>tld.domain.Project</groupId>
<artifactId>Name</artifactId>
<version>1.8</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/resources/local.jar</systemPath>
</dependency>
Normally, this ^ is the way to do it... but the jar was built with ant, is ancient, and doesn't have an apparent groupID.🐜
15 replies
JCHJava Community | Help. Code. Learn.
Created by Pheotis on 12/21/2022 in #java-help
CI Test Coverage Not Running
Hello! Unfortunately, I a quite new when it comes to continuous integration. We have a project with about 55% test coverage; it's not great, but it's something that we are still working on. Recently, I have tried to integrate our project with sonarcloud (and jacoco) via github actions. Unfortunately, github seems unable to run our unit tests. The result is always Tests run: 0, Failures: 0, Errors: 0, Skipped: 0 Given that this is our log: https://github.com/stargate-rewritten/Stargate-Bukkit/actions/runs/3721461173/jobs/6311631498 Given that this is our pom: https://github.com/stargate-rewritten/Stargate-Bukkit/blob/ci-fix/pom.xml And that this is our workflow file: https://github.com/stargate-rewritten/Stargate-Bukkit/blob/ci-fix/.github/workflows/sonar.yml Does anyone have any idea what I am doing wrong?
10 replies