m2e lifecycle-mapping not found

Próbuję użyć rozwiązania opisanego tutaj do rozwiązania irytującego "wykonania wtyczki nie objętej konfiguracją cyklu życia: org.codehaus.mojo: build-helper-maven-plugin: 1.7: add-source (execution: default, phase: generate-sources) " kiedy umieszczę następującą wtyczkę na moim pom.xml:

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
    <execution>
        <phase>generate-sources</phase>
        <goals><goal>add-source</goal></goals>
        <configuration>
            <sources>
                <source>src/bootstrap/java</source>
            </sources>
        </configuration>
    </execution>
</executions>
</plugin>

Ale kiedy uruchamiam mvn clean install dostaję to:

Powód: pom 'org.zaćmienie.m2e:mapowanie cyklu życia " nie znaleziono w repozytorium: nie można pobrać artefaktu z dowolnego repozytorium

Czy ktoś ma jakiś pomysł jak uszczęśliwić m2e i Mavena?

Author: falsarella, 2011-09-14

9 answers

Wtyczka org.eclipse.m2e:lifecycle-mapping faktycznie nie istnieje. Należy go stosować z sekcji <build><pluginManagement> twojego pom.xml. W ten sposób nie jest rozwiązywany przez Mavena, ale może być odczytany przez m2e.]}

Ale bardziej praktycznym rozwiązaniem problemu byłoby zainstalowanie złącza M2E build-helper w eclipse. Można go zainstalować z Window > Preferences > Maven > Discovery > Open Catalog. W ten sposób build-helper-maven-plugin:add-sources zostanie wywołany w eclipse bez konieczności zmiany swojego pom.xml.

 106
Author: Fred Bricon,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2015-04-24 14:22:50

Spróbuj użyć sekcji build/pluginManagement, np.:

<pluginManagement>
    <plugins>
        <plugin>
            <groupId>org.eclipse.m2e</groupId>
            <artifactId>lifecycle-mapping</artifactId>
            <version>1.0.0</version>
            <configuration>
                <lifecycleMappingMetadata>
                    <pluginExecutions>
                        <pluginExecution>
                            <pluginExecutionFilter>
                                <groupId>org.bsc.maven</groupId>
                                <artifactId>maven-processor-plugin</artifactId>
                                <versionRange>[2.0.2,)</versionRange>
                                <goals>
                                    <goal>process</goal>
                                </goals>
                            </pluginExecutionFilter>
                            <action>
                                <execute />
                            </action>
                        </pluginExecution>
                    </pluginExecutions>                         
                </lifecycleMappingMetadata>
            </configuration>
        </plugin>
    </plugins>
</pluginManagement>

Oto przykład generowania manifestu pakietu podczas kompilacji przyrostowej wewnątrz Eclipse:

<build>
    <pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.eclipse.m2e</groupId>
                <artifactId>lifecycle-mapping</artifactId>
                <version>1.0.0</version>
                <configuration>
                    <lifecycleMappingMetadata>
                        <pluginExecutions>
                            <pluginExecution>
                                <pluginExecutionFilter>
                                    <groupId>org.apache.felix</groupId>
                                    <artifactId>maven-bundle-plugin</artifactId>
                                    <versionRange>[1.0.0,)</versionRange>
                                    <goals>
                                        <goal>manifest</goal>
                                    </goals>
                                </pluginExecutionFilter>
                                <action>
                                    <execute />
                                </action>
                            </pluginExecution>
                        </pluginExecutions>
                    </lifecycleMappingMetadata>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>
    <plugins>
        <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>2.3.2</version>
            <configuration>
                <source>1.6</source>
                <target>1.6</target>
                <encoding>UTF-8</encoding>
            </configuration>
        </plugin>

        <plugin>
            <groupId>org.apache.felix</groupId>
            <artifactId>maven-bundle-plugin</artifactId>
            <version>2.3.7</version>
            <extensions>true</extensions>
            <configuration>
                <instructions>
                </instructions>
            </configuration>
            <executions>
                <execution>
                    <id>manifest</id>
                    <phase>process-classes</phase>
                    <goals>
                        <goal>manifest</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

VersionRange jest wymagana, jeśli zostanie pominięta, m2e (od wersji 1.1.0) wyrzuci NullPointerException.

 10
Author: Hendy Irawan,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2012-07-15 08:55:50

Możesz użyć tej atrapy Wtyczki:

mvn archetype:generate -DgroupId=org.eclipse.m2e -DartifactId=lifecycle-mapping -Dversion=1.0.0 -DarchetypeArtifactId=maven-archetype-mojo

Po wygenerowaniu projektu zainstaluj/wdroż go.

 8
Author: Manfred Hantschel,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2012-02-14 11:22:15

Oto Jak to zrobić: umieściłem wtyczkę mapowania cyklu życia m2e w oddzielnym profilu zamiast domyślnej sekcji . profil jest automatycznie aktywowany podczas kompilacji eclipse przez obecność właściwości m2e (zamiast ręcznej aktywacji w Ustawieniach.xml lub w inny sposób). będzie to obsługiwać przypadki m2e, podczas gdy Maven wiersza poleceń po prostu pominie profil i wtyczkę mapowania cyklu życia M2E bez żadnych ostrzeżeń, a wszyscy są zadowoleni.

