-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SHRINKWRAP-324 Updated Formatting Rules to JBoss Community
- Loading branch information
Showing
54 changed files
with
6,079 additions
and
6,377 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,64 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
|
||
<!-- Parent --> | ||
<parent> | ||
<groupId>org.jboss.shrinkwrap.resolver</groupId> | ||
<artifactId>shrinkwrap-resolver-parent</artifactId> | ||
<version>1.1.0-alpha-1-SNAPSHOT</version> | ||
<relativePath>../pom.xml</relativePath> | ||
</parent> | ||
|
||
<!-- Model Version --> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<!-- Artifact Configuration --> | ||
<groupId>org.jboss.shrinkwrap.resolver</groupId> | ||
<artifactId>shrinkwrap-resolver-api-maven</artifactId> | ||
<name>ShrinkWrap Resolver Maven API</name> | ||
<description>ShrinkWrap Extension for Resolving Dependencies from a Maven backend</description> | ||
|
||
|
||
<!-- Properties --> | ||
<properties> | ||
|
||
<!-- Versioning --> | ||
|
||
</properties> | ||
|
||
<!-- Dependencies --> | ||
<dependencies> | ||
|
||
<!-- | ||
org.jboss.shrinkwrap | ||
--> | ||
<dependency> | ||
<groupId>org.jboss.shrinkwrap</groupId> | ||
<artifactId>shrinkwrap-api</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jboss.shrinkwrap.resolver</groupId> | ||
<artifactId>shrinkwrap-resolver-api</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
|
||
<!-- | ||
External Projects | ||
--> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
</dependencies> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
|
||
<!-- Parent --> | ||
<parent> | ||
<groupId>org.jboss.shrinkwrap.resolver</groupId> | ||
<artifactId>shrinkwrap-resolver-parent</artifactId> | ||
<version>1.1.0-alpha-1-SNAPSHOT</version> | ||
<relativePath>../pom.xml</relativePath> | ||
</parent> | ||
|
||
<!-- Model Version --> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<!-- Artifact Configuration --> | ||
<groupId>org.jboss.shrinkwrap.resolver</groupId> | ||
<artifactId>shrinkwrap-resolver-api-maven</artifactId> | ||
<name>ShrinkWrap Resolver Maven API</name> | ||
<description>ShrinkWrap Extension for Resolving Dependencies from a Maven backend</description> | ||
|
||
<!-- Properties --> | ||
<properties> | ||
<!-- Versioning --> | ||
</properties> | ||
|
||
<!-- Dependencies --> | ||
<dependencies> | ||
|
||
<!-- | ||
org.jboss.shrinkwrap | ||
--> | ||
<dependency> | ||
<groupId>org.jboss.shrinkwrap</groupId> | ||
<artifactId>shrinkwrap-api</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jboss.shrinkwrap.resolver</groupId> | ||
<artifactId>shrinkwrap-resolver-api</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
|
||
<!-- | ||
External Projects | ||
--> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-checkstyle-plugin</artifactId> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> | ||
|
172 changes: 96 additions & 76 deletions
172
api-maven/src/main/java/org/jboss/shrinkwrap/resolver/api/maven/MavenDependency.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 |
---|---|---|
@@ -1,95 +1,115 @@ | ||
/** | ||
* | ||
/* | ||
* JBoss, Home of Professional Open Source | ||
* Copyright 2010, Red Hat Middleware LLC, and individual contributors | ||
* by the @authors tag. See the copyright.txt in the distribution for a | ||
* full listing of individual contributors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.jboss.shrinkwrap.resolver.api.maven; | ||
|
||
import org.jboss.shrinkwrap.resolver.api.ResolutionElement; | ||
|
||
/** | ||
* Describes Maven Resolution Element. | ||
* | ||
* Contract encapsulates Maven dependency as known from POM files. | ||
* | ||
* Describes Maven Resolution Element. | ||
* | ||
* Contract encapsulates Maven dependency as known from POM files. | ||
* | ||
* @author <a href="kpiwko@redhat.com>Karel Piwko</a> | ||
* | ||
* | ||
*/ | ||
public interface MavenDependency extends ResolutionElement<MavenDependency> | ||
{ | ||
public interface MavenDependency extends ResolutionElement<MavenDependency> { | ||
|
||
/** | ||
* Sets coordinates. | ||
* @param coordinates The artifact coordinates in the format | ||
* {@code <groupId>:<artifactId>[:<extension>[:<classifier>]]:<version>} | ||
* , must not be {@code null} or empty. | ||
* @return Modified instance for chaining | ||
*/ | ||
MavenDependency setCoordinates(String coordinates); | ||
/** | ||
* Sets coordinates. | ||
* | ||
* @param coordinates The artifact coordinates in the format | ||
* {@code <groupId>:<artifactId>[:<extension>[:<classifier>]]:<version>} , must not be {@code null} or empty. | ||
* @return Modified instance for chaining | ||
*/ | ||
MavenDependency setCoordinates(String coordinates); | ||
|
||
/** | ||
* Gets coordinates of the dependency | ||
* @return The coordinates | ||
*/ | ||
String getCoordinates(); | ||
/** | ||
* Gets coordinates of the dependency | ||
* | ||
* @return The coordinates | ||
*/ | ||
String getCoordinates(); | ||
|
||
/** | ||
* Sets scope of the Maven dependency | ||
* @param scope The scope to be set | ||
* @return Modified instance for chaining | ||
*/ | ||
MavenDependency setScope(String scope); | ||
/** | ||
* Sets scope of the Maven dependency | ||
* | ||
* @param scope The scope to be set | ||
* @return Modified instance for chaining | ||
*/ | ||
MavenDependency setScope(String scope); | ||
|
||
/** | ||
* Gets scope of the dependency | ||
* @return The scope | ||
*/ | ||
String getScope(); | ||
/** | ||
* Gets scope of the dependency | ||
* | ||
* @return The scope | ||
*/ | ||
String getScope(); | ||
|
||
/** | ||
* Adds one or more exclusions for current dependency | ||
* @param exclusion Array of exclusions to be added, in form {@code <groupId>:<artifactId>[:<extension>[:<classifier>]]} | ||
* or {@code *} to exclude all transitive dependencies | ||
* @return Modified instance for chaining | ||
*/ | ||
MavenDependency addExclusions(String... exclusion); | ||
/** | ||
* Adds one or more exclusions for current dependency | ||
* | ||
* @param exclusion Array of exclusions to be added, in form {@code <groupId>:<artifactId>[:<extension>[:<classifier>]]} or | ||
* {@code *} to exclude all transitive dependencies | ||
* @return Modified instance for chaining | ||
*/ | ||
MavenDependency addExclusions(String... exclusion); | ||
|
||
/** | ||
* Gets all exclusions defined on the dependency | ||
* @return Array of exclusions defined for the dependency | ||
*/ | ||
String[] getExclusions(); | ||
/** | ||
* Gets all exclusions defined on the dependency | ||
* | ||
* @return Array of exclusions defined for the dependency | ||
*/ | ||
String[] getExclusions(); | ||
|
||
/** | ||
* Sets dependency as optional. | ||
* @param optional The optional flag to set | ||
* @return Modified instance for chaining | ||
*/ | ||
MavenDependency setOptional(boolean optional); | ||
/** | ||
* Sets dependency as optional. | ||
* | ||
* @param optional The optional flag to set | ||
* @return Modified instance for chaining | ||
*/ | ||
MavenDependency setOptional(boolean optional); | ||
|
||
/** | ||
* Gets optional flag. | ||
* | ||
* By default dependency is considered non-optional. | ||
* @return {@code true} if dependency is optional,{@code false} otherwise | ||
*/ | ||
boolean isOptional(); | ||
/** | ||
* Gets optional flag. | ||
* | ||
* By default dependency is considered non-optional. | ||
* | ||
* @return {@code true} if dependency is optional,{@code false} otherwise | ||
*/ | ||
boolean isOptional(); | ||
|
||
/** | ||
* Checks if other dependency defined the same artifact, | ||
* that is Maven will resolve the same artifact from the other dependency. | ||
* | ||
* <p> | ||
* Coordinates cannot be compared directly, see reason below. | ||
* </p> | ||
* | ||
* <p> | ||
* To implement this method, developer must be aware that effectively | ||
* @{code foo:bar:jar:1.0} and {@code foo:bar:1.0} are the same coordinates, | ||
* because Maven considers jar as default extension. | ||
* </p> | ||
* | ||
* @param other The other dependency | ||
* @return {@code true} if other has the same artifact definition, {@code false} otherwise | ||
*/ | ||
boolean hasSameArtifactAs(MavenDependency other); | ||
/** | ||
* Checks if other dependency defined the same artifact, that is Maven will resolve the same artifact from the other | ||
* dependency. | ||
* | ||
* <p> | ||
* Coordinates cannot be compared directly, see reason below. | ||
* </p> | ||
* | ||
* <p> | ||
* To implement this method, developer must be aware that effectively | ||
* | ||
* @{code foo:bar:jar:1.0} and {@code foo:bar:1.0} are the same coordinates, because Maven considers jar as default | ||
* extension. | ||
* </p> | ||
* | ||
* @param other The other dependency | ||
* @return {@code true} if other has the same artifact definition, {@code false} otherwise | ||
*/ | ||
boolean hasSameArtifactAs(MavenDependency other); | ||
|
||
} |
Oops, something went wrong.