Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eclipse fixes #10495

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions .settings/org.eclipse.core.resources.prefs
@@ -1,2 +1,7 @@
eclipse.preferences.version=1
encoding//src/main/java=UTF-8
encoding//src/main/resources=UTF-8
encoding//src/test/java=UTF-8
encoding//src/test/resources=UTF-8
encoding/<project>=UTF-8
encoding/rest-api-spec=UTF-8
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we specify the encoding at the project level, shouldn't all source folders inherit it?

17 changes: 7 additions & 10 deletions .settings/org.eclipse.jdt.core.prefs
@@ -1,21 +1,18 @@
eclipse.preferences.version=1
# We target Java 1.7
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.source=1.7
# Lines should be splitted at 140 chars
org.eclipse.jdt.core.formatter.lineSplit=140
# Indentation is 4 spaces
org.eclipse.jdt.core.formatter.tabulation.char=space
org.eclipse.jdt.core.formatter.tabulation.size=4
# Configuration for NPE analysis
org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=enabled
org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
org.eclipse.jdt.core.compiler.annotation.nullable=org.elasticsearch.common.Nullable
org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain what it does?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I didn't notice that this had been added.

According to the documentation: "When enabled, the compiler will issue an error or a warning when referring to a type with restricted access, as defined according to the access restriction specifications."

The default value is "warning".

I guess the version of Eclipse that originally generated these prefs didn't have that option, while mine is later and does have it.

org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=warning
org.eclipse.jdt.core.compiler.problem.nullReference=warning
org.eclipse.jdt.core.compiler.problem.nullSpecViolation=warning
org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
org.eclipse.jdt.core.compiler.source=1.7
org.eclipse.jdt.core.formatter.lineSplit=140
org.eclipse.jdt.core.formatter.tabulation.char=space
org.eclipse.jdt.core.formatter.tabulation.size=4
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something I liked with the previous layout is that I knew what these options did. It is a bit more cryptic now. You commit message mentions Eclipse Luna but I am using Luna too and I don't have the issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In all my projects the settings get listed in alphabetical order like this. I haven't done anything in Eclipse to make it do that.

it is a bit more cryptic now

The names of the settings make the meaning clear enough to me. In any case, don't most people use the UI to change these rather than manually editing the file?

201 changes: 96 additions & 105 deletions pom.xml
Expand Up @@ -424,6 +424,7 @@
</testResource>
</testResources>

<pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
Expand Down Expand Up @@ -893,6 +894,100 @@
</resources>
</configuration>
</execution>

<!-- use packaging.properties when building the .deb package -->
<execution>
<id>copy-resources-deb</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/generated-packaging/deb/</outputDirectory>
<filters>
<filter>${basedir}/src/packaging/common/packaging.properties</filter>
<filter>${basedir}/src/packaging/deb/packaging.properties</filter>
</filters>
<resources>
<resource>
<directory>src/packaging/common/</directory>
<filtering>true</filtering>
<includes>
<include>**/*</include>
</includes>
<excludes>
<exclude>packaging.properties</exclude>
</excludes>
</resource>
<resource>
<directory>src/packaging/deb/</directory>
<filtering>true</filtering>
<includes>
<include>**/*</include>
</includes>
<excludes>
<exclude>packaging.properties</exclude>
</excludes>
</resource>
<resource>
<directory>${project.basedir}</directory>
<filtering>true</filtering>
<includes>
<include>bin/elasticsearch</include>
<include>bin/elasticsearch.in.sh</include>
<include>bin/plugin</include>
</includes>
</resource>
</resources>
</configuration>
</execution>

