Skip to content

Commit ab2615b

Browse files
committed
- for API 2.0
1 parent aab4abb commit ab2615b

11 files changed

+47
-137
lines changed

.gitignore

100644100755
File mode changed.

pom.xml

100644100755
+8-82
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
1-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
1+
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
33
<modelVersion>4.0.0</modelVersion>
44

5-
<parent>
6-
<groupId>org.sonatype.oss</groupId>
7-
<artifactId>oss-parent</artifactId>
8-
<version>7</version>
9-
</parent>
10-
115
<groupId>net.gtaun</groupId>
126
<artifactId>shoebill-dependency-manager</artifactId>
13-
<version>1.0-SNAPSHOT</version>
7+
<version>2.0</version>
148
<packaging>jar</packaging>
159

1610
<name>Shoebill Dependency Manager</name>
@@ -32,24 +26,17 @@
3226

3327
<properties>
3428
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
35-
<build.number>0</build.number>
29+
<build.number>${env.BUILD_NUMBER}</build.number>
3630
<aetherVersion>0.9.1.v20140329</aetherVersion>
3731
<mavenVersion>3.2.1</mavenVersion>
3832
<wagonVersion>2.6</wagonVersion>
3933
</properties>
4034

4135
<repositories>
4236
<repository>
43-
<id>sonatype-nexus-snapshots</id>
44-
<name>Sonatype Nexus Snapshots</name>
45-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
46-
<releases>
47-
<enabled>false</enabled>
48-
</releases>
49-
<snapshots>
50-
<enabled>true</enabled>
51-
<updatePolicy>always</updatePolicy>
52-
</snapshots>
37+
<id>gtaun-public-repo</id>
38+
<name>GTAUN Public Repository</name>
39+
<url>http://repo.gtaun.net/content/groups/public</url>
5340
</repository>
5441
</repositories>
5542

@@ -156,7 +143,7 @@
156143
<dependency>
157144
<groupId>net.gtaun</groupId>
158145
<artifactId>shoebill-utilities</artifactId>
159-
<version>1.0-SNAPSHOT</version>
146+
<version>2.0-SNAPSHOT</version>
160147
</dependency>
161148
</dependencies>
162149

@@ -219,68 +206,7 @@
219206
</execution>
220207
</executions>
221208
</plugin>
222-
223-
<plugin>
224-
<groupId>com.keyboardsamurais.maven</groupId>
225-
<artifactId>maven-timestamp-plugin</artifactId>
226-
<version>1.0</version>
227-
<configuration>
228-
<propertyName>build.timestamp</propertyName>
229-
<timestampPattern>yyyy-MM-dd HH:mm:ss z (Z)</timestampPattern>
230-
</configuration>
231-
<executions>
232-
<execution>
233-
<phase>validate</phase>
234-
<goals>
235-
<goal>create</goal>
236-
</goals>
237-
</execution>
238-
</executions>
239-
</plugin>
240209
</plugins>
241-
242-
<pluginManagement>
243-
<plugins>
244-
<plugin>
245-
<groupId>org.eclipse.m2e</groupId>
246-
<artifactId>lifecycle-mapping</artifactId>
247-
<version>1.0.0</version>
248-
<configuration>
249-
<lifecycleMappingMetadata>
250-
<pluginExecutions>
251-
<pluginExecution>
252-
<pluginExecutionFilter>
253-
<groupId>org.apache.maven.plugins</groupId>
254-
<artifactId>maven-enforcer-plugin</artifactId>
255-
<versionRange>[1.0.0,)</versionRange>
256-
<goals>
257-
<goal>enforce</goal>
258-
</goals>
259-
</pluginExecutionFilter>
260-
<action>
261-
<ignore />
262-
</action>
263-
</pluginExecution>
264-
265-
<pluginExecution>
266-
<pluginExecutionFilter>
267-
<groupId>com.keyboardsamurais.maven</groupId>
268-
<artifactId>maven-timestamp-plugin</artifactId>
269-
<versionRange>[1.0,)</versionRange>
270-
<goals>
271-
<goal>create</goal>
272-
</goals>
273-
</pluginExecutionFilter>
274-
<action>
275-
<ignore />
276-
</action>
277-
</pluginExecution>
278-
</pluginExecutions>
279-
</lifecycleMappingMetadata>
280-
</configuration>
281-
</plugin>
282-
</plugins>
283-
</pluginManagement>
284210
</build>
285211

286212
</project>

src/main/java/net/gtaun/shoebill/dependency/AetherUtil.java

100644100755
+2-3
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,14 @@
1616

1717
package net.gtaun.shoebill.dependency;
1818

19-
import java.io.File;
20-
2119
import net.gtaun.shoebill.dependency.manual.ManualRepositorySystemFactory;
22-
2320
import org.apache.maven.repository.internal.MavenRepositorySystemUtils;
2421
import org.eclipse.aether.DefaultRepositorySystemSession;
2522
import org.eclipse.aether.RepositorySystem;
2623
import org.eclipse.aether.repository.LocalRepository;
2724

