feature request #4227
openhandle generated resources in eclipse workspace
50%
Description
Some files in the eclipse workspace are generated/deleted/changed when maven goals are run or the classpath is updated etc. leaving those files as outgoing svn changes which can be annoying.
.classpath is changed when a new version is released
- This could be solved by using maven or by manually adjusting the version numbers of the cdmlib jars and then committing it
org.eclipse.equinox.common-.jar and org.eclipse.osgi-.jar appear as outgoing changes when running
mvn clean validate
on taxeditor.cmlib- Here we should investigate if these files are really needed in the svn repository or if they can be deleted
If removal from the svn repository is the proposed solution then it should be explicitely checked what happens when checking out a completely fresh trunk version of the taxeditor project and if the standard steps to get it running work
Discussuion:
Hallo
muss eu.etaxonomy.taxeditor.cdmlib/.classpath den im repo sein? Ich finde das eher störend denn die verändert man lokal ja auch, oder eclipse macht das bei der Konfiguration des Workspaces.
Ich finde es jedenfalls recht lästig diese immer wieder vor jedem pull retten und danach wiederherstellen zu müssen.
Wärt ihr damit einverstanden die aus dem repo heraus zu nehmen?
Andreas
Ich bin ja nicht der Editor Experte. Kann mich nur noch dunkel erinnern, dass das damals damit zu tun hatte, dass sich die .classpath Datei nicht so einfach automatisch generieren ließ. Somit war es leichter, oder sogar notwendig, sie mit in git/svn aufzunehmen.
Kann das sein?
Viele Grüße,
Andreas M.
ich habe ich gerade mal bei mir geschaut. Bei mir ändert sich die Datei nie. Also zumindest nicht automatisch durch Eclipse oder mvn validate.
Und wenn ich die Datei lösche, dann ist natürlich der Workspace rot. Sie wird allerdings auch nicht neu erstellt. Weder durch maven, noch durch Eclipse.
Gruß,
Patrick
also bei mir ändert sie sich, z.B. wenn ich Code Quellen hinzufüge. Daher kenne ich das Problem schon auch.
Aber das Problem, dass sie nicht automatisch erstellt werden kann, hatte ich auch so in Erinnerung. Andreas K., hast du da andere Erkenntnisse?
Viele Grüße,
Andreas M.
wenn für eu.etaxonomy.taxeditor.cdmlib modul PluginTools->Update ClassPath .. laufen lasse wird diese Datei doch neu erstellt, zumindest bei mir.
Wenn ich das mache, dann habe ich auch Änderungen. Allerdings musste ich
das schon Ewigkeiten nicht mehr machen.
Wenn man die Datei löscht und das dann probiert, kommt eine Exception.
Vielleicht ist das genau das aktuelle Problem: Man braucht eine
vorhanden .classpath-Datei, um die Operation auszuführen -> Also muss
die Datei ins git, weil sie nicht automatisch erzeugt wird. Wenn man sie
dann allerdings aktualisiert, damit man alle Abhängigkeiten im Workspace
resolven kann, wird sie dabei immer verändert.
Ich habe genau das gemacht: Datei gelöscht, und PluginTools->Update ClassPath .. ausgeführt, und bekam keine Exception, hat schon 2x geklappt.
Ich führe dies für diesen Test allerdings nur auf eu.etaxonomy.taxeditor.cdmlib aus.
Andreas
Dass diese Exception bei dir, Patrick, entsteht, ist auch nicht schön, daher schlage ich vor, dass wir dieses .classpath nicht komplett löschen, sondern in .classpath.template umbenennen. Dann hat man sie zur Verfügung, falls PluginTools->Update ClassPath .. Probleme macht und im Normalfall stört sie nicht.
Update ClassPath" muss ich tatsächlich immer ausführen.
ich teste nochmals den kompletten Setup-Prozess und habe hierbei eine Frage: Bei mir stimme anscheinend die target Platform-Einstellungen nicht und die Anleitungen auf https://cybertaxonomy.eu/taxeditor/getting-started.html und https://dev.e-taxonomy.eu/redmine/projects/edit/wiki/TaxonomicEditorDevelopersGuide#Target-RCP-Environment helfen mir leider nicht weiter
Files
Updated by Andreas Müller almost 6 years ago
- Description updated (diff)
- Category changed from devOps to taxeditor
- Assignee changed from Andreas Kohlbecker to Patrick Plitzner
- Priority changed from New to Priority14
- Target version changed from TaxEditor Next Major Release to Release 5.1
I remember this has been discussed recently. Is there a duplicate ticket? If not can you put email conversation and results into this ticket?
Updated by Patrick Plitzner almost 6 years ago
- Status changed from New to Feedback
- Assignee changed from Patrick Plitzner to Andreas Kohlbecker
@Andreas K.: Could you test again if it is possible to delete the .classpath
file from taxeditor.cdmlib and run "Update classpath". I still get an exception when doing that. Also I don't really have to run "Update classpath" anymore which is why I would close this ticket as there are no more generated resources in the taxeditor as far as I know.
Updated by Andreas Kohlbecker over 5 years ago
- Target version changed from Release 5.1 to Release 5.2
Updated by Andreas Kohlbecker over 5 years ago
The only generated resources which still is causing a conflict after setting up the project in eclipse is the
eu.etaxonomy.taxeditor.cdmlib/.classpath
This is because I always have to run "Update classpath"
I will quite soon try to delete this file and to setup the editor project in eclipse from scratch.
Updated by Andreas Kohlbecker over 5 years ago
- File error-1.png error-1.png added
- Projekt in Eclipse gelöscht
- git workspace komplett ge-cleant mit
git clean -x
rm eu.etaxonomy.taxeditor.cdmlib/.classpath
./setup-project.sh
laufen lassen- Import in die eclipse mit "Import Existing Projects into Workspace" ....
- Eclipse: "building Workspace" ... warten .... einige Projekte mit Fehler
/eu.etaxonomy.taxeditor/rcp.target
geöffnet ... Eclipse: "Resolving Target Definition" ... warten ... keine Fehler in derrcp.target
- Plugin tools > Update Classpath auf
eu.etaxonomy.taxeditor.cdmlib
jetzt bekomme ich auch einen Fehler:
... to be continued ...
Updated by Andreas Kohlbecker over 5 years ago
... das Problem ist offenbar, dass eclipse die maven source folder nicht erkennt und und eu.etaxonomy.taxeditor.cdmlib/src
als source folder nimmt.
Strategie (A) m2 plugin:
- Configure > convert to Maven Project
- nun sind die source folder korrekt
- Maven > Disable Maven Nature
- nun ist 'eu.etaxonomy.taxeditor.cdmlib/.classpath' da!!!!!! 1 Plugin tools > Update Classpath auf eu.etaxonomy.taxeditor.cdmlib ... diesmal ohne Fehler
Dafür ist nun aber das komplette Projekt irgendwie zerschossen einige eclipse Abhängigkeiten werden nicht mehr gefunden :-(
das muss also anderst gehen ...
Updated by Andreas Kohlbecker over 5 years ago
... Mist ich hatte das "Set as Target Platform" vergessen, sonst hätte es wohl funktioniert, dies habe ich leider erst nach dem Durchspielen von Strategie B erkannt, dort trat nämlich das selbe Problem auf!
Strategie B :
eu.etaxonomy.taxeditor.cdmlib/.classpath.template
als Kopie voneu.etaxonomy.taxeditor.cdmlib/.classpath
allerdings ohne die cdmlib dependencies (Vermutlich kann man alle lib/* dependencies entfernen)setup-project.sh
umcp -f eu.etaxonomy.taxeditor.cdmlib/.classpath.template eu.etaxonomy.taxeditor.cdmlib/.classpath
ergänzt./setup-project.sh
laufen lassen- Import in die eclipse mit "Import Existing Projects into Workspace" ....
- Eclipse: "building Workspace" ... warten .... einige Projekte mit Fehler
- /eu.etaxonomy.taxeditor/rcp.target geöffnet ... Eclipse: "Resolving Target Definition" ... warten ... keine Fehler in der rcp.target
- nun im rcp.target editor "Set as Target Platform" 1- FERITG!!!!
Updated by Andreas Kohlbecker over 5 years ago
also nochmal die Strategie (A) mit m2 plugin aber ganz von vorn und unter Einbeziehung der bisherigen Erkentnisse:
- Projekt in Eclipse gelöscht
- git workspace komplett ge-cleant mit
git clean -x
rm eu.etaxonomy.taxeditor.cdmlib/.classpath
./setup-project.sh
laufen lassen- Import in die eclipse mit "Import Existing Projects into Workspace" ....
- Eclipse: "building Workspace" ... warten .... einige Projekte mit Fehler
/eu.etaxonomy.taxeditor/rcp.target
geöffnet ... Eclipse: "Resolving Target Definition" ... warten ... keine Fehler in derrcp.target
- nun im rcp.target editor "Set as Target Platform" 1- FERITG!!!!
Es war kein "Plugin tools > Update Classpath" mehr nötig
FAZIT:
- Die
Plugin tools > Update Classpath
kann getrost aus dem git repository gelöscht werden, denn es gibt zwei Wege sie zu erzeugen. Die Modifiakationen an(Korrektur: das ist Quatsch!!!!) dass die maven dependencies in diesem .classpath file stehen und nicht über maven verwaltet werden. Ticket #5752 betrifft dieses Thema auch. Hier geht es aber anscheinend lediglich darum unbeötigte jars in den lib/ Ordnern zu löschen. Eigentlich sollten da aber gar keine sein oder? Das kann mittels deseu.etaxonomy.taxeditor.cdmlib/.classpath
und somit auch die Konflikte entstehen letztlich ja nur dadurch,maven-dependency-plugin
gemacht werden, wie in/eu.etaxonomy.taxeditor.webapp/pom.xml
schon teilweise realisiert:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>copy-dependency-war</id>
<phase>validate</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<includeArtifactIds>
cdmlib-remote-webapp
</includeArtifactIds>
<outputDirectory>
${basedir}/lib
</outputDirectory>
<overWriteReleases>true</overWriteReleases>
<overWriteSnapshots>true</overWriteSnapshots>
<excludeTransitive>true</excludeTransitive>
</configuration>
</execution>
<execution>
<id>copy-dependency-jars</id>
<phase>validate</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<includeArtifactIds>
log4j,javax.servlet-api,jetty-all
</includeArtifactIds>
<outputDirectory>
${basedir}/lib
</outputDirectory>
<overWriteReleases>true</overWriteReleases>
<overWriteSnapshots>true</overWriteSnapshots>
<excludeTransitive>true</excludeTransitive>
</configuration>
</execution>
<execution>
<id>copy-dependency-jars-transitive</id>
<phase>validate</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<includeArtifactIds>
c3p0,mchange-commons-java,h2,postgresql,mysql-connector-java,jdbc4
</includeArtifactIds>
<outputDirectory>
${basedir}/lib
</outputDirectory>
<overWriteReleases>true</overWriteReleases>
<overWriteSnapshots>true</overWriteSnapshots>
<excludeTransitive>false</excludeTransitive>
</configuration>
</execution>
</executions>
</plugin>
Updated by Andreas Kohlbecker over 5 years ago
- Assignee changed from Andreas Kohlbecker to Patrick Plitzner
Hiermit ist mein Monster-Feedback #4227#note-7 bis #4227#note-10 zu Ende.
und ich bin der Meinung, dass eu.etaxonomy.taxeditor.cdmlib/.classpath
gelöscht werden sollte.
Die beiden Setup Strategien A und B sollten in die Editor Dokumentation (TaxonomicEditorDevelopersGuide und https://cybertaxonomy.eu/taxeditor/getting-started.html) mit aufgenommen werden. Für B müssen natürlich vorher die 2 kleinen Änderung eingebaut werden. Diesen letzten Punkt übernehme ich gerne, sofern alle einverstanden sind.
Updated by Andreas Kohlbecker over 5 years ago
Ich habe heute morgen noch eine radikalere Strategie getestet - Stratregie A+:
- Projekt in Eclipse gelöscht, eclipse neu gestaretet
- Alle
.classpath
und.project
files gelöscht (find -type f -name ".classpath" -or -name ".project" -prune -exec rm {} \;
), die**/.settings/*.pref
files habe ich vergessen, aber das sollte keinen Einfluss haben. ./setup-project.sh
- Import in eclipse als "Existing Maven Project" ...
- ... warten auf "Building Workspace"
- /eu.etaxonomy.taxeditor/rcp.target geöffnet ... Eclipse: "Resolving Target Definition" ... warten ... keine Fehler in der rcp.target
- nun im rcp.target editor "Set as Target Platform" 1- FERITG!!!!
Wir können also auf alle .classpath
und .project
files im git Repositorium verzichten.
Wenn man Probleme damit hat, dass für die Taxeditor-Projekte die Maven Nature aktiv ist, oder m2 einfach nicht mag, kann diese auch wieder deaktiviert werden nachdem das Projektsetup komplett und fehlerfrei ist: Maven > Disable Maven Nature
Updated by Andreas Kohlbecker over 5 years ago
auch der Wechsel auf einen anderen Branch klappt mit diesem Setup problemlos:
- start im develop branch
git checkout hotfix/5.1.2
./setup-project
- für alle taxeditor projekte: Maven > Update Project Alt+F5
und Alles ist gut!
Updated by Andreas Kohlbecker over 5 years ago
Ich habe einen branch generated-resources committed in dem alle .classpath and .project files gelöscht sind: taxeditor|5cded95c
Bitte tested doch alle einmal ob Stratregie A+ für euch funktioniert oder Probleme verursacht.
Ich verwende übrigens
Spring Tool Suite Version: 3.9.4.RELEASE Build Id: 201804120943 Platform: Eclipse Neon.3 (4.6.3) mit m2e 1.8.3.20180227
Updated by Andreas Kohlbecker over 5 years ago
- Assignee changed from Patrick Plitzner to Andreas Müller
[Patrick has tested strategy A+, these are his results:]
- had to apply the
/cdmlib-parent/lifecycle-mapping-metadata.xml
to Preference > Maven > Lifecycle to fix m2e problems with pom.xml - Strategie A+ klappt!
zudem:
jetzt teste ich gerade das Ganze ohne m2e-Plugin
https://maven.apache.org/plugins/maven-eclipse-plugin/ : "Disclaimer: Users are advised to use m2e, the Eclipse Maven Integration instead of this plugin"
Na dann muss ich das wohl nicht mehr testen
Who will test next, Andreas Müller?
Updated by Patrick Plitzner over 5 years ago
I tried the A+ strategy and it worked fine.
- git checkout generated-resources
- run
setup-project.sh
- Install m2e feature (if not already installed) in eclipse
- Update-Site: http://download.eclipse.org/releases/neon
- Feature to install: m2e - Maven Integration for Eclipse
- Import projects as maven projects into the eclipse workspace
- Note: A dialog pops up to import the missing maven connectors saying that a mapping for antrun is missing. Just install all connectors that are available. The problem with antrun will then be solved by importing
cdmlib/lifecycle-mapping-metadata.xml
in the preferences under Maven->Lifecycle Mappings->Change mapping file location
- Note: A dialog pops up to import the missing maven connectors saying that a mapping for antrun is missing. Just install all connectors that are available. The problem with antrun will then be solved by importing
- Open
/eu.etaxonomy.taxeditor/rcp.target
and let it resolve all dependencies - Click "Set as target platform"
Updated by Andreas Kohlbecker over 5 years ago
- Assignee changed from Andreas Müller to Katja Luther
Patrick and I decided that you will be the next tester.
Updated by Katja Luther over 5 years ago
I still have the error message
Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-antrun-plugin:1.7:run (execution: update-snapshot-jar-names, phase: validate) in cdmlib, molecular.lib und webapp
but the editor starts and works.
Updated by Andreas Kohlbecker over 5 years ago
- Assignee changed from Katja Luther to Andreas Müller
- % Done changed from 40 to 50
Katja Luther wrote:
I still have the error message
Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-antrun-plugin:1.7:run (execution: update-snapshot-jar-names, phase: validate) in cdmlib, molecular.lib und webapp
Die lifecycle-mapping-metadata.xml
hast du aber schon importiert, oder? Damit dürfte das garnicht mehr auftauchen. Denn dort ist die fehlende Konfiguration enthalten:
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<goals>
<goal>run</goal>
</goals>
<versionRange>[1.7,)</versionRange>
</pluginExecutionFilter>
<action>
<execute/>
</action>
</pluginExecution>
but the editor starts and works.
Das ist prima, dann muss nur noch Adreas M. testen
Updated by Andreas Müller over 5 years ago
- Target version changed from Release 5.2 to Release 5.3
Updated by Andreas Müller over 5 years ago
- Target version changed from Release 5.3 to Release 5.4
Updated by Andreas Müller over 5 years ago
- Target version changed from Release 5.4 to Release 5.5