Package org.apache.maven.artifact.repository

Examples of org.apache.maven.artifact.repository.DefaultArtifactRepository


        tomEEMojo.useConsole = true;
        tomEEMojo.checkStarted = true;

        // we mock all the artifact resolution in test
        tomEEMojo.remoteRepos = new LinkedList<ArtifactRepository>();
        tomEEMojo.local = new DefaultArtifactRepository("local", tomEEMojo.settings.getLocalRepository(), new DefaultRepositoryLayout());

        tomEEMojo.factory = ArtifactFactory.class.cast(Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(), new Class<?>[]{ArtifactFactory.class}, new InvocationHandler() {
            @Override
            public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable {
                return new DefaultArtifact(
View Full Code Here


    private File resolve() {
        if (!settings.isOffline()) {
            try {
                if ("snapshots".equals(apacheRepos) || "true".equals(apacheRepos)) {
                    remoteRepos.add(new DefaultArtifactRepository("apache", "https://repository.apache.org/content/repositories/snapshots/",
                        new DefaultRepositoryLayout(),
                        new ArtifactRepositoryPolicy(true, UPDATE_POLICY_DAILY, CHECKSUM_POLICY_WARN),
                        new ArtifactRepositoryPolicy(false, UPDATE_POLICY_NEVER, CHECKSUM_POLICY_WARN)));
                } else {
                    try {
                        new URI(apacheRepos); // to check it is a uri
                        remoteRepos.add(new DefaultArtifactRepository("additional-repo-tomee-mvn-plugin", apacheRepos,
                            new DefaultRepositoryLayout(),
                            new ArtifactRepositoryPolicy(true, UPDATE_POLICY_DAILY, CHECKSUM_POLICY_WARN),
                            new ArtifactRepositoryPolicy(true, UPDATE_POLICY_NEVER, CHECKSUM_POLICY_WARN)));
                    } catch (final URISyntaxException e) {
                        // ignored, use classical repos
View Full Code Here

        File testPom = new File( getBasedir(), "src/test/resources/unit/bundle-pack-parent/pom.xml" );

        BundlePackMojo mojo = (BundlePackMojo) lookupMojo( "bundle-pack", testPom );
        URL repoURL = new File( getBasedir(), "src/test/resources/repo" ).toURL();
        mojo.localRepository =
            new DefaultArtifactRepository( "test", repoURL.toString(), new DefaultRepositoryLayout() );

        File generatedFilesDir = new File( getBasedir(), "target/bundle-pack-parent-tests" );
        mojo.basedir = generatedFilesDir.getAbsolutePath();
       
        // NOTE: This is sensitive to the lookupMojo method timing...
View Full Code Here

        File testPom = new File( getBasedir(), "src/test/resources/unit/bundle-pack/pom.xml" );

        BundlePackMojo mojo = (BundlePackMojo) lookupMojo( "bundle-pack", testPom );
        URL repoURL = new File( getBasedir(), "src/test/resources/repo" ).toURL();
        mojo.localRepository =
            new DefaultArtifactRepository( "test", repoURL.toString(), new DefaultRepositoryLayout() );

        File generatedFilesDir = new File( getBasedir(), "target/bundle-pack-tests" );
        mojo.basedir = generatedFilesDir.getAbsolutePath();
        mojo.execute();
View Full Code Here

        File testPom = new File( getBasedir(), "src/test/resources/unit/bundle-pack/pom.xml" );

        BundlePackMojo mojo = (BundlePackMojo) lookupMojo( "bundle-pack", testPom );
        URL repoURL = new File( getBasedir(), "src/test/resources/repo" ).toURL();
        mojo.localRepository =
            new DefaultArtifactRepository( "test", repoURL.toString(), new DefaultRepositoryLayout() );

        // NOTE: This is sensitive to the lookupMojo method timing...
        TestInputHandler ih = (TestInputHandler) lookup( InputHandler.ROLE, "default" );

        Stack<String> responses = new Stack<String>();
View Full Code Here

        File testPom = new File( getBasedir(), "src/test/resources/unit/bundle-pack/pom.xml" );

        BundlePackMojo mojo = (BundlePackMojo) lookupMojo( "bundle-pack", testPom );
        URL repoURL = new File( getBasedir(), "src/test/resources/repo" ).toURL();
        mojo.localRepository =
            new DefaultArtifactRepository( "test", repoURL.toString(), new DefaultRepositoryLayout() );

        // NOTE: This is sensitive to the lookupMojo method timing...
        TestInputHandler ih = (TestInputHandler) lookup( InputHandler.ROLE, "default" );

        Stack<String> responses = new Stack<String>();
View Full Code Here

        File testPom = new File( getBasedir(), "src/test/resources/unit/bundle-pack/pom.xml" );

        BundlePackMojo mojo = (BundlePackMojo) lookupMojo( "bundle-pack", testPom );
        URL repoURL = new File( getBasedir(), "src/test/resources/repo" ).toURL();
        mojo.localRepository =
            new DefaultArtifactRepository( "test", repoURL.toString(), new DefaultRepositoryLayout() );

        // NOTE: This is sensitive to the lookupMojo method timing...
        TestInputHandler ih = (TestInputHandler) lookup( InputHandler.ROLE, "default" );

        Stack<String> responses = new Stack<String>();
View Full Code Here

        File testPom = new File( getBasedir(), "src/test/resources/unit/bundle-pack/pom.xml" );

        BundlePackMojo mojo = (BundlePackMojo) lookupMojo( "bundle-pack", testPom );
        URL repoURL = new File( getBasedir(), "src/test/resources/repo" ).toURL();
        mojo.localRepository =
            new DefaultArtifactRepository( "test", repoURL.toString(), new DefaultRepositoryLayout() );

        // NOTE: This is sensitive to the lookupMojo method timing...
        TestInputHandler ih = (TestInputHandler) lookup( InputHandler.ROLE, "default" );

        Stack<String> responses = new Stack<String>();
View Full Code Here

        projectBuilder = (MavenProjectBuilder) lookup( MavenProjectBuilder.ROLE );

        ArtifactRepositoryLayout layout = (ArtifactRepositoryLayout) lookup( ArtifactRepositoryLayout.ROLE, "default" );
        String localRepoPath = getTestFile( "target/local-repository" ).getAbsolutePath().replace( '\\', '/' );
        localRepository = new DefaultArtifactRepository( "local", "file://" + localRepoPath, layout );
    }
View Full Code Here

        File testFile = getTestFile( "target/test-classes/projects/" + path + subpath + "/pom.xml" );
        Stack<File> projectFiles = new Stack<File>();
        projectFiles.push( testFile );

        List<DefaultArtifactRepository> repos =
            Collections.singletonList( new DefaultArtifactRepository( "central", getRemoteRepositoryURL(), new DefaultRepositoryLayout() ) );

        Repository repository = new Repository();
        repository.setId( "central" );
        repository.setUrl( getRemoteRepositoryURL() );
View Full Code Here

TOP

Related Classes of org.apache.maven.artifact.repository.DefaultArtifactRepository

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.