如何准备Eclipse m2e配置器进行离线安装?

时间:2016-04-26 13:00:39

标签: eclipse maven m2e

如何准备Eclipse m2e配置器以进行离线安装?

这是How to preinstall Eclipse m2e configurators (Plugin execution not covered by lifecycle configuration)

之后的问题

试图破解(见下文)它们实际上是在Maven Central存储库中。虽然可能有一种方法可以获取它们的列表并缓存在本地Maven存储库(或本地网络Nexus服务器)中,但仍然存在如何安装到Eclipse中的问题。

更新。由于使用maven插件,How to perform Eclipse repository mirroring for offline installation Maven plugin?的答案无法使用。

提升为https://bugs.eclipse.org/bugs/show_bug.cgi?id=492449

详细信息:

“窗口>偏好设置> Maven>发现”正在使用

http://download.eclipse.org/technology/m2e/discovery/directory-1.6.xml

有内容

<?xml version="1.0" encoding="UTF-8"?>
<directory xmlns="http://www.eclipse.org/mylyn/discovery/directory/">
    <entry url="http://repo1.maven.org/maven2/.m2e/discovery-catalog/org.eclipse.m2e.discovery.oss-catalog-1.6.jar" permitCategories="true"/>
</directory>

目录 .jar包含

等文件对

1)lifecycle / org.eclipse.m2e.discovery.lifecycles.tycho.pluginxml

<?xml version="1.0" encoding="UTF-8"?>
    <!--
    =================== DO NOT EDIT THIS FILE ====================
    Generated by M2E Discovery Publisher 0.4.1 on 2015-10-30 22:29:48,
    any modifications will be overwritten.
    ==============================================================
    -->
    <plugin>
      <extension point="org.eclipse.m2e.core.lifecycleMappings">
        <lifecycleMapping id="org.sonatype.tycho.m2e.tychoLifecycleMapping" name="Tycho Build Lifecycle Mapping" class="org.sonatype.tycho.m2e.internal.TychoLifecycleMapping"></lifecycleMapping>
      </extension>
      <extension point="org.eclipse.m2e.core.projectConfigurators">
        <configurator id="maven-bundle-plugin" name="Project Configurator for maven-bundle-plugin osgi-bundle projects" class="org.sonatype.tycho.m2e.felix.internal.MavenBundlePluginConfigurator"></configurator>
        <configurator id="pde-maven-bundle-plugin" name="PDE integration for maven-bundle-plugin projects" class="org.sonatype.tycho.m2e.internal.PDEMavenBundlePluginConfigurator" secondaryTo="maven-bundle-plugin"></configurator>
      </extension>
    </plugin>

2)lifecycle \ org.eclipse.m2e.discovery.lifecycles.tycho.xml

