This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 219789
Collapse All | Expand All

(-)a/hudson.maven/nbproject/project.xml (-26 lines)
Lines 6-20 Link Here
6
            <code-name-base>org.netbeans.modules.hudson.maven</code-name-base>
6
            <code-name-base>org.netbeans.modules.hudson.maven</code-name-base>
7
            <module-dependencies>
7
            <module-dependencies>
8
                <dependency>
8
                <dependency>
9
                    <code-name-base>org.netbeans.api.annotations.common</code-name-base>
10
                    <build-prerequisite/>
11
                    <compile-dependency/>
12
                    <run-dependency>
13
                        <release-version>1</release-version>
14
                        <specification-version>1.14</specification-version>
15
                    </run-dependency>
16
                </dependency>
17
                <dependency>
18
                    <code-name-base>org.netbeans.modules.hudson</code-name-base>
9
                    <code-name-base>org.netbeans.modules.hudson</code-name-base>
19
                    <build-prerequisite/>
10
                    <build-prerequisite/>
20
                    <compile-dependency/>
11
                    <compile-dependency/>
Lines 59-73 Link Here
59
                    </run-dependency>
50
                    </run-dependency>
60
                </dependency>
51
                </dependency>
61
                <dependency>
52
                <dependency>
62
                    <code-name-base>org.netbeans.modules.xml.catalog</code-name-base>
63
                    <build-prerequisite/>
64
                    <compile-dependency/>
65
                    <run-dependency>
66
                        <release-version>2</release-version>
67
                        <specification-version>1.15</specification-version>
68
                    </run-dependency>
69
                </dependency>
70
                <dependency>
71
                    <code-name-base>org.netbeans.modules.xml.xam</code-name-base>
53
                    <code-name-base>org.netbeans.modules.xml.xam</code-name-base>
72
                    <build-prerequisite/>
54
                    <build-prerequisite/>
73
                    <compile-dependency/>
55
                    <compile-dependency/>
Lines 77-90 Link Here
77
                    </run-dependency>
59
                    </run-dependency>
78
                </dependency>
60
                </dependency>
79
                <dependency>
61
                <dependency>
80
                    <code-name-base>org.openide.awt</code-name-base>
81
                    <build-prerequisite/>
82
                    <compile-dependency/>
83
                    <run-dependency>
84
                        <specification-version>7.4</specification-version>
85
                    </run-dependency>
86
                </dependency>
87
                <dependency>
88
                    <code-name-base>org.openide.filesystems</code-name-base>
62
                    <code-name-base>org.openide.filesystems</code-name-base>
89
                    <build-prerequisite/>
63
                    <build-prerequisite/>
90
                    <compile-dependency/>
64
                    <compile-dependency/>
(-)a/hudson.maven/src/org/netbeans/modules/hudson/maven/Bundle.properties (-2 lines)
Lines 40-44 Link Here
40
# Version 2 license, then the option applies only if the new code is
40
# Version 2 license, then the option applies only if the new code is
41
# made subject to such option by the copyright holder.
41
# made subject to such option by the copyright holder.
42
OpenIDE-Module-Name=Maven Hudson
42
OpenIDE-Module-Name=Maven Hudson
43
JellyTagSchemaCatalog.displayName=Jelly Tags
44
JellyTagSchemaCatalog.shortDescription=Offers schemas for standard Jelly tags and those defined by Stapler.
(-)a/hudson.maven/src/org/netbeans/modules/hudson/maven/HpiActionGoalProvider.java (-63 lines)
Lines 1-63 Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2010 Oracle and/or its affiliates. All rights reserved.
5
 *
6
 * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
7
 * Other names may be trademarks of their respective owners.
8
 *
9
 * The contents of this file are subject to the terms of either the GNU
10
 * General Public License Version 2 only ("GPL") or the Common
11
 * Development and Distribution License("CDDL") (collectively, the
12
 * "License"). You may not use this file except in compliance with the
13
 * License. You can obtain a copy of the License at
14
 * http://www.netbeans.org/cddl-gplv2.html
15
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
16
 * specific language governing permissions and limitations under the
17
 * License.  When distributing the software, include this License Header
18
 * Notice in each file and include the License file at
19
 * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
20
 * particular file as subject to the "Classpath" exception as provided
21
 * by Oracle in the GPL Version 2 section of the License file that
22
 * accompanied this code. If applicable, add the following below the
23
 * License Header, with the fields enclosed by brackets [] replaced by
24
 * your own identifying information:
