Skip to content

Commit

Permalink
Merge pull request #1 from sse-labs/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
jachiaram authored Jul 31, 2024
2 parents 0dc7f74 + 80f21f6 commit 1753eb6
Show file tree
Hide file tree
Showing 29 changed files with 168 additions and 421 deletions.
6 changes: 6 additions & 0 deletions Maven-Central-Research-Interface.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<module version="4">
<component name="CheckStyle-IDEA-Module" serialisationVersion="2">
<option name="activeLocationsIds" />
</component>
</module>
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ To use Maven Central Research Interface extend the Maven Central Analysis class
```java -jar executableName *INSERT CLI HERE* ```

##Example Use Cases:
For these examples, these will perform the analysis on the first 1000 artifacts. The steps are the same for each one, with the exception of the implementation being used, and the cli arguments added to execute the jar.
For these examples, these will perform the analysis on the first 1000 artifacts. The steps are the same for each one, except the implementation being used and the cli arguments added to execute the jar.
1. Set up the implementation of the MavenCentralAnalysis class.
2. Run the executable with the given cli

Expand Down Expand Up @@ -157,7 +157,7 @@ IndexWalker can be implemented into mining software for the iteration and collec

### Modes
- Normal:
In this mode all of the information listed above is collected.
In this mode all information listed above is collected.
- Lazy:
In this mode just the identifiers are collected.

Expand Down Expand Up @@ -187,10 +187,10 @@ For each Pom file resolved these are the raw features that are collected:
For each pom file that contains a reference to a parent pom or import, those references are also resolved.

### Dependency Resolution
Some dependencies's versions are not explicitly defined in the current pom file. So Pom resolver includes a dependency resolution algorithm to search through parents and imports to resolve versions.
Some dependency versions are not explicitly defined in the current pom file. So Pom resolver includes a dependency resolution algorithm to search through parents and imports to resolve versions.

### Dependency Version Ranges
Other dependencies versions are defined via a version range. An algorithm for resolving these is also present in the Pom Resolver.
Other dependencies versions are defined via a version range. An algorithm for resolving these dependencies is also present in the Pom Resolver.

### All Transitive Dependency Resolution
Transitive dependencies are collected without resolving conflicts via the repeated resolution of dependencies.
Expand Down
4 changes: 4 additions & 0 deletions artifact_class_structure.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 2 additions & 3 deletions src/main/java/org/tudo/sse/ArtifactFactory.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package org.tudo.sse;

import java.util.HashMap;
import java.util.Map;
import org.tudo.sse.model.*;
import org.tudo.sse.model.index.IndexInformation;
import org.tudo.sse.model.jar.JarInformation;
import org.tudo.sse.model.pom.PomInformation;

import java.util.HashMap;
import java.util.Map;

