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 won't stop building workspace #149

Closed
Rafael-Simonelli opened this issue May 17, 2018 · 5 comments
Closed

Eclipse won't stop building workspace #149

Rafael-Simonelli opened this issue May 17, 2018 · 5 comments

Comments

@Rafael-Simonelli
Copy link

Rafael-Simonelli commented May 17, 2018

I configured Jaxb2 Plugin as follows in a project, and now Eclipse is in loop, always rebuilding the project over and over. Am I doing anything wrong? This seemed like a common way to generate resources from WSDL.

<build>
	<plugins>
		<plugin>
			<groupId>org.jvnet.jaxb2.maven2</groupId>
			<artifactId>maven-jaxb2-plugin</artifactId>
			<version>0.13.1</version>
			<executions>
				<execution>
					<goals>
						<goal>generate</goal>
					</goals>
				</execution>
			</executions>
			<configuration>
				<schemaLanguage>WSDL</schemaLanguage>
				<generatePackage>br.com.itau</generatePackage>
				<schemas>
					<schema>
						<url>https://ww2.itau.com.br/2viabloq/2ViaXMLWebSvc.asmx?WSDL</url>
					</schema>
				</schemas>
			</configuration>
		</plugin>
	</plugins>
</build>
@highsource
Copy link
Owner

Please send me a PR with a sample project in https://github.com/highsource/maven-jaxb2-plugin-support under 2/2viabloq. I'll take a look.

@Rafael-Simonelli
Copy link
Author

I've sent the PR with the project, but there's something specific on it that causes the problem. Newer projects with the same POM structure doesn't loop in Eclipse. However, i've not been able to trace it.

@highsource
Copy link
Owner

Thank you for the PR.

There are two parts of the problem.

One is why maven-jaxb2-plugin regenerates the code. This is due to the fact that you compile an online resource and the server does not provide the Last-Modified header. Here's a snippet from the logs:

5/18/18, 9:37:47 PM GMT+2: [WARN] The URI [https://ww2.itau.com.br/2viabloq/2ViaXMLWebSvc.asmx?WSDL] seems to represent an absolute HTTP or HTTPS URL. Getting the last modification timestamp is only possible if the URL is accessible and if the server returns the [Last-Modified] header correctly. This method is not reliable and is likely to fail. In this case the last modification timestamp will be assumed to be unknown.
5/18/18, 9:37:48 PM GMT+2: [ERROR] Could not retrieve the last modification timestamp for the URI [https://ww2.itau.com.br/2viabloq/2ViaXMLWebSvc.asmx?WSDL] from the HTTP URL connection. The [Last-Modified] header was probably not set correctly.
5/18/18, 9:37:48 PM GMT+2: [WARN] Last modification of the URI [https://ww2.itau.com.br/2viabloq/2ViaXMLWebSvc.asmx?WSDL] is not known.
5/18/18, 9:37:48 PM GMT+2: [INFO] Sources are not up-to-date, XJC will be executed.

To work around this, create a local copy of the WSDL and use a catalog file to rewrite URLs. I explicitly do not recommend building online resources. It breaks reproducible builds.

Next problem is why Eclipse keeps rebuilding. I honestly don't know. Probably Eclipse detects that new files were generated (i.e. that something is changed in sources) and rebuilds the whole project. Who knows.
I also prefer to consider IDE integration to be out of the scope of the maven-jaxb2-plugin.

@Rafael-Simonelli
Copy link
Author

Ok, thanks for the feedback!

@samshay
Copy link

samshay commented Jan 15, 2020

I have the same problem and i want to keep the generation from the url.
It's possible to add a parameter in plugin to desactivate the check modification for the file from url ?

Thanks

laurentschoelens pushed a commit to laurentschoelens/jaxb-tools that referenced this issue May 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants