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

Eclipse fixes #10495

wants to merge 6 commits into from

Conversation

dpursehouse
Copy link
Contributor

Various minor fixes to make the project buildable in Eclipse.

When the project is imported into Eclipse, the build fails with:

  "Plugin execution not covered by lifecycle configuration"

for the maven-antrun-plugin.

According to [1] the solution is to enclose all plugins within the
"pluginManagement" tag in the POM file.

[1] http://stackoverflow.com/a/13733232/381622

Change-Id: I72fd0fd0b885df1100fc178f8cd70361daa83eab
Eclipse Luna overwrites the prefs file, putting all the settings
in alphabetical order and removing comments. This causes the prefs
files to be modified in the git workspace.

Update the file with the version generated by Eclipse to prevent it
from being modified every time.

No settings values are modified by this change.

Change-Id: I9e245b7614ed0bf34314c8c459da81204aab84bc
Change-Id: I0237d139c2ee8df04fb12901f2ee4484c2ac9e30
Prefix property file paths with "${basedir}/" as described in [1].

[1] http://stackoverflow.com/a/23481166/381622

Change-Id: I3a1b3d813c0358f6aa29c9f81e2913900f9c9728
@javanna javanna added review and removed review labels Apr 9, 2015
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.

@jpountz
Copy link
Contributor

jpountz commented Apr 9, 2015

Thanks for proposing fixes @dpursehouse, I left some questions inline.

Maven reports the following warning at the beginning of the build:

  'build.pluginManagement.plugins.plugin.(groupId:artifactId)' must be unique but found
  duplicate declaration of plugin org.apache.maven.plugins:maven-resources-plugin

  It is highly recommended to fix these problems because they threaten the stability
  of your build.

  For this reason, future Maven versions might no longer support building such malformed
  projects.

The maven-resources-plugin is declared three times, each with a different
<execution> section.

Consolidate the <execution> sections from the duplicate declarations under
the <executions> section in a single declatation of the plugin.

Change-Id: I16afcc0a36c118098b69379d182e1cd43df0d2be
Change-Id: I45c454789886a41ea0cf3b40f7dafe5dd5923d77
@dpursehouse
Copy link
Contributor Author

Note: I have signed the CLA (as an individual contributing under an existing company contributor agreement) and an email has been sent to get me added to the contributors list.

@jpountz
Copy link
Contributor

jpountz commented Apr 9, 2015

@colings86 @markharwood @rmuir I think you are using Eclipse, do you have similar issue as @dpursehouse (see in particular comments on the pom.xml file)

@colings86
Copy link
Contributor

@dpursehouse instead of modifying the plugins in the pom.xml directly to remove the errors in the maven integration it is often better to use the eclipse lifecycle mapping plugin to tell eclipse how to deal with these plugins. you can see an example of this here where we are telling eclipse to execute the copy-dependencies goal of the maven-dependancy-plugin as part of a full or incremental build. You can also instruct eclipse to ignore a plugin by using <ignore/> instead of <execute/>.

The two plugins that are erroring I believe are the maven-antrun-plugin and the maven-resources-plugin. Is that what you are seeing? The ant-run plugin does some validation so might be useful to execute as part of the eclipse build but the resources plugin is only relevant to the creation of the deb and rpm packages so can be ignored for the eclipse build.

Maybe you could update your PR to use this approach since it does not involve changing the pom for non-eclipse builds?

@rmuir
Copy link
Contributor

rmuir commented Apr 9, 2015

@jpountz eclipse is working fine for me, and has been for months.

@colings86 colings86 self-assigned this Apr 9, 2015
@dpursehouse dpursehouse deleted the eclipse-fixes branch April 10, 2015 00:40
@colings86 colings86 removed their assignment Apr 10, 2015
@colings86
Copy link
Contributor

@dpursehouse I ended up fixing this using some of your code is 97a9b4e

This should mean that you can now import the project in eclipse using the 'import existing maven projects' option.

Thanks for raising this problem and for providing code for the fix.

This has been merged into master, 1.x, and 1.5

@dpursehouse
Copy link
Contributor Author

@colings86 Thanks. It works perfectly now.

@clintongormley clintongormley added the :Delivery/Build Build or test infrastructure label May 29, 2015
@mark-vieira mark-vieira added the Team:Delivery Meta label for Delivery team label Nov 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Delivery/Build Build or test infrastructure Team:Delivery Meta label for Delivery team v1.5.2 v1.6.0 v2.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants