/** * Add a single Maven dependency into the Archive. * The following dependency formats are supported: * * groupId:artifactId * groupId:artifactId:version * groupId:artifactId:packaging:version * groupId:artifactId:packaging:version:classifier * * @param gav String coordinates of the Maven dependency * @return Archive instance * @throws Exception * @see ArtifactLookup#artifact(String) */ @SuppressWarnings("unchecked") default T addDependency(String gav) throws Exception { addAsLibrary(ArtifactLookup.get().artifact(gav)); return (T) this; } }
/** * Retrieve all dependency artifacts for the user's project. * * @return All dependencies, as {@code JavaArchive} objects. * @throws Exception */ public static List<JavaArchive> allArtifacts() throws Exception { return artifactLookup().allArtifacts(); }
private static ArtifactLookup artifactLookup() { return ArtifactLookup.get(); }
/** * Retrieve an artifact that was part of the original build using a * full or simplified Maven GAV specifier, returning an archive with a * specified name. * * @param gav The Maven GAV. * @return The located artifact, as a {@code JavaArchive} with the specified name. * @throws Exception If the specified artifact is not locatable. * @see #artifact(String) */ public static JavaArchive artifact(String gav, String asName) throws Exception { return artifactLookup().artifact(gav, asName); }
private static ArtifactLookup artifactLookup() { return ArtifactLookup.get(); }
/** * Retrieve an artifact that was part of the original build using a * full or simplified Maven GAV specifier, returning an archive with a * specified name. * * @param gav The Maven GAV. * @return The located artifact, as a {@code JavaArchive} with the specified name. * @throws Exception If the specified artifact is not locatable. * @see #artifact(String) */ public static JavaArchive artifact(String gav, String asName) throws Exception { return artifactLookup().artifact(gav, asName); }
/** * Add a single Maven dependency into the Archive. * The following dependency formats are supported: * * groupId:artifactId * groupId:artifactId:version * groupId:artifactId:packaging:version * groupId:artifactId:packaging:version:classifier * * @param gav String coordinates of the Maven dependency * @return Archive instance * @throws Exception * @see ArtifactLookup#artifact(String) */ @SuppressWarnings("unchecked") default T addDependency(String gav) throws Exception { addAsLibrary(ArtifactLookup.get().artifact(gav)); return (T) this; } }
private static ArtifactLookup artifactLookup() { return ArtifactLookup.get(); }
/** * Retrieve an artifact that was part of the original build using a * full or simplified Maven GAV specifier, returning an archive with a * specified name. * * @param gav The Maven GAV. * @return The located artifact, as a {@code JavaArchive} with the specified name. * @throws Exception If the specified artifact is not locatable. * @see #artifact(String) */ public static JavaArchive artifact(String gav, String asName) throws Exception { return artifactLookup().artifact(gav, asName); }
/** * Retrieve all dependency artifacts for the user's project. * * @return All dependencies, as {@code JavaArchive} objects. * @throws Exception */ public static List<JavaArchive> allArtifacts() throws Exception { return artifactLookup().allArtifacts(); }
@Produces @ApplicationScoped public ArtifactLookup lookup() { return ArtifactLookup.get(); } }
/** * Retrieve an artifact that was part of the original build using a * full or simplified Maven GAV specifier. * * <p>The following formats of GAVs are supported:</p> * * <ul> * <li>groupId:artifactId</li> * <li>groupId:artifactId:version</li> * <li>groupId:artifactId:packaging:version</li> * <li>groupId:artifactId:packaging:version:classifier</li> * </ul> * * <p>Only artifacts that were compiled with the user's project with * a scope of {@code compile} are available through lookup.</p> * * <p>In the variants that include a {@code version} parameter, it may be * replaced by a literal asterisk in order to avoid hard-coding versions * into the application.</p> * * @param gav The Maven GAV. * @return The located artifact, as a {@code JavaArchive}. * @throws Exception If the specified artifact is not locatable. */ public static JavaArchive artifact(String gav) throws Exception { return artifactLookup().artifact(gav); }
/** * Retrieve all dependency artifacts for the user's project. * * @return All dependencies, as {@code JavaArchive} objects. * @throws Exception */ public static List<JavaArchive> allArtifacts() throws Exception { return artifactLookup().allArtifacts(); }
@Produces @ApplicationScoped public ArtifactLookup lookup() { return ArtifactLookup.get(); } }
/** * Retrieve an artifact that was part of the original build using a * full or simplified Maven GAV specifier. * * <p>The following formats of GAVs are supported:</p> * * <ul> * <li>groupId:artifactId</li> * <li>groupId:artifactId:version</li> * <li>groupId:artifactId:packaging:version</li> * <li>groupId:artifactId:packaging:version:classifier</li> * </ul> * * <p>Only artifacts that were compiled with the user's project with * a scope of {@code compile} are available through lookup.</p> * * <p>In the variants that include a {@code version} parameter, it may be * replaced by a literal asterisk in order to avoid hard-coding versions * into the application.</p> * * @param gav The Maven GAV. * @return The located artifact, as a {@code JavaArchive}. * @throws Exception If the specified artifact is not locatable. */ public static JavaArchive artifact(String gav) throws Exception { return artifactLookup().artifact(gav); }
@Produces @ApplicationScoped public ArtifactLookup lookup() { return ArtifactLookup.get(); } }
/** * Retrieve an artifact that was part of the original build using a * full or simplified Maven GAV specifier. * * <p>The following formats of GAVs are supported:</p> * * <ul> * <li>groupId:artifactId</li> * <li>groupId:artifactId:version</li> * <li>groupId:artifactId:packaging:version</li> * <li>groupId:artifactId:packaging:version:classifier</li> * </ul> * * <p>Only artifacts that were compiled with the user's project with * a scope of {@code compile} are available through lookup.</p> * * <p>In the variants that include a {@code version} parameter, it may be * replaced by a literal asterisk in order to avoid hard-coding versions * into the application.</p> * * @param gav The Maven GAV. * @return The located artifact, as a {@code JavaArchive}. * @throws Exception If the specified artifact is not locatable. */ public static JavaArchive artifact(String gav) throws Exception { return artifactLookup().artifact(gav); }