Codebase list maven-plugin-tools / 9f8d276
New upstream version 3.6.4 Emmanuel Bourg 1 year, 7 months ago
28 changed file(s) with 255 addition(s) and 328 deletion(s). Raw diff Collapse all Expand all
2323 - maven-plugins
2424 - maven-plugin-plugin
2525 - maven
26 enabled_merge_buttons:
27 squash: true
28 merge: false
29 rebase: true
30 notifications:
31 commits: commits@maven.apache.org
32 issues: issues@maven.apache.org
33 pullrequests: issues@maven.apache.org
34 jira_options: link label comment
0 # Licensed to the Apache Software Foundation (ASF) under one
1 # or more contributor license agreements. See the NOTICE file
2 # distributed with this work for additional information
3 # regarding copyright ownership. The ASF licenses this file
4 # to you under the Apache License, Version 2.0 (the
5 # "License"); you may not use this file except in compliance
6 # with the License. You may obtain a copy of the License at
7 #
8 # http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing,
11 # software distributed under the License is distributed on an
12 # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
13 # KIND, either express or implied. See the License for the
14 # specific language governing permissions and limitations
15 # under the License.
16
17 version: 2
18 updates:
19 - package-ecosystem: "maven"
20 directory: "/"
21 schedule:
22 interval: "daily"
23 - package-ecosystem: "github-actions"
24 directory: "/"
25 schedule:
26 interval: "daily"
1313 .DS_Store
1414
1515 .java-version
16 .factorypath
2222 <parent>
2323 <artifactId>maven-plugin-tools</artifactId>
2424 <groupId>org.apache.maven.plugin-tools</groupId>
25 <version>3.6.3</version>
25 <version>3.6.4</version>
2626 </parent>
2727
2828 <artifactId>maven-plugin-annotations</artifactId>
2222 <parent>
2323 <artifactId>maven-plugin-tools</artifactId>
2424 <groupId>org.apache.maven.plugin-tools</groupId>
25 <version>3.6.3</version>
25 <version>3.6.4</version>
2626 </parent>
2727
2828 <groupId>org.apache.maven.plugins</groupId>
4141 </prerequisites>
4242
4343 <properties>
44 <doxiaVersion>1.9.1</doxiaVersion>
45 <doxia-sitetoolsVersion>1.9.2</doxia-sitetoolsVersion>
44 <doxiaVersion>1.11.1</doxiaVersion>
45 <doxia-sitetoolsVersion>1.11.1</doxia-sitetoolsVersion>
4646 <it.debug>true</it.debug>
4747 </properties>
4848
6060 <!-- dependency of org.apache.maven.plugin-tools:maven-plugin-tools-annotations:@project.version@:jar:tests -->
6161 <groupId>junit</groupId>
6262 <artifactId>junit</artifactId>
63 <version>4.12</version>
63 <version>4.13.2</version>
6464 </dependency>
6565
6666 <dependency>
5858 <!-- dependency of org.apache.maven.plugin-tools:maven-plugin-tools-annotations:@project.version@:jar:tests -->
5959 <groupId>junit</groupId>
6060 <artifactId>junit</artifactId>
61 <version>4.12</version>
61 <version>4.13.2</version>
6262 </dependency>
6363 <dependency>
6464 <groupId>org.apache.maven.plugin-tools</groupId>
3434
3535 <dependencies>
3636 <dependency>
37 <groupId>bsh</groupId>
37 <groupId>org.apache-extras.beanshell</groupId>
3838 <artifactId>bsh</artifactId>
39 <version>1.3.0</version>
39 <version>2.0b6</version>
4040 </dependency>
4141 <dependency>
4242 <groupId>org.apache.maven.plugin-tools</groupId>
6161 <!-- dependency of org.apache.maven.plugin-tools:maven-plugin-tools-annotations:@project.version@:jar:tests -->
6262 <groupId>junit</groupId>
6363 <artifactId>junit</artifactId>
64 <version>4.12</version>
64 <version>4.13.2</version>
6565 </dependency>
6666
6767 <dependency>
0 package org.apache.maven.artifact.repository.metadata;
1
2 /*
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 */
20
21 import java.util.Iterator;
22 import java.util.List;
23
24 import org.apache.maven.artifact.repository.ArtifactRepository;
25
26 /**
27 * Metadata for the group directory of the repository.
28 * Class copied from maven-compat for to remove dependency but keep compatibility with Maven 3 (and Nexus Staging
29 * Plugin, see <a href="https://issues.apache.org/jira/browse/MPLUGIN-384">MPLUGIN-384</a>)
30 *
31 * @author <a href="mailto:brett@apache.org">Brett Porter</a>
32 */
33 public class GroupRepositoryMetadata
34 extends AbstractRepositoryMetadata
35 {
36 private final String groupId;
37
38 public GroupRepositoryMetadata( String groupId )
39 {
40 super( new Metadata() );
41 this.groupId = groupId;
42 }
43
44 public boolean storedInGroupDirectory()
45 {
46 return true;
47 }
48
49 public boolean storedInArtifactVersionDirectory()
50 {
51 return false;
52 }
53
54 public String getGroupId()
55 {
56 return groupId;
57 }
58
59 public String getArtifactId()
60 {
61 return null;
62 }
63
64 public String getBaseVersion()
65 {
66 return null;
67 }
68
69 public void addPluginMapping( String goalPrefix,
70 String artifactId )
71 {
72 addPluginMapping( goalPrefix, artifactId, artifactId );
73 }
74
75 public void addPluginMapping( String goalPrefix,
76 String artifactId,
77 String name )
78 {
79 List<Plugin> plugins = getMetadata().getPlugins();
80 boolean found = false;
81 for ( Iterator<Plugin> i = plugins.iterator(); i.hasNext() && !found; )
82 {
83 Plugin plugin = i.next();
84 if ( plugin.getPrefix().equals( goalPrefix ) )
85 {
86 found = true;
87 }
88 }
89 if ( !found )
90 {
91 Plugin plugin = new Plugin();
92 plugin.setPrefix( goalPrefix );
93 plugin.setArtifactId( artifactId );
94 plugin.setName( name );
95
96
97 getMetadata().addPlugin( plugin );
98 }
99 }
100
101 public Object getKey()
102 {
103 return groupId;
104 }
105
106 public boolean isSnapshot()
107 {
108 return false;
109 }
110
111 public ArtifactRepository getRepository()
112 {
113 return null;
114 }
115
116 public void setRepository( ArtifactRepository remoteRepository )
117 {
118 // intentionally blank
119 }
120 }
2020
2121 import org.apache.maven.artifact.Artifact;
2222 import org.apache.maven.artifact.repository.metadata.ArtifactRepositoryMetadata;
23 import org.apache.maven.artifact.repository.metadata.GroupRepositoryMetadata;
2324 import org.apache.maven.artifact.repository.metadata.Versioning;
2425 import org.apache.maven.plugin.AbstractMojo;
2526 import org.apache.maven.plugin.MojoExecutionException;
+0
-122
maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/metadata/GroupRepositoryMetadata.java less more
0 package org.apache.maven.plugin.plugin.metadata;
1
2 /*
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 */
20
21 import java.util.Iterator;
22 import java.util.List;
23
24 import org.apache.maven.artifact.repository.ArtifactRepository;
25 import org.apache.maven.artifact.repository.metadata.AbstractRepositoryMetadata;
26 import org.apache.maven.artifact.repository.metadata.Metadata;
27 import org.apache.maven.artifact.repository.metadata.Plugin;
28
29 /**
30 * Metadata for the group directory of the repository.
31 *
32 * @author <a href="mailto:brett@apache.org">Brett Porter</a>
33 */
34 public class GroupRepositoryMetadata
35 extends AbstractRepositoryMetadata
36 {
37 private final String groupId;
38
39 public GroupRepositoryMetadata( String groupId )
40 {
41 super( new Metadata() );
42 this.groupId = groupId;
43 }
44
45 public boolean storedInGroupDirectory()
46 {
47 return true;
48 }
49
50 public boolean storedInArtifactVersionDirectory()
51 {
52 return false;
53 }
54
55 public String getGroupId()
56 {
57 return groupId;
58 }
59
60 public String getArtifactId()
61 {
62 return null;
63 }
64
65 public String getBaseVersion()
66 {
67 return null;
68 }
69
70 public void addPluginMapping( String goalPrefix,
71 String artifactId )
72 {
73 addPluginMapping( goalPrefix, artifactId, artifactId );
74 }
75
76 public void addPluginMapping( String goalPrefix,
77 String artifactId,
78 String name )
79 {
80 List<Plugin> plugins = getMetadata().getPlugins();
81 boolean found = false;
82 for ( Iterator<Plugin> i = plugins.iterator(); i.hasNext() && !found; )
83 {
84 Plugin plugin = i.next();
85 if ( plugin.getPrefix().equals( goalPrefix ) )
86 {
87 found = true;
88 }
89 }
90 if ( !found )
91 {
92 Plugin plugin = new Plugin();
93 plugin.setPrefix( goalPrefix );
94 plugin.setArtifactId( artifactId );
95 plugin.setName( name );
96
97
98 getMetadata().addPlugin( plugin );
99 }
100 }
101
102 public Object getKey()
103 {
104 return groupId;
105 }
106
107 public boolean isSnapshot()
108 {
109 return false;
110 }
111
112 public ArtifactRepository getRepository()
113 {
114 return null;
115 }
116
117 public void setRepository( ArtifactRepository remoteRepository )
118 {
119 // intentionally blank
120 }
121 }
3434 +------------------
3535 <dependencies>
3636 <dependency>
37 <groupId>bsh</groupId>
37 <groupId>org.apache-extras.beanshell</groupId>
3838 <artifactId>bsh</artifactId>
39 <version>1.3.0</version>
39 <version>2.0b6</version>
4040 </dependency>
4141 <dependency>
4242 <groupId>org.apache.maven</groupId>
4343 <artifactId>maven-script-beanshell</artifactId>
44 <version>2.2.1</version>
44 <version>3.6.4</version>
4545 </dependency>
4646 </dependencies>
4747
2121 <parent>
2222 <groupId>org.apache.maven.plugin-tools</groupId>
2323 <artifactId>maven-plugin-tools</artifactId>
24 <version>3.6.3</version>
24 <version>3.6.4</version>
2525 </parent>
2626
2727 <artifactId>maven-plugin-tools-annotations</artifactId>
7373 <dependency>
7474 <groupId>org.codehaus.plexus</groupId>
7575 <artifactId>plexus-archiver</artifactId>
76 <version>4.2.5</version><!-- Java 7 -->
7677 </dependency>
7778
7879 <dependency>
8889 <dependency>
8990 <groupId>org.codehaus.plexus</groupId>
9091 <artifactId>plexus-compiler-manager</artifactId>
91 <version>1.8.6</version>
92 <exclusions>
93 <exclusion>
94 <groupId>org.codehaus.plexus</groupId>
95 <artifactId>plexus-component-api</artifactId>
96 </exclusion>
97 </exclusions>
92 <version>2.8.8</version><!-- Java 7 -->
9893 <scope>test</scope>
9994 </dependency>
10095 <dependency>
108103 <scope>test</scope>
109104 </dependency>
110105 <dependency>
111 <groupId>org.easytesting</groupId>
112 <artifactId>fest-assert</artifactId>
113 <version>1.4</version>
106 <groupId>org.assertj</groupId>
107 <artifactId>assertj-core</artifactId>
108 <version>2.9.1</version><!-- Java 7 -->
114109 <scope>test</scope>
115110 </dependency>
116111 </dependencies>
2828 import org.apache.maven.tools.plugin.extractor.annotations.scanner.MojoAnnotationsScanner;
2929 import org.apache.maven.tools.plugin.extractor.annotations.scanner.MojoAnnotationsScannerRequest;
3030 import org.codehaus.plexus.PlexusTestCase;
31 import org.fest.assertions.Assertions;
3231
3332 import java.io.File;
3433 import java.util.Arrays;
3534 import java.util.Collection;
3635 import java.util.Collections;
3736 import java.util.Map;
37
38 import static org.assertj.core.api.Assertions.assertThat;
3839
3940 /**
4041 * @author Olivier Lamy
5657
5758 System.out.println( "mojoAnnotatedClasses:" + mojoAnnotatedClasses );
5859
59 Assertions.assertThat( mojoAnnotatedClasses ).isNotNull().isNotEmpty().hasSize( 1 );
60 assertThat( mojoAnnotatedClasses ).isNotNull().isNotEmpty().hasSize( 1 );
6061
6162 MojoAnnotatedClass mojoAnnotatedClass = mojoAnnotatedClasses.values().iterator().next();
6263
7778 assertEquals( LifecyclePhase.PACKAGE, execute.phase() );
7879
7980 Collection<ComponentAnnotationContent> components = mojoAnnotatedClass.getComponents().values();
80 Assertions.assertThat( components ).isNotNull().isNotEmpty().hasSize( 2 );
81 assertThat( components ).isNotNull().isNotEmpty().hasSize( 2 );
8182
8283 Collection<ParameterAnnotationContent> parameters = mojoAnnotatedClass.getParameters().values();
83 Assertions.assertThat( parameters ).isNotNull().isNotEmpty().hasSize( 2 ).contains(
84 assertThat( parameters ).isNotNull().isNotEmpty().hasSize( 2 ).contains(
8485 new ParameterAnnotationContent( "bar", null, "thebar", "coolbar", true, false, String.class.getName() ),
8586 new ParameterAnnotationContent( "beer", null, "thebeer", "coolbeer", false, false,
8687 String.class.getName() ) );
2424 <parent>
2525 <groupId>org.apache.maven.plugin-tools</groupId>
2626 <artifactId>maven-plugin-tools</artifactId>
27 <version>3.6.3</version>
27 <version>3.6.4</version>
2828 </parent>
2929
3030 <artifactId>maven-plugin-tools-api</artifactId>
2424 <parent>
2525 <groupId>org.apache.maven.plugin-tools</groupId>
2626 <artifactId>maven-plugin-tools</artifactId>
27 <version>3.6.3</version>
27 <version>3.6.4</version>
2828 </parent>
2929
3030 <artifactId>maven-plugin-tools-generators</artifactId>
2424 <parent>
2525 <groupId>org.apache.maven.plugin-tools</groupId>
2626 <artifactId>maven-plugin-tools</artifactId>
27 <version>3.6.3</version>
27 <version>3.6.4</version>
2828 </parent>
2929
3030 <artifactId>maven-plugin-tools-java</artifactId>
7474 <dependency>
7575 <groupId>xmlunit</groupId>
7676 <artifactId>xmlunit</artifactId>
77 <version>1.3</version>
77 <version>1.6</version>
7878 <scope>test</scope>
7979 </dependency>
8080 </dependencies>
2424 <parent>
2525 <groupId>org.apache.maven.plugin-tools</groupId>
2626 <artifactId>maven-script</artifactId>
27 <version>3.6.3</version>
27 <version>3.6.4</version>
2828 </parent>
2929
3030 <artifactId>maven-plugin-tools-ant</artifactId>
2424 <parent>
2525 <groupId>org.apache.maven.plugin-tools</groupId>
2626 <artifactId>maven-script</artifactId>
27 <version>3.6.3</version>
27 <version>3.6.4</version>
2828 </parent>
2929
3030 <artifactId>maven-plugin-tools-beanshell</artifactId>
5555
5656 <!-- misc -->
5757 <dependency>
58 <groupId>org.beanshell</groupId>
58 <groupId>org.apache-extras.beanshell</groupId>
5959 <artifactId>bsh</artifactId>
60 <version>1.3.0</version>
60 <version>2.0b6</version>
6161 </dependency>
6262 </dependencies>
6363
2424 <parent>
2525 <groupId>org.apache.maven.plugin-tools</groupId>
2626 <artifactId>maven-script</artifactId>
27 <version>3.6.3</version>
27 <version>3.6.4</version>
2828 </parent>
2929
3030 <artifactId>maven-plugin-tools-model</artifactId>
2222 <parent>
2323 <groupId>org.apache.maven.plugin-tools</groupId>
2424 <artifactId>maven-script</artifactId>
25 <version>3.6.3</version>
25 <version>3.6.4</version>
2626 </parent>
2727
2828 <artifactId>maven-script-ant</artifactId>
5959 <dependency>
6060 <groupId>org.codehaus.plexus</groupId>
6161 <artifactId>plexus-archiver</artifactId>
62 <version>4.2.5</version><!-- Java 7 -->
6263 </dependency>
6364 <dependency>
6465 <groupId>org.apache.maven</groupId>
3333 import org.apache.tools.ant.PropertyHelper;
3434 import org.apache.tools.ant.types.Path;
3535 import org.codehaus.plexus.archiver.ArchiverException;
36 import org.codehaus.plexus.archiver.UnArchiver;
3736 import org.codehaus.plexus.archiver.zip.ZipUnArchiver;
3837 import org.codehaus.plexus.component.MapOrientedComponent;
3938 import org.codehaus.plexus.component.configurator.ComponentConfigurationException;
203202
204203 try
205204 {
206 UnArchiver ua = new ZipUnArchiver( pluginJar );
205 ZipUnArchiver ua = new ZipUnArchiver( pluginJar );
206 ua.enableLogging( logger );
207207
208208 ua.extract( resourcesPath, outputDirectory );
209209 }
8686 {
8787 String pluginXml = "META-INF/maven/plugin-2.1.xml";
8888
89 List<String> messages = run( pluginXml, true );
90
91 assertPresence( messages, "Unpacked Ant build scripts (in Maven build directory).", false );
92 assertPresence( messages, "Maven parameter expression evaluator for Ant properties.", false );
93 assertPresence( messages, "Maven standard project-based classpath references.", false );
94 assertPresence( messages, "Maven standard plugin-based classpath references.", false );
95 assertPresence( messages,
96 "Maven project, session, mojo-execution, or path-translation parameter information is", false );
97 assertPresence( messages, "maven-script-ant < 2.1.0, or used maven-plugin-tools-ant < 2.2 during release",
98 false );
89 List<String> messages = run( pluginXml );
90
91 assertPresence( messages, "Unpacked Ant build scripts (in Maven build directory)." );
92 assertPresence( messages, "Maven parameter expression evaluator for Ant properties." );
93 assertPresence( messages, "Maven standard project-based classpath references." );
94 assertPresence( messages, "Maven standard plugin-based classpath references." );
95 assertPresence( messages, "Maven project, session, mojo-execution, or path-translation parameter information is" );
96 assertPresence( messages, "maven-script-ant < 2.1.0, or used maven-plugin-tools-ant < 2.2 during release" );
9997
10098 ArgumentCaptor<BuildEvent> buildEvent = ArgumentCaptor.forClass(BuildEvent.class);
10199 verify( buildListener, atLeastOnce() ).messageLogged( buildEvent.capture() );
105103 assertThat( buildEvent.getValue().getMessage(), endsWith( ".test.jar" ) );
106104 }
107105
108 @Test
109 public void test20StylePlugin()
110 throws PlexusConfigurationException, IOException, ComponentInstantiationException, MojoExecutionException,
111 ComponentConfigurationException, ArchiverException, URISyntaxException
112 {
113 String pluginXml = "META-INF/maven/plugin-2.0.xml";
114
115 List<String> messages = run( pluginXml, false );
116
117 assertPresence( messages, "Unpacked Ant build scripts (in Maven build directory).", true );
118 assertPresence( messages, "Maven parameter expression evaluator for Ant properties.", true );
119 assertPresence( messages, "Maven standard project-based classpath references.", true );
120 assertPresence( messages, "Maven standard plugin-based classpath references.", true );
121 assertPresence( messages,
122 "Maven project, session, mojo-execution, or path-translation parameter information is", true );
123 assertPresence( messages, "maven-script-ant < 2.1.0, or used maven-plugin-tools-ant < 2.2 during release", true );
124
125 ArgumentCaptor<BuildEvent> buildEvent = ArgumentCaptor.forClass(BuildEvent.class);
126 verify( buildListener, atLeastOnce() ).messageLogged( buildEvent.capture() );
127
128 // last message
129 assertThat( buildEvent.getValue().getMessage(), startsWith( "plugin classpath is: " ) );
130 assertThat( buildEvent.getValue().getMessage(), endsWith( "path-is-missing" ) );
131 }
132
133 private void assertPresence( List<String> messages, String test, boolean shouldBePresent )
106 private void assertPresence( List<String> messages, String test )
134107 {
135108 for ( String message : messages )
136109 {
137110 if ( message.contains( test ) )
138111 {
139 if ( !shouldBePresent )
140 {
141 fail( "Test string: '" + test + "' was found in output, but SHOULD NOT BE THERE." );
142 }
112 fail( "Test string: '" + test + "' was found in output, but SHOULD NOT BE THERE." );
143113 return;
144114 }
145115 }
146
147 if ( shouldBePresent )
148 {
149 fail( "Test string: '" + test + "' was NOT found in output, but SHOULD BE THERE." );
150 }
151 }
152
153 private List<String> run( String pluginXml, boolean includeImplied )
116 }
117
118 private List<String> run( String pluginXml )
154119 throws PlexusConfigurationException, IOException, ComponentInstantiationException, MojoExecutionException,
155120 ComponentConfigurationException, ArchiverException, URISyntaxException
156121 {
184149 Artifact artifact = mock( Artifact.class );
185150 PathTranslator pt = mock( PathTranslator.class );
186151
187 if ( includeImplied )
188 {
189 File pluginXmlFile = Paths.get( resource.toURI() ).toFile();
190
191 File jarFile = File.createTempFile( "AntMojoWrapperTest.", ".test.jar" );
192 jarFile.deleteOnExit();
193
194 JarArchiver archiver = new JarArchiver();
195 archiver.enableLogging( new ConsoleLogger( Logger.LEVEL_ERROR, "archiver" ) );
196 archiver.setDestFile( jarFile );
197 archiver.addFile( pluginXmlFile, pluginXml );
198 archiver.createArchive();
199
200 when( artifact.getFile() ).thenReturn( jarFile );
201
202 Model model = new Model();
203
204 Build build = new Build();
205 build.setDirectory( "target" );
206
207 model.setBuild( build );
208
209 MavenProject project = new MavenProject( model );
210 project.setFile( new File( "pom.xml" ).getAbsoluteFile() );
211
212 pd.setPluginArtifact( artifact );
213 pd.setArtifacts( Collections.singletonList( artifact ) );
214
215 config.put( "project", project );
216 config.put( "session", new MavenSession( null, null, null, null, null, null, null, null, null, null ) );
217 config.put( "mojoExecution", new MojoExecution( md ) );
218
219 ComponentRequirement cr = new ComponentRequirement();
220 cr.setRole( PathTranslator.class.getName() );
221
222 wrapper.addComponentRequirement( cr, pt );
223 }
152 File pluginXmlFile = Paths.get( resource.toURI() ).toFile();
153
154 File jarFile = File.createTempFile( "AntMojoWrapperTest.", ".test.jar" );
155 jarFile.deleteOnExit();
156
157 JarArchiver archiver = new JarArchiver();
158 archiver.enableLogging( new ConsoleLogger( Logger.LEVEL_ERROR, "archiver" ) );
159 archiver.setDestFile( jarFile );
160 archiver.addFile( pluginXmlFile, pluginXml );
161 archiver.createArchive();
162
163 when( artifact.getFile() ).thenReturn( jarFile );
164
165 Model model = new Model();
166
167 Build build = new Build();
168 build.setDirectory( "target" );
169
170 model.setBuild( build );
171
172 MavenProject project = new MavenProject( model );
173 project.setFile( new File( "pom.xml" ).getAbsoluteFile() );
174
175 pd.setPluginArtifact( artifact );
176 pd.setArtifacts( Collections.singletonList( artifact ) );
177
178 config.put( "project", project );
179 config.put( "session", new MavenSession( null, null, null, null, null, null, null, null, null, null ) );
180 config.put( "mojoExecution", new MojoExecution( md ) );
181
182 ComponentRequirement cr = new ComponentRequirement();
183 cr.setRole( PathTranslator.class.getName() );
184
185 wrapper.addComponentRequirement( cr, pt );
224186
225187 wrapper.setComponentConfiguration( config );
226188
250212 messages.addAll( tbl.messages );
251213 }
252214
253 messages.add( new String( baos.toByteArray() ) );
215 messages.add( baos.toString() );
254216
255217 return messages;
256218 }
258220 private static final class TestBuildListener
259221 implements BuildListener
260222 {
261 private List<String> messages = new ArrayList<>();
223 private final List<String> messages = new ArrayList<>();
262224
263225 public void buildFinished( BuildEvent arg0 )
264226 {
+0
-63
maven-script/maven-script-ant/src/test/resources/META-INF/maven/plugin-2.0.xml less more
0 <?xml version='1.0'?>
1 <!--
2 Licensed to the Apache Software Foundation (ASF) under one
3 or more contributor license agreements. See the NOTICE file
4 distributed with this work for additional information
5 regarding copyright ownership. The ASF licenses this file
6 to you under the Apache License, Version 2.0 (the
7 "License"); you may not use this file except in compliance
8 with the License. You may obtain a copy of the License at
9
10 http://www.apache.org/licenses/LICENSE-2.0
11
12 Unless required by applicable law or agreed to in writing,
13 software distributed under the License is distributed on an
14 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 KIND, either express or implied. See the License for the
16 specific language governing permissions and limitations
17 under the License.
18 -->
19
20 <plugin>
21 <description>Test Plugin</description>
22 <groupId>org.myplugin</groupId>
23 <artifactId>my-plugin</artifactId>
24 <version>1</version>
25 <goalPrefix>myplugin</goalPrefix>
26 <isolatedRealm>false</isolatedRealm>
27 <inheritedByDefault>true</inheritedByDefault>
28 <mojos>
29 <mojo>
30 <goal>test</goal>
31 <description>Build a JAR from the current project.</description>
32 <requiresDirectInvocation>false</requiresDirectInvocation>
33 <requiresProject>false</requiresProject>
34 <requiresReports>false</requiresReports>
35 <aggregator>false</aggregator>
36 <requiresOnline>false</requiresOnline>
37 <inheritedByDefault>true</inheritedByDefault>
38 <implementation>test.build.xml:test</implementation>
39 <language>ant</language>
40 <instantiationStrategy>per-lookup</instantiationStrategy>
41 <executionStrategy>once-per-session</executionStrategy>
42 <parameters>
43 <parameter>
44 <name>basedir</name>
45 <required>true</required>
46 <editable>false</editable>
47 <type>java.io.File</type>
48 </parameter>
49 <parameter>
50 <name>messageLevel</name>
51 <required>true</required>
52 <editable>false</editable>
53 <type>java.lang.String</type>
54 </parameter>
55 </parameters>
56 <configuration>
57 <basedir implementation="java.io.File">${basedir}</basedir>
58 <messageLevel implementation="java.lang.String">${messageLevel}</messageLevel>
59 </configuration>
60 </mojo>
61 </mojos>
62 </plugin>
2222 <parent>
2323 <groupId>org.apache.maven.plugin-tools</groupId>
2424 <artifactId>maven-script</artifactId>
25 <version>3.6.3</version>
25 <version>3.6.4</version>
2626 </parent>
2727
2828 <artifactId>maven-script-beanshell</artifactId>
4747 </exclusions>
4848 </dependency>
4949 <dependency>
50 <groupId>bsh</groupId>
50 <groupId>org.apache-extras.beanshell</groupId>
5151 <artifactId>bsh</artifactId>
52 <version>1.3.0</version>
52 <version>2.0b6</version>
5353 </dependency>
5454 </dependencies>
5555 </project>
2222 <parent>
2323 <groupId>org.apache.maven.plugin-tools</groupId>
2424 <artifactId>maven-plugin-tools</artifactId>
25 <version>3.6.3</version>
25 <version>3.6.4</version>
2626 </parent>
2727
2828 <artifactId>maven-script</artifactId>
2828
2929 <groupId>org.apache.maven.plugin-tools</groupId>
3030 <artifactId>maven-plugin-tools</artifactId>
31 <version>3.6.3</version>
31 <version>3.6.4</version>
3232 <packaging>pom</packaging>
3333
3434 <name>Maven Plugin Tools</name>
7171 <connection>scm:git:https://gitbox.apache.org/repos/asf/maven-plugin-tools.git</connection>
7272 <developerConnection>scm:git:https://gitbox.apache.org/repos/asf/maven-plugin-tools.git</developerConnection>
7373 <url>https://github.com/apache/maven-plugin-tools/tree/${project.scm.tag}</url>
74 <tag>maven-plugin-tools-3.6.3</tag>
74 <tag>maven-plugin-tools-3.6.4</tag>
7575 </scm>
7676 <issueManagement>
7777 <system>jira</system>
9393 <javaVersion>7</javaVersion>
9494 <pluginTestingHarnessVersion>3.3.0</pluginTestingHarnessVersion>
9595 <mavenVersion>3.2.5</mavenVersion>
96 <antVersion>1.7.1</antVersion>
96 <antVersion>1.9.16</antVersion>
9797 <sisuVersion>0.3.5</sisuVersion>
9898 <mavenInvokerPluginVersion>3.2.2</mavenInvokerPluginVersion>
9999 <maven.site.path>plugin-tools-archives/plugin-tools-LATEST</maven.site.path>
100 <asmVersion>9.1</asmVersion>
101 <project.build.outputTimestamp>2022-01-08T11:19:58Z</project.build.outputTimestamp>
100 <asmVersion>9.2</asmVersion>
101 <project.build.outputTimestamp>2022-01-10T23:05:06Z</project.build.outputTimestamp>
102102 </properties>
103103
104104 <dependencyManagement>
184184 <dependency>
185185 <groupId>org.codehaus.plexus</groupId>
186186 <artifactId>plexus-component-annotations</artifactId>
187 <version>2.1.0</version>
188 <exclusions>
189 <exclusion>
190 <groupId>junit</groupId>
191 <artifactId>junit</artifactId>
192 </exclusion>
193 </exclusions>
187 <version>2.1.1</version>
194188 </dependency>
195189 <dependency>
196190 <groupId>org.codehaus.plexus</groupId>
285279 <plugin>
286280 <groupId>org.codehaus.plexus</groupId>
287281 <artifactId>plexus-component-metadata</artifactId>
288 <version>2.1.0</version>
282 <version>2.1.1</version>
289283 <executions>
290284 <execution>
291285 <goals>