25+
import java.io.File;
26+
2827
/**
2928
*
3029
*

src/main/java/net/gtaun/shoebill/dependency/DependencyManagerVersion.java

100644100755
+2-3
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,12 @@
1616

1717
package net.gtaun.shoebill.dependency;
1818

19-
import java.io.InputStream;
20-
2119
import net.gtaun.shoebill.util.config.YamlConfiguration;
22-
2320
import org.apache.commons.lang3.builder.ToStringBuilder;
2421
import org.apache.commons.lang3.builder.ToStringStyle;
2522

23+
import java.io.InputStream;
24+
2625
/**
2726
*
2827
*

src/main/java/net/gtaun/shoebill/dependency/ShoebillDependencyFilter.java

100644100755
+7-10
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,24 @@
1616

1717
package net.gtaun.shoebill.dependency;
1818

19-
import java.io.File;
20-
import java.util.List;
21-
2219
import net.gtaun.shoebill.ShoebillArtifactLocator;
23-
2420
import org.eclipse.aether.artifact.Artifact;
2521
import org.eclipse.aether.graph.Dependency;
2622
import org.eclipse.aether.graph.DependencyFilter;
2723
import org.eclipse.aether.graph.DependencyNode;
2824

25+
import java.io.File;
26+
import java.util.List;
27+
2928
/**
30-
*
31-
*
3229
* @author MK124
30+
* @author Marvin Haschker
3331
*/
34-
public class ShoebillDependencyFilter implements DependencyFilter
32+
class ShoebillDependencyFilter implements DependencyFilter
3533
{
3634
private ShoebillArtifactLocator artifactLocator;
37-
38-
39-
public ShoebillDependencyFilter(ShoebillArtifactLocator locator)
35+
36+
ShoebillDependencyFilter(ShoebillArtifactLocator locator)
4037
{
4138
this.artifactLocator = locator;
4239
}

src/main/java/net/gtaun/shoebill/dependency/ShoebillDependencyManager.java

100644100755
+18-16
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
import net.gtaun.shoebill.ResourceConfig.RepositoryEntry;
2222
import net.gtaun.shoebill.ShoebillArtifactLocator;
2323
import net.gtaun.shoebill.ShoebillConfig;
24+
import org.apache.log4j.Level;
25+
import org.apache.log4j.Logger;
2426
import org.apache.maven.model.Model;
2527
import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
2628
import org.eclipse.aether.DefaultRepositorySystemSession;
@@ -47,9 +49,9 @@
4749
import java.util.zip.ZipEntry;
4850

4951
/**
50-
*
51-
*
52-
* @author JoJLlmAn, MK124
52+
* @author JoJLlmAn
53+
* @author MK124
54+
* @author Marvin Haschker
5355
*/
5456
public class ShoebillDependencyManager
5557
{
@@ -58,13 +60,20 @@ public class ShoebillDependencyManager
5860

5961
private static final String PROPERTY_JAR_FILES = "jarFiles";
6062
private static final String SCOPE_RUNTIME = "runtime";
63+
private static final DependencyManagerVersion version = new DependencyManagerVersion(
64+
ShoebillDependencyManager.class.getResourceAsStream(VERSION_FILENAME));
6165

6266
private static final FilenameFilter JAR_FILENAME_FILTER = (dir, name) -> name.endsWith(".jar");
6367

64-
static
68+
@SuppressWarnings("unchecked")
69+
public static void main(String[] args) throws Throwable
6570
{
66-
DependencyManagerVersion version = new DependencyManagerVersion(ShoebillDependencyManager.class.getResourceAsStream(VERSION_FILENAME));
71+
Map<String, Object> properties = resolveDependencies();
72+
List<File> files = List.class.cast(properties.get(PROPERTY_JAR_FILES));
73+
files.forEach(System.out::println);
74+
}
6775

76+
private static void printStartupMessage() {
6877
String startupMessage = version.getName() + " " + version.getVersion();
6978
if (version.getBuildNumber() != 0) startupMessage += " Build " + version.getBuildNumber();
7079
startupMessage += " (for " + version.getSupport() + ")";
@@ -73,17 +82,10 @@ public class ShoebillDependencyManager
7382
System.out.println("Build date: " + version.getBuildDate());
7483
}
7584

76-
77-
@SuppressWarnings("unchecked")
78-
public static void main(String[] args) throws Throwable
79-
{
80-
Map<String, Object> properties = resolveDependencies();
81-
List<File> files = List.class.cast(properties.get(PROPERTY_JAR_FILES));
82-
for (File file : files) System.out.println(file);
83-
}
84-
8585
public static Map<String, Object> resolveDependencies() throws Throwable
8686
{
87+
Logger.getRootLogger().setLevel(Level.OFF);
88+
printStartupMessage();
8789
ShoebillConfig shoebillConfig = new ShoebillConfig(new FileInputStream(SHOEBILL_CONFIG_PATH));
8890
ResourceConfig resourceConfig = new ResourceConfig(new FileInputStream(new File(shoebillConfig.getShoebillDir(), "resources.yml")));
8991
ShoebillArtifactLocator artifactLocator = new ShoebillArtifactLocator(shoebillConfig, resourceConfig);
@@ -169,7 +171,7 @@ public static Map<String, Object> resolveDependencies() throws Throwable
169171
// Runtimes
170172
for (String coord : resourceConfig.getRuntimes())
171173
{
172-
if (coord.contains(":") == false)
174+
if (!coord.contains(":"))
173175
{
174176
System.out.println("Skipped artifact " + coord + " (Runtime)");
175177
continue;
@@ -183,7 +185,7 @@ public static Map<String, Object> resolveDependencies() throws Throwable
183185
// Plugins
184186
for (String coord : resourceConfig.getPlugins())
185187
{
186-
if (coord.contains(":") == false)
188+
if (!coord.contains(":"))
187189
{
188190
System.out.println("Skipped artifact " + coord + " (Plugin)");
189191
continue;

src/main/java/net/gtaun/shoebill/dependency/ShoebillRepositoryListener.java

100644100755
+5-10
Original file line numberDiff line numberDiff line change
@@ -20,27 +20,22 @@
2020
import org.eclipse.aether.RepositoryEvent;
2121

2222
/**
23-
*
24-
*
2523
* @author MK124
24+
* @author Marvin Haschker
2625
*/
2726
public class ShoebillRepositoryListener extends AbstractRepositoryListener
2827
{
29-
public ShoebillRepositoryListener()
30-
{
31-
32-
}
33-
3428
@Override
3529
public void artifactDescriptorInvalid(RepositoryEvent event)
3630
{
37-
System.out.println("Invalid artifact descriptor for " + event.getArtifact() + ": " + event.getException().getMessage());
31+
System.err.println("Invalid artifact descriptor for " + event.getArtifact() + ": " + event.getException()
32+
.getMessage());
3833
}
3934

4035
@Override
4136
public void artifactDescriptorMissing(RepositoryEvent event)
4237
{
43-
System.out.println("Missing artifact descriptor for " + event.getArtifact());
38+
System.err.println("Missing artifact descriptor for " + event.getArtifact());
4439
}
4540

4641
@Override
@@ -68,6 +63,6 @@ public void artifactDownloaded(RepositoryEvent event)
6863
@Override
6964
public void metadataInvalid(RepositoryEvent event)
7065
{
71-
System.out.println("Invalid metadata " + event.getMetadata());
66+
System.err.println("Invalid metadata " + event.getMetadata());
7267
}
7368
}

src/main/java/net/gtaun/shoebill/dependency/manual/ManualRepositorySystemFactory.java

100644100755
+2-10
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,11 @@
1616

1717
package net.gtaun.shoebill.dependency.manual;
1818

19-
import org.apache.maven.repository.internal.DefaultArtifactDescriptorReader;
20-
import org.apache.maven.repository.internal.DefaultVersionRangeResolver;
21-
import org.apache.maven.repository.internal.DefaultVersionResolver;
22-
import org.apache.maven.repository.internal.SnapshotMetadataGeneratorFactory;
23-
import org.apache.maven.repository.internal.VersionsMetadataGeneratorFactory;
19+
import org.apache.maven.repository.internal.*;
2420
import org.eclipse.aether.RepositorySystem;
2521
import org.eclipse.aether.connector.wagon.WagonProvider;
2622
import org.eclipse.aether.connector.wagon.WagonRepositoryConnectorFactory;
27-
import org.eclipse.aether.impl.ArtifactDescriptorReader;
28-
import org.eclipse.aether.impl.DefaultServiceLocator;
29-
import org.eclipse.aether.impl.MetadataGeneratorFactory;
30-
import org.eclipse.aether.impl.VersionRangeResolver;
31-
import org.eclipse.aether.impl.VersionResolver;
23+
import org.eclipse.aether.impl.*;
3224
import org.eclipse.aether.spi.connector.RepositoryConnectorFactory;
3325

3426
/**

src/main/java/net/gtaun/shoebill/dependency/manual/ManualWagonProvider.java

100644100755
File mode changed.

src/main/resources/dependencyManagerImpl.txt

100644100755
File mode changed.

src/main/resources/version.yml

100644100755
+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Shoebill Dependency Manager
22
version: ${version}
3-
support: net.gtaun:shoebill-api:1.1
4-
buildNumber: ${build.number}
5-
buildDate: ${build.timestamp}
3+
support: net.gtaun:shoebill-api:2.0
4+
buildNumber: ${env.BUILD_NUMBER}
5+
buildDate: ${system.build.start.date}

0 commit comments

Comments
 (0)