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

Getting eclipse auto builds to respect properties-maven-plugin pom.xml settings #29

Open
mattadamson opened this issue May 16, 2016 · 4 comments

Comments

@mattadamson
Copy link

Hi,

We're using this plug in successfully to set system properties using execution configuration such as

                    <execution>
                        <goals>
                            <goal>set-system-properties</goal>
                        </goals>
                        <configuration>
                            <properties>
                                <property>
                                    <name>javax.xml.accessExternalSchema</name>
                                    <value>all</value>
                                </property>
                            </properties>
                        </configuration>
                    </execution>

Whilst this works fine building through maven on the command line it doesn't seem to be reflected when eclipse performs an auto build.

Initially I thought this may help however it still doesn't execute

        <pluginManagement>
            <plugins>
                <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
                <plugin>
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>
                                            org.codehaus.mojo
                                        </groupId>
                                        <artifactId>
                                            properties-maven-plugin
                                        </artifactId>
                                        <versionRange>
                                            [1.0-alpha-2,)
                                        </versionRange>
                                        <goals>
                                            <goal>
                                                set-system-properties
                                            </goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <execute></execute>
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>

We need the JVM property to be set because this plug in configuration requires it to run correctly

            <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>jaxb2-maven-plugin</artifactId>
                    <configuration>
                        <arguments>-swaggerify</arguments> 
                        <outputDirectory>src/main/java</outputDirectory>
                        <schemaDirectory>src/main/schema</schemaDirectory>
                        <schemaFiles>services/*.xsd, domain/*.xsd, isoschemas/pain*.xsd, ofxschemas/*.xsd, hif5/*.xsd, lockbox/*.xsd, wpf/*.xsd</schemaFiles>
                    <bindingDirectory>src/main/schema</bindingDirectory>
                    <bindingFiles>GlobalBindings.xjb</bindingFiles>
                    <strict>false</strict>
                    <nv>false</nv>
                </configuration>
                <executions>
                    <execution>
                        <id>schema-xjc</id>
                        <goals>
                            <goal>xjc</goal>
                        </goals>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>javax.xml.parsers</groupId>
                        <artifactId>jaxp-api</artifactId>
                        <version>1.4.5</version>
                    </dependency>
                    <dependency>
                        <groupId>com.sun.xml.parsers</groupId>
                        <artifactId>jaxp-ri</artifactId>
                        <version>1.4.5</version>
                    </dependency>
                    <dependency>
                        <groupId>com.sun.xml.bind</groupId>
                        <artifactId>jaxb-xjc</artifactId>
                        <version>2.2.7-b53</version>
                    </dependency>
                    <dependency>
                        <groupId>com.sun.xml.bind</groupId>
                        <artifactId>jaxb-impl</artifactId>
                        <version>2.2.7-b53</version>
                    </dependency>
                    <dependency>
                        <groupId>be.redlab.jaxb</groupId>
                        <artifactId>swagger-jaxb</artifactId>
                        <version>0.0.1-SNAPSHOT</version>
                    </dependency>
                </dependencies>
            </plugin>

Appreciate your thoughts on how others manage this

Thanks

Matt

@khmarbaise
Copy link
Member

In Eclipse usually only the life cycle is executed till generate-resources not more...that might cause your issue...

@mattadamson
Copy link
Author

Thanks what do you mean "not more" ? Can you think of any work around at all?

@khmarbaise
Copy link
Member

I mean the life cycle phases after generate-sources will not executed during an import in Eclipse. What i don't understand why do you need system properties to run jaxb2-maven-plugin ? Do you have a small example project which shows the problem? Are you using an uptodate version of jaxb2-maven-plugin ?

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