25
 * "Portions Copyrighted [year] [name of copyright owner]"
26
 *
27
 * If you wish your version of this file to be governed by only the CDDL
28
 * or only the GPL Version 2, indicate your decision by adding
29
 * "[Contributor] elects to include this software in this distribution
30
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
31
 * single choice of license, a recipient has the option to distribute
32
 * your version of this file under either the CDDL, the GPL Version 2 or
33
 * to extend the choice of license to its licensees as provided above.
34
 * However, if you add GPL Version 2 code and therefore, elected the GPL
35
 * Version 2 license, then the option applies only if the new code is
36
 * made subject to such option by the copyright holder.
37
 *
38
 * Contributor(s):
39
 *
40
 * Portions Copyrighted 2009 Sun Microsystems, Inc.
41
 */
42
43
package org.netbeans.modules.hudson.maven;
44
45
import java.io.InputStream;
46
import org.netbeans.api.annotations.common.StaticResource;
47
import org.netbeans.modules.maven.spi.actions.AbstractMavenActionsProvider;
48
import org.netbeans.modules.maven.spi.actions.MavenActionsProvider;
49
import org.netbeans.spi.project.ProjectServiceProvider;
50
51
/**
52
 * Enables developers to run and debug Hudson plugins.
53
 */
54
@ProjectServiceProvider(service=MavenActionsProvider.class, projectType="org-netbeans-modules-maven/hpi")
55
public class HpiActionGoalProvider extends AbstractMavenActionsProvider {
56
57
    @StaticResource private static final String MAPPINGS = "org/netbeans/modules/hudson/maven/action-mappings.xml";
58
59
    @Override protected InputStream getActionDefinitionStream() {
60
        return HpiActionGoalProvider.class.getClassLoader().getResourceAsStream(MAPPINGS);
61
    }
62
63
}
(-)a/hudson.maven/src/org/netbeans/modules/hudson/maven/HudsonIcon.java (-54 lines)
Lines 1-54 Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2011 Oracle and/or its affiliates. All rights reserved.
5
 *
6
 * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
7
 * Other names may be trademarks of their respective owners.
8
 *
9
 * The contents of this file are subject to the terms of either the GNU
10
 * General Public License Version 2 only ("GPL") or the Common Development and
11
 * Distribution License("CDDL") (collectively, the "License"). You may not use
12
 * this file except in compliance with the License. You can obtain a copy of
13
 * the License at http://www.netbeans.org/cddl-gplv2.html or
14
 * nbbuild/licenses/CDDL-GPL-2-CP. See the License for the specific language
15
 * governing permissions and limitations under the License. When distributing
16
 * the software, include this License Header Notice in each file and include
17
 * the License file at nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
18
 * particular file as subject to the "Classpath" exception as provided by
19
 * Oracle in the GPL Version 2 section of the License file that accompanied
20
 * this code. If applicable, add the following below the License Header, with
21
 * the fields enclosed by brackets [] replaced by your own identifying
22
 * information: "Portions Copyrighted [year] [name of copyright owner]"
23
 *
24
 * If you wish your version of this file to be governed by only the CDDL or
25
 * only the GPL Version 2, indicate your decision by adding "[Contributor]
26
 * elects to include this software in this distribution under the [CDDL or GPL
27
 * Version 2] license." If you do not indicate a single choice of license, a
28
 * recipient has the option to distribute your version of this file under
29
 * either the CDDL, the GPL Version 2 or to extend the choice of license to its
30
 * licensees as provided above. However, if you add GPL Version 2 code and
31
 * therefore, elected the GPL Version 2 license, then the option applies only
32
 * if the new code is made subject to such option by the copyright holder.
33
 *
34
 * Contributor(s):
35
 *
36
 * Portions Copyrighted 2011 Sun Microsystems, Inc.
37
 */