<?xml version="1.0" encoding="UTF-8"?>  <lifecycleMappingMetadata>    <lifecycleMappings>
    <lifecycleMapping>
      <packagingType>eclipse-plugin</packagingType>
      <lifecycleMappingId>org.sonatype.tycho.m2e.tychoLifecycleMapping</lifecycleMappingId>
    </lifecycleMapping>
    <lifecycleMapping>
      <packagingType>eclipse-test-plugin</packagingType>
      <lifecycleMappingId>org.sonatype.tycho.m2e.tychoLifecycleMapping</lifecycleMappingId>
    </lifecycleMapping>
    <lifecycleMapping>
      <packagingType>eclipse-feature</packagingType>
      <lifecycleMappingId>org.sonatype.tycho.m2e.tychoLifecycleMapping</lifecycleMappingId>
    </lifecycleMapping>
    <lifecycleMapping>
      <packagingType>eclipse-update-site</packagingType>
      <lifecycleMappingId>org.sonatype.tycho.m2e.tychoLifecycleMapping</lifecycleMappingId>
    </lifecycleMapping>
    <lifecycleMapping>
      <packagingType>eclipse-application</packagingType>
      <lifecycleMappingId>org.sonatype.tycho.m2e.tychoLifecycleMapping</lifecycleMappingId>
    </lifecycleMapping>
    <lifecycleMapping>
      <packagingType>eclipse-repository</packagingType>
      <lifecycleMappingId>org.sonatype.tycho.m2e.tychoLifecycleMapping</lifecycleMappingId>
      <pluginExecutions>
        <pluginExecution>
          <pluginExecutionFilter>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-clean-plugin</artifactId>
            <versionRange>[0.9.0,)</versionRange>
            <goals>
              <goal>clean</goal>
            </goals>
          </pluginExecutionFilter>
          <action>
            <ignore />
          </action>
        </pluginExecution>
      </pluginExecutions>
    </lifecycleMapping>
    <lifecycleMapping>
      <packagingType>bundle</packagingType>
      <lifecycleMappingId>org.eclipse.m2e.jdt.JarLifecycleMapping</lifecycleMappingId>
    </lifecycleMapping>       </lifecycleMappings>    <pluginExecutions>
    <pluginExecution>
      <pluginExecutionFilter>
        <groupId>org.eclipse.tycho</groupId>
        <artifactId>tycho-compiler-plugin</artifactId>
        <versionRange>[0.12.0,)</versionRange>
        <goals>
          <goal>compile</goal>
          <goal>testCompile</goal>
        </goals>
        <parameters>
          <compilerId>jdt</compilerId>
        </parameters>
      </pluginExecutionFilter>
      <action>
        <ignore />
      </action>
    </pluginExecution>
    <pluginExecution>
      <pluginExecutionFilter>
        <groupId>org.eclipse.tycho</groupId>
        <artifactId>tycho-packaging-plugin</artifactId>
        <versionRange>[0.12.0,)</versionRange>
        <goals>
          <goal>build-qualifier-aggregator</goal>
          <goal>build-qualifier</goal>
          <goal>validate-id</goal>
          <goal>validate-version</goal>
        </goals>
      </pluginExecutionFilter>
      <action>
        <ignore />
      </action>
    </pluginExecution>
    <pluginExecution>
      <pluginExecutionFilter>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <versionRange>[1.0.0,)</versionRange>
        <goals>
          <goal>manifest</goal>
          <goal>bundle</goal>
        </goals>
      </pluginExecutionFilter>
      <action>
        <configurator>
          <id>maven-bundle-plugin</id>
        </configurator>
      </action>
    </pluginExecution>
    <pluginExecution>
      <pluginExecutionFilter>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <versionRange>[1.0.0,)</versionRange>
        <goals>
          <goal>manifest</goal>
          <goal>bundle</goal>
        </goals>
      </pluginExecutionFilter>
      <action>
        <configurator>
          <id>pde-maven-bundle-plugin</id>
        </configurator>
      </action>
    </pluginExecution>    </pluginExecutions>   </lifecycleMappingMetadata>

和plugin.xml

<extension point="org.eclipse.mylyn.discovery.core.connectorDiscovery">
<connectorDescriptor siteUrl="http://repo1.maven.org/maven2/.m2e/connectors/m2eclipse-tycho/0.8.0/N/0.8.0.201409231215/" id="org.eclipse.m2e.discovery.lifecycles.tycho" groupId="lifecycles" description="Tycho Configurator bridges tycho based projects and PDE" categoryId="org.eclipse.m2e.discovery.category.lifecycles" name="Tycho Configurator" provider="Takari, Inc." license="EPL" kind="lifecycles">
  <iu id="org.sonatype.tycho.m2e.feature.feature.group" />
  <overview summary="Tycho is focused on a Maven-centric, manifest-first approach to building Eclipse plug-ins, features, update sites, RCP applications and OSGi bundles. Tycho is a set of Maven plugins and extensions for building Eclipse plugins and OSGi bundles with Maven. Eclipse plugins and OSGi bundles have their own metadata for expressing dependencies, source folder locations, etc. that are normally found in a Maven POM. Tycho uses native metadata for Eclipse plugins and OSGi bundles and uses&#10;          the POM to configure and drive the build. Tycho supports bundles, fragments, features, update site projects and RCP applications. Tycho also knows how to run JUnit test plugins using OSGi runtime and there is also support for sharing build results using Maven artifact repositories. Tycho plugins introduce new packaging types and the corresponding lifecycle bindings that allow Maven to use OSGi and Eclipse metadata during a Maven build." url="http://eclipse.org/tycho/" />
</connectorDescriptor>

0 个答案:

没有答案