/**
* The ArtifactFactory handles the creation and storage of artifacts resolved.
* Using a map double resolutions are avoided and faster retrievals are possible.
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/tudo/sse/IndexWalker.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class IndexWalker implements Iterable<IndexInformation>{

private static final Logger log = LogManager.getLogger(IndexWalker.class);

public IndexWalker(URI base) throws IOException {
public IndexWalker(URI base) {
this.base = base;
resetIterator = true;
}
Expand Down
18 changes: 7 additions & 11 deletions src/main/java/org/tudo/sse/MavenCentralAnalysis.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
import org.tudo.sse.model.Artifact;
import org.tudo.sse.model.ArtifactIdent;
import org.tudo.sse.model.index.IndexInformation;
import org.tudo.sse.multiThreading.IdentPlusMCA;
import org.tudo.sse.multiThreading.IndexProcessingMessage;
import org.tudo.sse.multithreading.IdentPlusMCA;
import org.tudo.sse.multithreading.IndexProcessingMessage;
import org.tudo.sse.resolution.ResolverFactory;
import org.tudo.sse.utils.IndexIterator;
import org.tudo.sse.multiThreading.QueueActor;
import org.tudo.sse.multithreading.QueueActor;

import java.io.*;
import java.net.URI;
Expand Down Expand Up @@ -46,11 +46,9 @@ public MavenCentralAnalysis() {
* This method handles parsing the command line arguments and stores it into a CliInformation object.
*
* @param args - cli to be parsed
* @throws URISyntaxException when there is an issue with the url built
* @throws IOException when there is an issue opening a file
* @see CliInformation when there is an issue processing the cli passed to the program
*/
public void parseCmdLine(String[] args) throws URISyntaxException, IOException {
public void parseCmdLine(String[] args) {
boolean flagSet1 = false;
boolean flagSet2 = false;
boolean flagSet3 = false;
Expand Down Expand Up @@ -237,12 +235,11 @@ public Map<ArtifactIdent, Artifact> runAnalysis(String[] args) throws URISyntaxE
/**
* Handles walking the maven central index, choosing how to do so based on the configuration.
*
* @return list of maven central identifiers
* @see ArtifactIdent
* @throws URISyntaxException when there is an issue with the url built
* @throws IOException when there is an issue opening a file
* @throws IOException when there is an issue opening a file
* @see ArtifactIdent
*/
public List<ArtifactIdent> indexProcessor() throws URISyntaxException, IOException {
public void indexProcessor() throws URISyntaxException, IOException {
String base = "https://repo1.maven.org/maven2/";
IndexIterator indexIterator;

Expand Down Expand Up @@ -279,7 +276,6 @@ public List<ArtifactIdent> indexProcessor() throws URISyntaxException, IOExcepti

writeLastProcessed(indexIterator.getIndex(), setupInfo.getName());

return identifiers;
}

public void processIndex(Artifact current) {
Expand Down
98 changes: 0 additions & 98 deletions src/main/java/org/tudo/sse/analysis/PomResolverAnalysis.java

This file was deleted.

101 changes: 0 additions & 101 deletions src/main/java/org/tudo/sse/analysis/WalkerAnalysis.java

This file was deleted.

2 changes: 1 addition & 1 deletion src/main/java/org/tudo/sse/model/Artifact.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class Artifact {
/**
* The identifier object for the artifact.
*/
public ArtifactIdent ident;
public final ArtifactIdent ident;
/**
* A secondary identifier, for if its pom information has been moved on the maven central repository.
*/
Expand Down
18 changes: 9 additions & 9 deletions src/main/java/org/tudo/sse/model/ArtifactIdent.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package org.tudo.sse.model;

import java.net.URI;
import java.util.Objects;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.tudo.sse.utils.MavenCentralRepository;

import java.net.URI;
import java.util.Objects;

/**
* The ArtifactIdent holds the gav triple for each artifact on the maven central repository.
Expand All @@ -15,20 +15,20 @@ public class ArtifactIdent {
/**
* The group section of the identifier.
*/
public String groupID;
private String groupID;

/**
* The specific artifact identifier.
*/
public String artifactID;
private String artifactID;
/**
* The version of the artifact.
*/
public String version;
private String version;
/**
* The repository where this artifact can be found.
*/
public String repository;
private String repository;

private static final Logger log = LogManager.getLogger(ArtifactIdent.class);

Expand Down Expand Up @@ -119,7 +119,7 @@ public String getCoordinates() {
}

/**
* Gets the url for the pom file on mavencentral
* Gets the url for the pom file on maven central
* @return pom URI
*/
public URI getMavenCentralPomUri() {
Expand All @@ -136,7 +136,7 @@ public URI getMavenCentralPomUri() {
}

/**
* Gets the url for the jar file on mavencentral
* Gets the url for the jar file on maven central
* @return jar URI
*/
public URI getMavenCentralJarUri() {
Expand All @@ -149,7 +149,7 @@ public URI getMavenCentralJarUri() {
}

/**
* Gets the url for the versions file on mavencentral
* Gets the url for the versions file on maven central
* @return versions.xml URI
*/
public URI getMavenCentralXMLUri() {
Expand Down
Loading

0 comments on commit 1753eb6

Please sign in to comment.