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

Disabling episode file induces a WARNING log during build #107

Closed
boskoop opened this issue Jan 23, 2017 · 6 comments
Closed

Disabling episode file induces a WARNING log during build #107

boskoop opened this issue Jan 23, 2017 · 6 comments
Assignees
Labels
Milestone

Comments

@boskoop
Copy link

boskoop commented Jan 23, 2017

When turning off the episode file in the project configuration, the build log contains a warn-log "Episode file is not writable, could not add if-exists attributes".

	<plugin>
		<groupId>org.jvnet.jaxb2.maven2</groupId>
		<artifactId>maven-jaxb2-plugin</artifactId>
		<configuration>
			<episode>false</episode>
		</configuration>
	</plugin>

The log appears during the generate-phase:

[INFO] --- maven-jaxb2-plugin:0.13.2-SNAPSHOT:generate (generate) @ maven-jaxb2-plugin-tests-gh-issue-107 ---
[INFO] Up-to-date check for source resources [[file:/example/maven-jaxb2-plugin/tests/gh-issue-107/src/main/resources/purchaseorder.xsd, file:/example/maven-jaxb2-plugin/tests/gh-issue-107/pom.xml]] and target resources [[]].
[INFO] Sources are not up-to-date, XJC will be executed.
[WARNING] Episode file [/example/maven-jaxb2-plugin/tests/gh-issue-107/target/generated-sources/xjc/META-INF/sun-jaxb.episode] is not writable, could not add if-exists attributes.
[INFO]

I think this was introduced with #55 where setupEpisodeHackForUnusedSchemaBindings() only checks whether the episode file is writeable, but not if it's turned off at all.

This can be fixed pretty easy by simply adding a check at said place.

I will provide a demo project/pull request asap.

boskoop added a commit to boskoop/maven-jaxb2-plugin that referenced this issue Jan 23, 2017
boskoop added a commit to boskoop/maven-jaxb2-plugin that referenced this issue Jan 23, 2017
‘if-exists’ should only be added to episode schema bindings if episode is not disabled
@boskoop boskoop mentioned this issue Jan 23, 2017
@highsource highsource self-assigned this May 11, 2019
@highsource highsource added the bug label May 11, 2019
@highsource highsource added this to the 0.14.x milestone May 11, 2019
@highsource
Copy link
Owner

Should be fixed now.

highsource added a commit to xjc-maven-plugin/xjc23 that referenced this issue May 11, 2019
@samodadela
Copy link

samodadela commented Nov 19, 2020

This should be fixed, but I'm still getting the error... I have:

                <configuration>
                    <extension>true</extension>
                    <noFileHeader>true</noFileHeader>
                    <episode>false</episode>

Plugin version:

                <plugin>
                    <groupId>org.jvnet.jaxb2.maven2</groupId>
                    <artifactId>maven-jaxb2-plugin</artifactId>
                    <version>0.14.0</version>
                </plugin>

Output:

[INFO] --- maven-jaxb2-plugin:0.14.0:generate (default-cli) @ project ---
[INFO] Latest timestamp of the source resources is [2020-11-19 20:18:13.597], earliest timestamp of the target resources is [2020-11-05 15:36:22.806].
[INFO] Sources are not up-to-date, XJC will be executed.
WARNING: An illegal reflective access operation has occurred
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.sun.xml.bind.v2.runtime.reflect.opt.Injector (file:/home/user/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.0/jaxb-runtime-2.3.0.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int)
WARNING: Please consider reporting this to the maintainers of com.sun.xml.bind.v2.runtime.reflect.opt.Injector
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[WARNING] Episode file [/home/user/my-project/src/main/java/META-INF/sun-jaxb.episode] is not writable, could not add if-exists attributes.

The file does not exist at the reported location.

@gavvvr
Copy link

gavvvr commented Dec 29, 2020

I confirm that the warning is still present with 0.14.0

[WARNING] Episode file [/Users/user/proj/target/generated-sources/xjc/META-INF/sun-jaxb.episode] is not writable, could not add if-exists attributes.

@laurentschoelens
Copy link
Collaborator

@gavvvr / @samodadela
Didn't get the warning on 2.0.5 version of jaxb-maven-plugin
Could you upgrade and confirm issue is well closed (or reopen it if it's not) ?

@gavvvr
Copy link

gavvvr commented Sep 9, 2023

@laurentschoelens Unfortunately, I can't check this, because I no longer have the codebase with jaxb-maven-plugin

@laurentschoelens
Copy link
Collaborator

@laurentschoelens Unfortunately, I can't check this, because I no longer have the codebase with jaxb-maven-plugin

Thanks for your reply
I'll wait and close the issue if no more feedback since warning is not longer present

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants