Examples of InvalidPluginDescriptorException


Examples of org.apache.maven.plugin.descriptor.InvalidPluginDescriptorException

            String goal = execute.goal().trim().length() == 0 ? null : execute.goal().trim();
            Phase phase = execute.phase();
            if (goal != null || phase != Phase.None) {
                if (goal != null) {
                    if (lifecycle != null) {
                        throw new InvalidPluginDescriptorException("'goal' cannot be specified with 'lifecycle' in execute annotation");
                    }
                    if (phase != Phase.None) {
                        throw new InvalidPluginDescriptorException("execute annotation cannot specify both 'phase' and 'goal'");
                    }
                    mojoDescriptor.setExecuteGoal(goal);
                } else {
                    mojoDescriptor.setExecutePhase(phase.value);
                    if (lifecycle != null) {
View Full Code Here

Examples of org.apache.maven.plugin.descriptor.InvalidPluginDescriptorException

                    String path = file.getPath();
                    sourcePathElements.add(path);
                }
            }
        } catch (Exception e) {
            throw new InvalidPluginDescriptorException(
                    "Failed to get source files from " + srcRoot, e);
        }
        List<String> argsList = new ArrayList<String>();
        argsList.add("-nocompile");
        argsList.add("-cp");
        StringBuilder cp = new StringBuilder();
        //Add the compile classpath
        List<String> compileClasspathElements;
        try {
            compileClasspathElements = project.getCompileClasspathElements();
        } catch (DependencyResolutionRequiredException e) {
            throw new InvalidPluginDescriptorException(
                    "Failed to get compileClasspathElements.", e);
        }
        for (String ccpe : compileClasspathElements) {
            appendToPath(cp, ccpe);
        }

        //Add the current CL classptah
        URL[] urls = ((URLClassLoader) getClass().getClassLoader()).getURLs();
        for (URL url : urls) {
            String path;
            try {
                path = url.getPath();
            } catch (Exception e) {
                throw new InvalidPluginDescriptorException(
                        "Failed to get classpath files from " + url, e);
            }
            appendToPath(cp, path);
        }
        String classpath = cp.toString();
        debug("cl=" + classpath);
        argsList.add(classpath);
        argsList.addAll(sourcePathElements);
        String[] args = argsList.toArray(new String[argsList.size()]);
        List<MojoDescriptor> descriptors = new ArrayList<MojoDescriptor>();
        MojoDescriptorTls.setDescriptors(descriptors);
        try {
            Main.process(new MojoApf(pluginDescriptor), new PrintWriter(System.out), args);
        } catch (Throwable t) {
            //TODO: [by yl] This is never caught - apt swallows the exception.
            //Use the TLS to hold thrown exception
            throw new InvalidPluginDescriptorException(
                    "Failed to extract plugin descriptor.", t);
        }
        return MojoDescriptorTls.getDescriptors();
    }
View Full Code Here

Examples of org.apache.maven.plugin.descriptor.InvalidPluginDescriptorException

            String goal = execute.goal().trim().length() == 0 ? null : execute.goal().trim();
            Phase phase = execute.phase();
            if (goal != null || phase != Phase.None) {
                if (goal != null) {
                    if (lifecycle != null) {
                        throw new InvalidPluginDescriptorException("'goal' cannot be specified with 'lifecycle' in execute annotation");
                    }
                    if (phase != Phase.None) {
                        throw new InvalidPluginDescriptorException("execute annotation cannot specify both 'phase' and 'goal'");
                    }
                    mojoDescriptor.setExecuteGoal(goal);
                } else {
                    mojoDescriptor.setExecutePhase(phase.value);
                    if (lifecycle != null) {
View Full Code Here

Examples of org.rhq.core.clientapi.agent.metadata.InvalidPluginDescriptorException

            for (ServiceDescriptor childServiceDescriptor : serverDescriptor.getServices()) {
                parseServiceDescriptor(childServiceDescriptor, serverResourceType, null);
            }
        } else {
            // this should never happen - the XML parser should have failed to even get this far
            throw new InvalidPluginDescriptorException("Both sourcePlugin and sourceType must be defined: "
                + serverDescriptor.getName());
        }

        // now see if we are using the Injection extension model
        // if so, we need to inject the new resource type as a child to the parent plugin's types
View Full Code Here

Examples of org.rhq.core.clientapi.agent.metadata.InvalidPluginDescriptorException

            serviceResourceType.setSingleton(serviceDescriptor.isSingleton());

            parseResourceDescriptor(sourceTypeDescriptor, serviceResourceType, null, null, sourcePlugin);
        } else {
            // this should never happen - the XML parser should have failed to even get this far
            throw new InvalidPluginDescriptorException("Both sourcePlugin and sourceType must be defined: "
                + serviceDescriptor.getName());
        }

        // now see if we are using the Injection extension model
        // if so, we need to inject the new resource type as a child to the parent plugin's types
View Full Code Here

Examples of org.rhq.core.clientapi.agent.metadata.InvalidPluginDescriptorException

            boolean clustered = Boolean.parseBoolean(clusteredStr);

            AbstractScheduleType scheduleType;
            scheduleType = AbstractScheduleType.create(concurrent, clustered, scheduleTypeStr, scheduleTriggerStr);
            if (scheduleType == null) {
                throw new InvalidPluginDescriptorException("Invalid schedule type: " + scheduleTypeStr);
            }

            // the callback data will contain all simple properties in the schedule job map
            Properties callbackData = new Properties();
            Map<String, PropertyDefinition> allPropDefs = jobMapDef.getMap();
View Full Code Here

Examples of org.rhq.core.clientapi.agent.metadata.InvalidPluginDescriptorException

            boolean clustered = Boolean.parseBoolean(clusteredStr);

            AbstractScheduleType scheduleType;
            scheduleType = AbstractScheduleType.create(concurrent, clustered, scheduleTypeStr, scheduleTriggerStr);
            if (scheduleType == null) {
                throw new InvalidPluginDescriptorException("Invalid schedule type: " + scheduleTypeStr);
            }

            // the callback data will contain all simple properties in the schedule job map
            Properties callbackData = new Properties();
            Map<String, Property> allProps = jobMap.getMap();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.