31
31
import org .codehaus .plexus .util .FileUtils ;
32
32
import org .apache .maven .shared .osgi .DefaultMaven2OsgiConverter ;
33
33
import org .apache .maven .shared .osgi .Maven2OsgiConverter ;
34
- import aQute .lib .osgi .Analyzer ;
34
+ import aQute .bnd .osgi .Analyzer ;
35
35
import java .io .File ;
36
36
import java .io .IOException ;
37
37
import java .util .Iterator ;
@@ -52,7 +52,7 @@ public class EbaMojo
52
52
extends AbstractMojo
53
53
{
54
54
55
-
55
+
56
56
public static final String APPLICATION_MF_URI = "META-INF/APPLICATION.MF" ;
57
57
58
58
private static final String [] DEFAULT_INCLUDES = {"**/**" };
@@ -70,12 +70,12 @@ public class EbaMojo
70
70
private static final String APPLICATION_EXPORTSERVICE = "Application-ExportService" ;
71
71
private static final String APPLICATION_IMPORTSERVICE = "Application-ImportService" ;
72
72
private static final String APPLICATION_USEBUNDLE = "Use-Bundle" ;
73
-
73
+
74
74
/**
75
75
* Coverter for maven pom values to OSGi manifest values (pulled in from the maven-bundle-plugin)
76
76
*/
77
77
private Maven2OsgiConverter maven2OsgiConverter = new DefaultMaven2OsgiConverter ();
78
-
78
+
79
79
/**
80
80
* Single directory for extra files to include in the eba.
81
81
*
@@ -167,8 +167,8 @@ public class EbaMojo
167
167
*
168
168
* @parameter
169
169
*/
170
- private Map instructions = new LinkedHashMap ();;
171
-
170
+ private Map instructions = new LinkedHashMap ();;
171
+
172
172
/**
173
173
* Adding pom.xml and pom.properties to the archive.
174
174
*
@@ -199,9 +199,9 @@ public class EbaMojo
199
199
200
200
/**
201
201
* Define which bundles to include in the archive.
202
- * none - no bundles are included
202
+ * none - no bundles are included
203
203
* applicationContent - direct dependencies go into the content
204
- * all - direct and transitive dependencies go into the content
204
+ * all - direct and transitive dependencies go into the content
205
205
*
206
206
* @parameter expression="${archiveContent}" default-value="applicationContent"
207
207
*/
@@ -226,10 +226,10 @@ public void execute()
226
226
if (archiveContent == null ) {
227
227
archiveContent = new String ("applicationContent" );
228
228
}
229
-
230
- getLog ().debug ( "archiveContent[" + archiveContent + "]" );
231
- getLog ().info ( "archiveContent[" + archiveContent + "]" );
232
-
229
+
230
+ getLog ().debug ( "archiveContent[" + archiveContent + "]" );
231
+ getLog ().info ( "archiveContent[" + archiveContent + "]" );
232
+
233
233
zipArchiver .setIncludeEmptyDirs ( includeEmptyDirs );
234
234
zipArchiver .setCompress ( true );
235
235
zipArchiver .setForced ( forceCreation );
@@ -258,19 +258,19 @@ public void execute()
258
258
// if use transitive is set (i.e. true) then we need to make sure archiveContent does not contradict (i.e. is set
259
259
// to the same compatible value or is the default).
260
260
if ("none" .equals (archiveContent )) {
261
- throw new MojoExecutionException ("<useTransitiveDependencies/> and <archiveContent/> incompatibly configured. <useTransitiveDependencies/> is deprecated in favor of <archiveContent/>." );
261
+ throw new MojoExecutionException ("<useTransitiveDependencies/> and <archiveContent/> incompatibly configured. <useTransitiveDependencies/> is deprecated in favor of <archiveContent/>." );
262
262
}
263
263
else {
264
- artifacts = project .getArtifacts ();
264
+ artifacts = project .getArtifacts ();
265
265
}
266
266
} else {
267
267
// check that archiveContent is compatible
268
268
if ("applicationContent" .equals (archiveContent )) {
269
- artifacts = project .getDependencyArtifacts ();
269
+ artifacts = project .getDependencyArtifacts ();
270
270
}
271
271
else {
272
272
// the only remaining options should be applicationContent="none"
273
- getLog ().info ("archiveContent=none: application arvhive will not contain any bundles." );
273
+ getLog ().info ("archiveContent=none: application arvhive will not contain any bundles." );
274
274
}
275
275
}
276
276
if (artifacts != null ) {
@@ -282,7 +282,7 @@ public void execute()
282
282
artifact .getScope () + "]" );
283
283
zipArchiver .addFile (artifact .getFile (), artifact .getArtifactId () + "-" + artifact .getVersion () + "." + (artifact .getType () == null ? "jar" : artifact .getType ()));
284
284
}
285
- }
285
+ }
286
286
}
287
287
}
288
288
catch ( ArchiverException e )
@@ -362,7 +362,7 @@ public void execute()
362
362
"Error generating APPLICATION.MF file: " + fileName , e );
363
363
}
364
364
}
365
-
365
+
366
366
// Check if connector deployment descriptor is there
367
367
File ddFile = new File ( getBuildDir (), APPLICATION_MF_URI );
368
368
if ( !ddFile .exists () )
@@ -480,7 +480,7 @@ private void writeApplicationManifest(String fileName)
480
480
}
481
481
482
482
}
483
-
483
+
484
484
// The maven2OsgiConverter assumes the artifact is a jar so we need our own
485
485
// This uses the same fallback scheme as the converter
486
486
private String getApplicationSymbolicName (Artifact artifact ) {
@@ -489,14 +489,14 @@ private String getApplicationSymbolicName(Artifact artifact) {
489
489
}
490
490
return artifact .getGroupId () + "." + artifact .getArtifactId ();
491
491
}
492
-
492
+
493
493
private String getApplicationVersion () {
494
494
if (instructions .containsKey (APPLICATION_VERSION )) {
495
495
return instructions .get (APPLICATION_VERSION ).toString ();
496
496
}
497
- return aQute . lib . osgi . Analyzer .cleanupVersion (project .getVersion ());
497
+ return Analyzer .cleanupVersion (project .getVersion ());
498
498
}
499
-
499
+
500
500
protected File getBuildDir ()
501
501
{
502
502
if ( buildDir == null )
@@ -519,16 +519,16 @@ private void includeCustomApplicationManifestFile()
519
519
FileUtils .copyFileToDirectory ( appMfFile , metaInfDir );
520
520
}
521
521
}
522
-
522
+
523
523
/**
524
- * Return artifacts in 'compile' or 'runtime' scope only.
524
+ * Return artifacts in 'compile' or 'runtime' scope only.
525
525
*/
526
- private Set <Artifact > selectArtifacts (Set <Artifact > artifacts )
526
+ private Set <Artifact > selectArtifacts (Set <Artifact > artifacts )
527
527
{
528
528
Set <Artifact > selected = new LinkedHashSet <Artifact >();
529
529
for (Artifact artifact : artifacts ) {
530
530
String scope = artifact .getScope ();
531
- if (scope == null
531
+ if (scope == null
532
532
|| Artifact .SCOPE_COMPILE .equals (scope )
533
533
|| Artifact .SCOPE_RUNTIME .equals (scope )) {
534
534
selected .add (artifact );
0 commit comments