Skip to content
This repository has been archived by the owner on Apr 5, 2019. It is now read-only.

Commit

Permalink
changing the group id
Browse files Browse the repository at this point in the history
  • Loading branch information
klieber committed May 2, 2014
1 parent b0b11d9 commit 5b70541
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 14 deletions.
22 changes: 21 additions & 1 deletion src/it/with-integration-tests/prebuild.groovy
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
/*
* Copyright (c) 2014 Kyle Lieber
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
import org.codehaus.plexus.util.*;

FileUtils.forceDelete(new File(localRepositoryPath, "org/phantomjs"));
FileUtils.forceDelete(new File(localRepositoryPath, "com/github/klieber/phantomjs"));
22 changes: 21 additions & 1 deletion src/it/with-jasmine-maven-plugin-it/prebuild.groovy
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
/*
* Copyright (c) 2014 Kyle Lieber
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
import org.codehaus.plexus.util.*;

FileUtils.forceDelete(new File(localRepositoryPath, "org/phantomjs"));
FileUtils.forceDelete(new File(localRepositoryPath, "com/github/klieber/phantomjs"));
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@

public class CachedArtifact implements CachedFile {

public static final String GROUP_ID = "org.phantomjs";
public static final String ARTIFACT_ID = "phantomjs";

private final PhantomJSArchive phantomJSArchive;
private final ArtifactBuilder artifactBuilder;
private final RepositorySystemSession repositorySystemSession;
Expand All @@ -48,7 +45,7 @@ public CachedArtifact(PhantomJSArchive phantomJSArchive,

@Override
public File getFile() {
Artifact artifact = artifactBuilder.createArtifact(GROUP_ID,ARTIFACT_ID,phantomJSArchive);
Artifact artifact = artifactBuilder.createArtifact(phantomJSArchive);
LocalRepositoryManager manager = repositorySystemSession.getLocalRepositoryManager();
return new File(manager.getRepository().getBasedir(), manager.getPathForLocalArtifact(artifact));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,16 @@
package com.github.klieber.phantomjs.util;

import com.github.klieber.phantomjs.archive.PhantomJSArchive;
import org.eclipse.aether.RepositorySystemSession;
import org.eclipse.aether.artifact.Artifact;
import org.eclipse.aether.artifact.DefaultArtifact;
import org.eclipse.aether.repository.LocalRepositoryManager;

import java.io.File;

public class ArtifactBuilder {

public static final String GROUP_ID = "org.phantomjs";
public static final String GROUP_ID = "com.github.klieber";
public static final String ARTIFACT_ID = "phantomjs";

public Artifact createArtifact(String groupId, String artifactId, PhantomJSArchive archive) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@

import com.github.klieber.phantomjs.archive.PhantomJSArchive;
import com.github.klieber.phantomjs.util.ArtifactBuilder;
import org.eclipse.aether.RepositorySystem;
import org.eclipse.aether.RepositorySystemSession;
import org.eclipse.aether.artifact.Artifact;
import org.eclipse.aether.repository.ArtifactRepository;
import org.eclipse.aether.repository.LocalRepository;
import org.eclipse.aether.repository.LocalRepositoryManager;
import org.junit.Before;
Expand Down Expand Up @@ -77,11 +75,7 @@ public void before() {

@Test
public void testGetFile() throws Exception {
when(artifactBuilder.createArtifact(
CachedArtifact.GROUP_ID,
CachedArtifact.ARTIFACT_ID,
phantomJSArchive
)).thenReturn(artifact);
when(artifactBuilder.createArtifact(phantomJSArchive)).thenReturn(artifact);

when(repositorySystemSession.getLocalRepositoryManager()).thenReturn(localRepositoryManager);
when(localRepositoryManager.getRepository()).thenReturn(localRepository);
Expand Down

0 comments on commit 5b70541

Please sign in to comment.