38
39
package org.netbeans.modules.hudson.maven;
40
41
import javax.swing.Icon;
42
import org.netbeans.modules.maven.api.NbMavenProject;
43
import org.netbeans.modules.maven.spi.nodes.SpecialIcon;
44
import org.netbeans.spi.project.ProjectServiceProvider;
45
import org.openide.util.ImageUtilities;
46
47
@ProjectServiceProvider(service=SpecialIcon.class, projectType="org-netbeans-modules-maven/hpi")
48
public class HudsonIcon implements SpecialIcon {
49
50
    @Override public Icon getIcon() {
51
        return ImageUtilities.loadImageIcon("org/netbeans/modules/hudson/ui/resources/instance.png", true);
52
    }
53
54
}
(-)a/hudson.maven/src/org/netbeans/modules/hudson/maven/HudsonProviderImpl.java (-9 lines)
Lines 53-69 Link Here
53
import org.netbeans.modules.maven.model.pom.CiManagement;
53
import org.netbeans.modules.maven.model.pom.CiManagement;
54
import org.netbeans.modules.maven.model.pom.POMModel;
54
import org.netbeans.modules.maven.model.pom.POMModel;
55
import org.openide.filesystems.FileObject;
55
import org.openide.filesystems.FileObject;
56
import org.openide.filesystems.MIMEResolver;
57
import org.openide.util.lookup.ServiceProvider;
56
import org.openide.util.lookup.ServiceProvider;
58
57
59
@MIMEResolver.NamespaceRegistration(
60
    displayName="",
61
    position=454,
62
    mimeType="text/x-jelly+xml",
63
    acceptedExtension="jelly",
64
    elementName="jelly",
65
    elementNS="jelly:core"
66
)
67
@ServiceProvider(service=ProjectHudsonProvider.class, position=100)
58
@ServiceProvider(service=ProjectHudsonProvider.class, position=100)
68
public class HudsonProviderImpl extends ProjectHudsonProvider {
59
public class HudsonProviderImpl extends ProjectHudsonProvider {
69
60
(-)a/hudson.maven/src/org/netbeans/modules/hudson/maven/JellyTagSchemaCatalog.java (-108 lines)
Lines 1-108 Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2010 Oracle and/or its affiliates. All rights reserved.
5
 *
6
 * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
7
 * Other names may be trademarks of their respective owners.
8
 *
9
 * The contents of this file are subject to the terms of either the GNU
10
 * General Public License Version 2 only ("GPL") or the Common
11
 * Development and Distribution License("CDDL") (collectively, the
12
 * "License"). You may not use this file except in compliance with the
13
 * License. You can obtain a copy of the License at
14
 * http://www.netbeans.org/cddl-gplv2.html
15
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
16
 * specific language governing permissions and limitations under the
17
 * License.  When distributing the software, include this License Header
18
 * Notice in each file and include the License file at
19
 * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
20
 * particular file as subject to the "Classpath" exception as provided
21
 * by Oracle in the GPL Version 2 section of the License file that
22
 * accompanied this code. If applicable, add the following below the
23
 * License Header, with the fields enclosed by brackets [] replaced by
24
 * your own identifying information:
25
 * "Portions Copyrighted [year] [name of copyright owner]"
26
 *
27
 * If you wish your version of this file to be governed by only the CDDL
28
 * or only the GPL Version 2, indicate your decision by adding
29
 * "[Contributor] elects to include this software in this distribution
30
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
31
 * single choice of license, a recipient has the option to distribute
32
 * your version of this file under either the CDDL, the GPL Version 2 or
33
 * to extend the choice of license to its licensees as provided above.
34
 * However, if you add GPL Version 2 code and therefore, elected the GPL
35
 * Version 2 license, then the option applies only if the new code is
36
 * made subject to such option by the copyright holder.
37
 *
38
 * Contributor(s):
39
 *
40
 * Portions Copyrighted 2009 Sun Microsystems, Inc.
41
 */
42
43
package org.netbeans.modules.hudson.maven;
44
45
import java.awt.Image;
46
import java.beans.PropertyChangeListener;
47
import java.util.Collections;
48
import java.util.Iterator;
49
import org.netbeans.modules.xml.catalog.spi.CatalogDescriptor;
50
import org.netbeans.modules.xml.catalog.spi.CatalogListener;
51
import org.netbeans.modules.xml.catalog.spi.CatalogReader;
52
import org.openide.util.ImageUtilities;
53
import org.openide.util.NbBundle;
54
import org.openide.util.lookup.ServiceProvider;
55
56
/**
57
 * Makes it possible to get completion on Jelly tags.
58
 * @see <a href="http://wiki.hudson-ci.org/display/HUDSON/Writing+Jelly+views+with+IDE+assistance">wiki</a>
59
 */
60
@ServiceProvider(service=CatalogReader.class, path="Plugins/XML/UserCatalogs")
61
public class JellyTagSchemaCatalog implements CatalogReader, CatalogDescriptor {
62
63
    public String resolveURI(String name) {
64
        name = name.replaceFirst("\\?.+", ""); // for some reason, get e.g. "jelly:define?fetch=false&&sync=true" here
65
        if (name.equals("jelly:stapler")) { // NOI18N
66
            return "https://stapler.dev.java.net/taglib.xsd"; // NOI18N
67
        } else if (name.startsWith("jelly:")) { // NOI18N
68
            return "jar:https://maven-jellydoc-plugin.dev.java.net/jelly-schemas.zip!/schemas/" + name.substring(6) + ".xsd"; // NOI18N
69
        } else {
70
            return null;
71
        }
72
    }
73
74
    public String getDisplayName() {
75
        return NbBundle.getMessage(JellyTagSchemaCatalog.class, "JellyTagSchemaCatalog.displayName");
76
    }
77
78
    public String getShortDescription() {
79
        return NbBundle.getMessage(JellyTagSchemaCatalog.class, "JellyTagSchemaCatalog.shortDescription");
80
    }
81
82
    public Image getIcon(int type) {
83
        return ImageUtilities.loadImage("org/netbeans/modules/xml/catalog/resources/catalog-root.gif", true);
84
    }
85
86
    public Iterator getPublicIDs() {
87
        return Collections.EMPTY_SET.iterator();
88
    }
89
90
    public void refresh() {}
91
92
    public String getSystemID(String publicId) {
93
        return null;
94
    }
95
96
    public String resolvePublic(String publicId) {
97
        return null;
98
    }
99
100
    public void addCatalogListener(CatalogListener l) {}
101
102
    public void removeCatalogListener(CatalogListener l) {}
103
104
    public void addPropertyChangeListener(PropertyChangeListener l) {}
105
106
    public void removePropertyChangeListener(PropertyChangeListener l) {}
107
108
}
(-)a/hudson.maven/src/org/netbeans/modules/hudson/maven/JellyTagSchemaCatalogBeanInfo.java (-54 lines)
Lines 1-54 Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2010 Oracle and/or its affiliates. All rights reserved.
5
 *
6
 * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
7
 * Other names may be trademarks of their respective owners.
8
 *
9
 * The contents of this file are subject to the terms of either the GNU
10
 * General Public License Version 2 only ("GPL") or the Common
11
 * Development and Distribution License("CDDL") (collectively, the
12
 * "License"). You may not use this file except in compliance with the
13
 * License. You can obtain a copy of the License at
14
 * http://www.netbeans.org/cddl-gplv2.html
15
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
16
 * specific language governing permissions and limitations under the
17
 * License.  When distributing the software, include this License Header
18
 * Notice in each file and include the License file at
19
 * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
20
 * particular file as subject to the "Classpath" exception as provided
21
 * by Oracle in the GPL Version 2 section of the License file that
22
 * accompanied this code. If applicable, add the following below the
23
 * License Header, with the fields enclosed by brackets [] replaced by
24
 * your own identifying information:
25
 * "Portions Copyrighted [year] [name of copyright owner]"
26
 *
27
 * If you wish your version of this file to be governed by only the CDDL
28
 * or only the GPL Version 2, indicate your decision by adding
29
 * "[Contributor] elects to include this software in this distribution
30
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
31
 * single choice of license, a recipient has the option to distribute
32
 * your version of this file under either the CDDL, the GPL Version 2 or
33
 * to extend the choice of license to its licensees as provided above.
34
 * However, if you add GPL Version 2 code and therefore, elected the GPL
35
 * Version 2 license, then the option applies only if the new code is
36
 * made subject to such option by the copyright holder.
37
 *
38
 * Contributor(s):
39
 *
40
 * Portions Copyrighted 2009 Sun Microsystems, Inc.
41
 */
42
43
package org.netbeans.modules.hudson.maven;
44
45
import java.beans.PropertyDescriptor;
46
import java.beans.SimpleBeanInfo;
47
48
public class JellyTagSchemaCatalogBeanInfo extends SimpleBeanInfo {
49
50
    public @Override PropertyDescriptor[] getPropertyDescriptors() {
51
        return new PropertyDescriptor[0];
52
    }
53
54
}
(-)a/hudson.maven/src/org/netbeans/modules/hudson/maven/JettyOutputProcessorFactory.java (-96 lines)
Lines 1-96 Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2010 Oracle and/or its affiliates. All rights reserved.
5
 *
6
 * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
7
 * Other names may be trademarks of their respective owners.
8
 *
9
 * The contents of this file are subject to the terms of either the GNU
10
 * General Public License Version 2 only ("GPL") or the Common
11
 * Development and Distribution License("CDDL") (collectively, the
12
 * "License"). You may not use this file except in compliance with the
13
 * License. You can obtain a copy of the License at
14
 * http://www.netbeans.org/cddl-gplv2.html
15
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
16
 * specific language governing permissions and limitations under the
17
 * License.  When distributing the software, include this License Header
18
 * Notice in each file and include the License file at
19
 * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
20
 * particular file as subject to the "Classpath" exception as provided
21
 * by Oracle in the GPL Version 2 section of the License file that
22
 * accompanied this code. If applicable, add the following below the
23
 * License Header, with the fields enclosed by brackets [] replaced by
24
 * your own identifying information:
25
 * "Portions Copyrighted [year] [name of copyright owner]"
26
 *
27
 * If you wish your version of this file to be governed by only the CDDL
28
 * or only the GPL Version 2, indicate your decision by adding
29
 * "[Contributor] elects to include this software in this distribution
30
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
31
 * single choice of license, a recipient has the option to distribute
32
 * your version of this file under either the CDDL, the GPL Version 2 or
33
 * to extend the choice of license to its licensees as provided above.
34
 * However, if you add GPL Version 2 code and therefore, elected the GPL
35
 * Version 2 license, then the option applies only if the new code is
36
 * made subject to such option by the copyright holder.
37
 *
38
 * Contributor(s):
39
 *
40
 * Portions Copyrighted 2009 Sun Microsystems, Inc.
41
 */
42
43
package org.netbeans.modules.hudson.maven;
44
45
import java.net.MalformedURLException;
46
import java.net.URL;
47
import java.util.Collections;
48
import java.util.Set;
49
import java.util.regex.Matcher;
50
import java.util.regex.Pattern;
51
import org.netbeans.api.project.Project;
52
import org.netbeans.modules.maven.api.output.OutputProcessor;
53
import org.netbeans.modules.maven.api.output.OutputProcessorFactory;
54
import org.netbeans.modules.maven.api.output.OutputVisitor;
55
import org.openide.awt.HtmlBrowser.URLDisplayer;
56
import org.openide.util.Exceptions;
57
import org.openide.util.lookup.ServiceProvider;
58
59
/**
60
 * Browses a Jetty server that has been started.
61
 */
62
@ServiceProvider(service=OutputProcessorFactory.class)
63
public class JettyOutputProcessorFactory implements OutputProcessorFactory {
64
65
    public Set<OutputProcessor> createProcessorsSet(Project project) {
66
        return Collections.<OutputProcessor>singleton(new JettyOutputProcessor());
67
    }
68
69
    private static final class JettyOutputProcessor implements OutputProcessor {
70
71
        public String[] getRegisteredOutputSequences() {
72
            return new String[] {"mojo-execute#jetty:run", "mojo-execute#hpi:run"}; // NOI18N
73
        }
74
75
        private static final Pattern LINE = Pattern.compile(".*Started SelectChannelConnector @ 0[.]0[.]0[.]0:(\\d+)"); // NOI18N
76
77
        public void processLine(String line, OutputVisitor visitor) {
78
            Matcher m = LINE.matcher(line);
79
            if (m.matches()) {
80
                try {
81
                    URLDisplayer.getDefault().showURL(new URL("http://localhost:" + m.group(1) + "/"));
82
                } catch (MalformedURLException ex) {
83
                    Exceptions.printStackTrace(ex);
84
                }
85
            }
86
        }
87
88
        public void sequenceStart(String sequenceId, OutputVisitor visitor) {}
89
90
        public void sequenceEnd(String sequenceId, OutputVisitor visitor) {}
91
92
        public void sequenceFail(String sequenceId, OutputVisitor visitor) {}
93
94
    }
95
96
}
(-)a/hudson.maven/src/org/netbeans/modules/hudson/maven/action-mappings.xml (-24 lines)
Lines 1-24 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<actions>
3
    <action>
4
        <actionName>run</actionName>
5
        <packagings>
6
            <packaging>hpi</packaging>
7
        </packagings>
8
        <goals>
9
            <goal>hpi:run</goal>
10
        </goals>
11
    </action>
12
    <action>
13
        <actionName>debug</actionName>
14
        <packagings>
15
            <packaging>hpi</packaging>
16
        </packagings>
17
        <goals>
18
            <goal>hpi:run</goal>
19
        </goals>
20
        <properties>
21
            <jpda.listen>maven</jpda.listen>
22
        </properties>
23
    </action>
24
</actions>

Return to bug 219789