<!-- use packaging.properties when building the .rpm package -->
<execution>
<id>copy-resources-rpm</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/generated-packaging/rpm/</outputDirectory>
<filters>
<filter>${basedir}/src/packaging/common/packaging.properties</filter>
<filter>${basedir}/src/packaging/rpm/packaging.properties</filter>
</filters>
<resources>
<resource>
<directory>src/packaging/common/</directory>
<filtering>true</filtering>
<includes>
<include>**/*</include>
</includes>
<excludes>
<exclude>packaging.properties</exclude>
</excludes>
</resource>
<resource>
<directory>src/packaging/rpm/</directory>
<filtering>true</filtering>
<includes>
<include>**/*</include>
</includes>
<excludes>
<exclude>packaging.properties</exclude>
</excludes>
</resource>
<resource>
<directory>${project.basedir}</directory>
<filtering>true</filtering>
<includes>
<include>bin/elasticsearch</include>
<include>bin/elasticsearch.in.sh</include>
<include>bin/plugin</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
Expand Down Expand Up @@ -1101,57 +1196,6 @@
</execution>
</executions>
</plugin>
<plugin>
<!-- use packaging.properties when building the .deb package -->
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-resources-deb</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/generated-packaging/deb/</outputDirectory>
<filters>
<filter>src/packaging/common/packaging.properties</filter>
<filter>src/packaging/deb/packaging.properties</filter>
</filters>
<resources>
<resource>
<directory>src/packaging/common/</directory>
<filtering>true</filtering>
<includes>
<include>**/*</include>
</includes>
<excludes>
<exclude>packaging.properties</exclude>
</excludes>
</resource>
<resource>
<directory>src/packaging/deb/</directory>
<filtering>true</filtering>
<includes>
<include>**/*</include>
</includes>
<excludes>
<exclude>packaging.properties</exclude>
</excludes>
</resource>
<resource>
<directory>${project.basedir}</directory>
<filtering>true</filtering>
<includes>
<include>bin/elasticsearch</include>
<include>bin/elasticsearch.in.sh</include>
<include>bin/plugin</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>

<!-- Rpm Packaging -->
<plugin>
Expand Down Expand Up @@ -1364,57 +1408,6 @@
</postremoveScriptlet>
</configuration>
</plugin>
<plugin>
<!-- use packaging.properties when building the .rpm package -->
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-resources-rpm</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/generated-packaging/rpm/</outputDirectory>
<filters>
<filter>src/packaging/common/packaging.properties</filter>
<filter>src/packaging/rpm/packaging.properties</filter>
</filters>
<resources>
<resource>
<directory>src/packaging/common/</directory>
<filtering>true</filtering>
<includes>
<include>**/*</include>
</includes>
<excludes>
<exclude>packaging.properties</exclude>
</excludes>
</resource>
<resource>
<directory>src/packaging/rpm/</directory>
<filtering>true</filtering>
<includes>
<include>**/*</include>
</includes>
<excludes>
<exclude>packaging.properties</exclude>
</excludes>
</resource>
<resource>
<directory>${project.basedir}</directory>
<filtering>true</filtering>
<includes>
<include>bin/elasticsearch</include>
<include>bin/elasticsearch.in.sh</include>
<include>bin/plugin</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>de.thetaphi</groupId>
Expand Down Expand Up @@ -1541,9 +1534,7 @@
</execution>
</executions>
</plugin>
</plugins>
<pluginManagement>
<plugins>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the most tricky bit to me. I'd be wary about modifying maven configuration just for eclipse.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't find any other way to make it build in Eclipse. If you're using Eclipse, how do you get rid of the error without changing this config?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess I don't have the error because I am not using the Maven integration plugin. I'll try to ping some other people who are using Eclipse to see how they do.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More specifically, I run mvn eclipse:eclipse and then import the project in Eclipse instead of expecting Eclipse to be able to understand the pom.xml through a plugin.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I'm using the Maven plugin in Eclipse and use that to generate the project. I'll try it the way you suggest and see if that helps.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generating the project with mvn eclipse:eclipse doesn't seem to have made any difference. I still get the errors about the plugin execution not covered by lifecycle configuration, and errors loading the property files.

Not sure if that's because my Eclipse has the m2e plugins installed, though. I don't want to remove those since I need them for other projects.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dpursehouse after generating the eclipse files using eclipse:eclipse are you still importing the project using 'existing maven projects' in the Import dialog? You will need to instead use 'Existing Projects into Workspace' under the 'general' folder in that dialog.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@colings86 after completing nuking the project and starting again with mvn eclipse:eclipse and then importing as suggested, it works.

Thanks for the help, and sorry for the noise caused by this PR.

The other warning about duplicate declarations has since been fixed in e60f61d so I will close this PR.

<!-- make m2e stfu -->
<plugin>
<groupId>org.eclipse.m2e</groupId>
Expand Down