forked from eirslett/frontend-maven-plugin
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DCA11Y-1315: Use PAC mirrors where possible
Excuse the factoring, it's got enough spaghetti for a whole 'nother generation of Eminem memes. Why? Trying to make it easy to update from upstream. If I was to refactor the existing code we're more likely to get merge-conflicts. I don't see us ever being able to upstream this change so it doesn't make sense for the diff to be optimised for that.
- Loading branch information
Showing
14 changed files
with
243 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
...n-plugin/src/main/java/com/github/eirslett/maven/plugins/frontend/mojo/AtlassianUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package com.github.eirslett.maven.plugins.frontend.mojo; | ||
|
||
import org.apache.maven.project.MavenProject; | ||
|
||
import javax.annotation.Nonnull; | ||
import javax.naming.OperationNotSupportedException; | ||
|
||
import static java.util.Objects.requireNonNull; | ||
|
||
public class AtlassianUtil { | ||
private AtlassianUtil() throws OperationNotSupportedException { | ||
throw new OperationNotSupportedException("my dude, this is a util class"); | ||
} | ||
|
||
public static boolean isAtlassianProject(@Nonnull MavenProject mavenProject) { | ||
requireNonNull(mavenProject, "mavenProject"); | ||
|
||
// Ordered by likelihood | ||
if (containsAtlassian(mavenProject.getGroupId()) || | ||
containsAtlassian(mavenProject.getVersion()) || // we have forks with original coordinates | ||
containsAtlassian(mavenProject.getArtifactId())) { | ||
return true; | ||
} | ||
|
||
// I don't think I'm missing anything here for forks that have a frontend?? | ||
// AO plugin, Greenhopper, and Ridalabs all have Atlassian group IDs now | ||
// Please take mercy on me and don't be offended if I forgot something | ||
|
||
return false; | ||
} | ||
|
||
private static boolean containsAtlassian(@Nonnull String string) { | ||
requireNonNull(string, "string"); | ||
|
||
return string.toLowerCase().contains("atlassian"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
.../main/java/com/github/eirslett/maven/plugins/frontend/lib/ArchiveExtractionException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.github.eirslett.maven.plugins.frontend.lib; | ||
|
||
public class ArchiveExtractionException extends Exception { | ||
|
||
ArchiveExtractionException(String message) { | ||
super(message); | ||
} | ||
|
||
ArchiveExtractionException(String message, Throwable cause) { | ||
super(message, cause); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
...-core/src/main/java/com/github/eirslett/maven/plugins/frontend/lib/DownloadException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.github.eirslett.maven.plugins.frontend.lib; | ||
|
||
public final class DownloadException extends Exception { | ||
public DownloadException(String message){ | ||
super(message); | ||
} | ||
DownloadException(String message, Throwable cause) { | ||
super(message, cause); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.