<project>
  ...
  <profiles>
    ...
    <profile>
      <id>m2e</id>
      <!-- This profile is only active when the property "m2e.version"
        is set, which is the case when building in Eclipse with m2e. -->
      <activation>
        <property>
          <name>m2e.version</name>
        </property>
      </activation>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.eclipse.m2e</groupId>
              <artifactId>lifecycle-mapping</artifactId>
              <version>1.0.0</version>
              <configuration>
                <lifecycleMappingMetadata>
                  <pluginExecutions>
                    <pluginExecution>
                      <pluginExecutionFilter>
                        <groupId>...</groupId>
                        <artifactId>...</artifactId>
                        <versionRange>[0,)</versionRange>
                        <goals>
                          <goal>...</goal>
                        </goals>
                      </pluginExecutionFilter>
                      <action>

                        <!-- either <ignore> XOR <execute>,
                          you must remove the other one. -->

                        <!-- execute: tells m2e to run the execution just like command-line maven.
                          from m2e's point of view, this is not recommended, because it is not
                          deterministic and may make your eclipse unresponsive or behave strangely. -->
                        <execute>
                          <!-- runOnIncremental: tells m2e to run the plugin-execution
                            on each auto-build (true) or only on full-build (false). -->
                          <runOnIncremental>false</runOnIncremental>
                        </execute>

                        <!-- ignore: tells m2eclipse to skip the execution. -->
                        <ignore />

                      </action>
                    </pluginExecution>
                  </pluginExecutions>
                </lifecycleMappingMetadata>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </profile>
    ...
  </profiles>
  ...
</project>
 4
Author: Robin479,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2014-02-05 10:14:36

Otworzyłem (trywialny) bug dla tego w m2e. Głosuj na niego, jeśli chcesz, aby komunikat ostrzegawczy zniknął na dobre...

Https://bugs.eclipse.org/bugs/show_bug.cgi?id=367870

 3
Author: Ben,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2012-01-04 16:39:11

Miałem ten sam problem, gdzie:

nie znaleziono żadnych wpisów dotyczących obsługi build-helper-maven-plugin: 1.8: add-source w Eclipse. Więcej informacji można znaleźć w sekcji Pomoc.

I kliknięcie przycisku Window > Preferences > Maven > Discovery > open catalog spowoduje brak połączenia.

Aktualizacja z 7u40 do 7u45 na Centos 6.4 i OSX rozwiązuje problem.

 3
Author: user145880,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2013-10-16 19:25:27

Maven próbuje pobrać artefakt mapujący cykl życia m2e, którego M2E używa do określenia, jak przetwarzać wtyczki w Eclipse (dodawanie folderów źródłowych itp.). Z jakiegoś powodu tego artefaktu nie można pobrać. Masz połączenie z Internetem? Czy można pobrać inne artefakty z repozytoriów? Ustawienia Proxy?

Aby uzyskać więcej informacji od Mavena, spróbuj włączyć wyjście debugowania M2E (pole wyboru ustawienia / Maven/Debug Output), a może to dać ci więcej szczegółów, dlaczego nie może Pobierz z repozytorium.

 1
Author: prunge,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2011-09-14 03:56:32

M2e 1.7 wprowadza nową składnię metadanych mapowania cyklu życia, która nie powoduje już tego ostrzeżenia:

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
    <execution>

        <!-- This executes the goal in Eclipse on project import.
             Other options like are available, eg ignore.  -->
        <?m2e execute?>

        <phase>generate-sources</phase>
        <goals><goal>add-source</goal></goals>
        <configuration>
            <sources>
                <source>src/bootstrap/java</source>
            </sources>
        </configuration>
    </execution>
</executions>
</plugin>
 1
Author: Arend v. Reinersdorff,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2017-02-14 19:13:31

Dzieje się to z powodu brakującej konfiguracji wtyczki (zgodnie z Demo pom vaadina.XML komentarz):

Konfiguracja tej wtyczki służy do przechowywania ustawień Eclipse m2e tylko. Nie ma to wpływu na samą budowę Mavena.

<pluginManagement>
    <plugins>
        <!--This plugin's configuration is used to store Eclipse m2e ettings only. It has no influence on the Maven build itself.-->
        <plugin>
            <groupId>org.eclipse.m2e</groupId>
            <artifactId>lifecycle-mapping</artifactId>
            <version>1.0.0</version>
            <configuration>
                <lifecycleMappingMetadata>
                    <pluginExecutions>
                        <pluginExecution>
                            <pluginExecutionFilter>
                                <groupId>com.vaadin</groupId>
                                <artifactId>
                                    vaadin-maven-plugin
                                </artifactId>
                                <versionRange>
                                    [7.1.5,)
                                </versionRange>
                                <goals>
                                    <goal>resources</goal>
                                    <goal>update-widgetset</goal>
                                    <goal>compile</goal>
                                    <goal>update-theme</goal>
                                    <goal>compile-theme</goal>
                                </goals>
                            </pluginExecutionFilter>
                            <action>
                                <ignore></ignore>
                            </action>
                        </pluginExecution>
                    </pluginExecutions>
                </lifecycleMappingMetadata>
            </configuration>
        </plugin>
    </plugins>
</pluginManagement>
 0
Author: falsarella,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2015-04-27 19:55:42