Skip to content

Commit 71659f8

Browse files
committed
bug(objectionary#3199): combine deps and resolve + fixed phi converting
1 parent f0ee6d5 commit 71659f8

36 files changed

+621
-912
lines changed

eo-maven-plugin/pom.xml

-5
Original file line numberDiff line numberDiff line change
@@ -209,11 +209,6 @@
209209
<version>5.10</version>
210210
<scope>runtime</scope>
211211
</dependency>
212-
<dependency>
213-
<groupId>org.apache.commons</groupId>
214-
<artifactId>commons-lang3</artifactId>
215-
<version>3.17.0</version>
216-
</dependency>
217212
<dependency>
218213
<groupId>org.slf4j</groupId>
219214
<artifactId>slf4j-reload4j</artifactId>

eo-maven-plugin/src/main/java/org/eolang/maven/CompileMojo.java

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ public final class CompileMojo extends SafeMojo {
2323
* Mojas to execute.
2424
*/
2525
private static final Moja<?>[] MOJAS = {
26-
new Moja<>(DownloadDepsMojo.class),
2726
new Moja<>(AssembleMojo.class),
2827
new Moja<>(LintMojo.class),
2928
new Moja<>(ResolveMojo.class),

eo-maven-plugin/src/main/java/org/eolang/maven/Coordinates.java

-67
This file was deleted.

eo-maven-plugin/src/main/java/org/eolang/maven/DcsFake.java

-137
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
/*
2+
* SPDX-FileCopyrightText: Copyright (c) 2016-2025 Objectionary.com
3+
* SPDX-License-Identifier: MIT
4+
*/
5+
package org.eolang.maven;
6+
7+
import java.util.function.Supplier;
8+
import javax.annotation.Nonnull;
9+
import org.apache.maven.model.Dependency;
10+
11+
/**
12+
* Maven coordinates as a string.
13+
*
14+
* @since 0.54
15+
*/
16+
final class Dep implements Comparable<Dep>, Supplier<Dependency> {
17+
18+
/**
19+
* The dependency.
20+
*/
21+
private final Dependency dependency;
22+
23+
/**
24+
* Ctor.
25+
*/
26+
Dep() {
27+
this(new Dependency());
28+
}
29+
30+
/**
31+
* Ctor.
32+
* @param dep The dependency
33+
*/
34+
Dep(final Dependency dep) {
35+
this.dependency = dep;
36+
}
37+
38+
@Override
39+
public String toString() {
40+
final String ret;
41+
if (this.dependency.getClassifier() == null || this.dependency.getClassifier().isEmpty()) {
42+
ret = String.format(
43+
"%s:%s:%s",
44+
this.dependency.getGroupId(),
45+
this.dependency.getArtifactId(),
46+
this.dependency.getVersion()
47+
);
48+
} else {
49+
ret = String.format(
50+
"%s:%s:%s:%s",
51+
this.dependency.getGroupId(),
52+
this.dependency.getArtifactId(),
53+
this.dependency.getClassifier(),
54+
this.dependency.getVersion()
55+
);
56+
}
57+
return ret;
58+
}
59+
60+
@Override
61+
public int compareTo(@Nonnull final Dep other) {
62+
return this.toString().compareTo(String.valueOf(other));
63+
}
64+
65+
@Override
66+
public boolean equals(@Nonnull final Object other) {
67+
return this.toString().equals(String.valueOf(other));
68+
}
69+
70+
@Override
71+
public int hashCode() {
72+
return this.toString().hashCode();
73+
}
74+
75+
@Override
76+
public Dependency get() {
77+
return this.dependency;
78+
}
79+
80+
/**
81+
* Set group id.
82+
* @param group Group id
83+
* @return Self
84+
*/
85+
Dep withGroupId(final String group) {
86+
this.dependency.setGroupId(group);
87+
return this;
88+
}
89+
90+
/**
91+
* Set artifact id.
92+
* @param artifact Artifact id
93+
* @return Self
94+
*/
95+
Dep withArtifactId(final String artifact) {
96+
this.dependency.setArtifactId(artifact);
97+
return this;
98+
}
99+
100+
/**
101+
* Set version.
102+
* @param version Version
103+
* @return Self
104+
*/
105+
Dep withVersion(final String version) {
106+
this.dependency.setVersion(version);
107+
return this;
108+
}
109+
110+
/**
111+
* Set scope.
112+
* @param scope Scope
113+
* @return Self
114+
*/
115+
Dep withScope(final String scope) {
116+
this.dependency.setScope(scope);
117+
return this;
118+
}
119+
120+
/**
121+
* Set classifier id.
122+
* @param classifier Classifier
123+
* @return Self
124+
*/
125+
Dep withClassifier(final String classifier) {
126+
this.dependency.setClassifier(classifier);
127+
return this;
128+
}
129+
}

0 commit comments

Comments
 (0)