mirror of https://github.com/apache/maven.git
o not sure what happened but i couldn't make an assembly the way i used to, so i reverted
o added an OSGi manifest to make it easier to Eugene to integrate into Eclipse git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@480835 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
6a36ae3b72
commit
a6977b53c7
|
@ -1,51 +0,0 @@
|
||||||
import org.apache.maven.cli.ConsoleDownloadMonitor;
|
|
||||||
import org.apache.maven.embedder.*;
|
|
||||||
import org.apache.maven.project.*;
|
|
||||||
import org.apache.maven.monitor.event.*;
|
|
||||||
import java.io.*;
|
|
||||||
import java.util.*;
|
|
||||||
import org.codehaus.plexus.logging.*;
|
|
||||||
import org.codehaus.plexus.logging.console.*;
|
|
||||||
|
|
||||||
public class Plugin
|
|
||||||
{
|
|
||||||
public Plugin()
|
|
||||||
throws Exception
|
|
||||||
{
|
|
||||||
MavenEmbedder maven = new MavenEmbedder();
|
|
||||||
|
|
||||||
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
|
|
||||||
|
|
||||||
maven.setClassLoader( classLoader );
|
|
||||||
|
|
||||||
maven.setLogger( new MavenEmbedderConsoleLogger() );
|
|
||||||
|
|
||||||
maven.start();
|
|
||||||
|
|
||||||
System.out.println( "Happy happy joy joy!" );
|
|
||||||
|
|
||||||
System.out.println( "Now build a project" );
|
|
||||||
|
|
||||||
File targetDirectory = new File( System.getProperty( "user.dir" ), "target/embedder-test-project" );
|
|
||||||
|
|
||||||
System.out.println( ">> " + targetDirectory );
|
|
||||||
|
|
||||||
File pomFile = new File( targetDirectory, "pom.xml" );
|
|
||||||
|
|
||||||
MavenProject pom = maven.readProjectWithDependencies( pomFile );
|
|
||||||
|
|
||||||
EventMonitor eventMonitor = new DefaultEventMonitor( new PlexusLoggerAdapter( new MavenEmbedderConsoleLogger() ) );
|
|
||||||
|
|
||||||
System.out.println( "<<<<<<<<<<<<<<<<<<<<<<<<<");
|
|
||||||
|
|
||||||
maven.execute( pom, Collections.singletonList( "package" ), eventMonitor, new ConsoleDownloadMonitor(), null, targetDirectory );
|
|
||||||
|
|
||||||
System.out.println( "<<<<<<<<<<<<<<<<<<<<<<<<<");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void main( String[] args )
|
|
||||||
throws Exception
|
|
||||||
{
|
|
||||||
Plugin plugin = new Plugin();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,18 +0,0 @@
|
||||||
- surefire needs to feed into the logging
|
|
||||||
- maven/plexus archiver needs to be fixed
|
|
||||||
|
|
||||||
-- to generate source folders for eclipse project from m2 pom.xml
|
|
||||||
we need to run generate-sources phase, so all plugins
|
|
||||||
registered for this phase will be kicked of and will register
|
|
||||||
target folders for compilation.
|
|
||||||
Ideally it would be nice to ask these plugins for the target
|
|
||||||
folders, but Brett said it will be only in 2.1, so I guess
|
|
||||||
we'll have to actually run these plugins and generate code.
|
|
||||||
|
|
||||||
-- In order to nicely show all the errors and events in the IDE UI
|
|
||||||
We need to have two messages for EACH event/error:
|
|
||||||
-- the short description (in Eclipse it can be used in Problems view)
|
|
||||||
-- detailed description (can be used in annotation/editors markers)
|
|
||||||
|
|
||||||
-- What are all the settings that must be provided? Ones that can be set
|
|
||||||
and what the default values would be if they aren't set.
|
|
|
@ -26,22 +26,41 @@
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<artifactId>maven-embedder</artifactId>
|
<artifactId>maven-embedder</artifactId>
|
||||||
<name>Maven Embedder</name>
|
<name>Maven Embedder</name>
|
||||||
|
<properties>
|
||||||
|
<bundleVersion>2.1.0.v20061129-1142</bundleVersion>
|
||||||
|
</properties>
|
||||||
<build>
|
<build>
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<directory>src/main/resources</directory>
|
||||||
|
<filtering>true</filtering>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>maven-assembly-plugin</artifactId>
|
<artifactId>maven-assembly-plugin</artifactId>
|
||||||
|
<version>2.1</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
|
<finalName>${artifactId}-${bundleVersion}</finalName>
|
||||||
<descriptor>src/main/assembly/dep.xml</descriptor>
|
<descriptor>src/main/assembly/dep.xml</descriptor>
|
||||||
|
<archive>
|
||||||
|
<manifestFile>target/classes/META-INF/MANIFEST.MF</manifestFile>
|
||||||
|
<!--
|
||||||
|
|
||||||
|
This doesn't work and should
|
||||||
|
|
||||||
|
<manifestEntries>
|
||||||
|
<Manifest-Version>1.0</Manifest-Version>
|
||||||
|
<Bundle-ManifestVersion>2</Bundle-ManifestVersion>
|
||||||
|
<Bundle-Name>Maven 2.x Embedder Plug-in</Bundle-Name>
|
||||||
|
<Bundle-Vendor>org.apache.maven</Bundle-Vendor>
|
||||||
|
<Bundle-SymbolicName>org.maven.ide.embedder</Bundle-SymbolicName>
|
||||||
|
<Bundle-Version>${project.version}</Bundle-Version>
|
||||||
|
<Bundle-ClassPath>.</Bundle-ClassPath>
|
||||||
|
</manifestEntries>
|
||||||
|
-->
|
||||||
|
</archive>
|
||||||
</configuration>
|
</configuration>
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>make-assembly</id>
|
|
||||||
<phase>package</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>single</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
@ -57,22 +76,16 @@
|
||||||
<version>2.1-SNAPSHOT</version>
|
<version>2.1-SNAPSHOT</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<reporting>
|
<distributionManagement>
|
||||||
<plugins>
|
<repository>
|
||||||
<!--
|
<id>apache.releases</id>
|
||||||
<plugin>
|
<name>Apache Release Distribution Repository</name>
|
||||||
<artifactId>maven-checkstyle-plugin</artifactId>
|
<url>scp://people.apache.org/www/people.apache.org/repo/m2-ibiblio-rsync-repository</url>
|
||||||
</plugin>
|
</repository>
|
||||||
<plugin>
|
<snapshotRepository>
|
||||||
<artifactId>maven-clover-plugin</artifactId>
|
<id>apache.snapshots</id>
|
||||||
</plugin>
|
<name>Apache Development Snapshot Repository</name>
|
||||||
<plugin>
|
<url>file:///tmp/embedder</url>
|
||||||
<artifactId>maven-pmd-plugin</artifactId>
|
</snapshotRepository>
|
||||||
</plugin>
|
</distributionManagement>
|
||||||
<plugin>
|
|
||||||
<artifactId>maven-project-info-reports-plugin</artifactId>
|
|
||||||
</plugin>
|
|
||||||
-->
|
|
||||||
</plugins>
|
|
||||||
</reporting>
|
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
mvn clean:clean assembly:assembly
|
|
||||||
|
|
||||||
CLASSPATH=target/maven-embedder-2.1-SNAPSHOT-dep.jar
|
|
||||||
|
|
||||||
javac -classpath $CLASSPATH Plugin.java
|
|
||||||
|
|
||||||
java -classpath $CLASSPATH:. Plugin
|
|
|
@ -7,7 +7,6 @@
|
||||||
<includeBaseDirectory>false</includeBaseDirectory>
|
<includeBaseDirectory>false</includeBaseDirectory>
|
||||||
<fileSets>
|
<fileSets>
|
||||||
<fileSet>
|
<fileSet>
|
||||||
<!-- TODO: use expressions instead: ${project.build.directory}, ${project.build.finalName}, or have a <build /> tag to include the built artifact -->
|
|
||||||
<directory>target/classes</directory>
|
<directory>target/classes</directory>
|
||||||
<outputDirectory>/</outputDirectory>
|
<outputDirectory>/</outputDirectory>
|
||||||
</fileSet>
|
</fileSet>
|
||||||
|
@ -15,7 +14,6 @@
|
||||||
<dependencySets>
|
<dependencySets>
|
||||||
<dependencySet>
|
<dependencySet>
|
||||||
<outputDirectory>/</outputDirectory>
|
<outputDirectory>/</outputDirectory>
|
||||||
<outputFileNameMapping></outputFileNameMapping>
|
|
||||||
<unpack>true</unpack>
|
<unpack>true</unpack>
|
||||||
<scope>runtime</scope>
|
<scope>runtime</scope>
|
||||||
<excludes>
|
<excludes>
|
||||||
|
|
Loading…
Reference in New Issue