You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by thomas2004 <th...@yahoo.de> on 2008/10/29 13:39:50 UTC

Does Java 1.4 support "maven-jaxb-plugin"?

Hi all,

I use following plugin in my pom.xml to convert XSD to java:
...
			<plugin>
				<groupId>com.sun.tools.xjc.maven2</groupId>
				<artifactId>maven-jaxb-plugin</artifactId>
				<executions>
					<execution>
						<phase>generate-sources</phase>
						<goals>
							<goal>generate</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<generatePackage>com.mycompany</generatePackage>
					<schemaDirectory>src/main/webapp/WEB-INF/xsd</schemaDirectory>
				</configuration>
			</plugin>
...

I use Java 1.4. As I run mvn install, I got error as follow:
...
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Internal error in the plugin manager executing goal
'com.sun.tools.xjc.ma
ven2:maven-jaxb-plugin:1.1:generate': Unable to find the mojo
'com.sun.tools.xjc
.maven2:maven-jaxb-plugin:1.1:generate' in the plugin
'com.sun.tools.xjc.maven2:
maven-jaxb-plugin'
com/sun/tools/xjc/maven2/XJCMojo (Unsupported major.minor version 49.0)
[INFO]
------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 2 seconds
[INFO] Finished at: Wed Oct 29 13:38:08 CET 2008
[INFO] Final Memory: 8M/15M
[INFO]
------------------------------------------------------------------------
...

Surely when I use Java 1.5. It is OK. But I do want to use Java 1.4 since I
will deploy my web-application to WebLogic 8 which is just compatible with
Java 1.4.

Has someone idea?
-- 
View this message in context: http://www.nabble.com/Does-Java-1.4-support-%22maven-jaxb-plugin%22--tp20226200p20226200.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Does Java 1.4 support "maven-jaxb-plugin"?

Posted by thomas2004 <th...@yahoo.de>.
Many thanks. I will try.



The plugin you use is for JAXB 2.x which requires you to use at least
java 1.5. For java 1.4 you need JAXB 1.x. You may want to use this JAXB
1.0 plugin.

      <plugin>
        <groupId>org.jvnet.jaxb1.maven2</groupId>
        <artifactId>maven-jaxb1-plugin</artifactId>
        <executions>
          <execution>
            <id>generate</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>generate</goal>
            </goals>
            <configuration>
              <extension>true</extension>
              <strict>true</strict>
              <bindingDirectory>src/main/jaxb</bindingDirectory>
              <schemaDirectory>src/main/jaxb</schemaDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>

For this to work you need some additional repositories, since that
plugin is not available via the central repository.

  <repositories>
    <repository>
      <id>maven2-repository.dev.java.net</id>
      <name>Java.net Maven 2 Repository</name>
      <url>http://download.java.net/maven/2/</url>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
    <repository>
      <id>maven-repository.dev.java.net</id>
      <name>Java.net Maven 1 Repository (legacy)</name>
      <url>http://download.java.net/maven/1/</url>
      <layout>legacy</layout>
    </repository>
  </repositories>
  <pluginRepositories>
    <pluginRepository>
      <id>maven2-repository.dev.java.net</id>
      <name>Java.net Maven 2 Repository</name>
      <url>http://download.java.net/maven/2/</url>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </pluginRepository>
    <pluginRepository>
      <id>maven-repository.dev.java.net</id>
      <name>Java.net Maven 1 Repository (legacy)</name>
      <url>http://download.java.net/maven/1/</url>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <layout>legacy</layout>
    </pluginRepository>
  </pluginRepositories>

And you will need the corresponding JAXB dependencies for java 1.4.

      <dependency>
        <groupId>javax.xml.bind</groupId>
        <artifactId>jaxb-api</artifactId>
        <version>1.0</version>
        <scope>compile</scope>
        <exclusions>
          <!--
          Excluded because of certificate problems.
          Classes must be provided by additional jaxp-api
          dependency when used.
          -->
          <exclusion>
            <groupId>javax.xml</groupId>
            <artifactId>namespace</artifactId>
          </exclusion>
          <exclusion>
            <groupId>javax.xml</groupId>
            <artifactId>jax-qname</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>com.sun.xml.bind</groupId>
        <artifactId>jaxb-impl</artifactId>
        <version>1.0.6</version>
        <scope>compile</scope>
      </dependency>

      <dependency>
        <groupId>javax.xml.parsers</groupId>
        <artifactId>jaxp-api</artifactId>
        <version>1.4</version>
        <scope>compile</scope>
      </dependency>
      <dependency>
        <groupId>com.sun.xml.parsers</groupId>
        <artifactId>jaxp-ri</artifactId>
        <version>1.4</version>
        <scope>runtime</scope>
      </dependency>

Give it a try.

-- 
Christian

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org




-- 
View this message in context: http://www.nabble.com/Does-Java-1.4-support-%22maven-jaxb-plugin%22--tp20226200p20284336.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Does Java 1.4 support "maven-jaxb-plugin"?

Posted by Christian Schulte <cs...@schulte.it>.
thomas2004 wrote:
> 
> Surely when I use Java 1.5. It is OK. But I do want to use Java 1.4 since I
> will deploy my web-application to WebLogic 8 which is just compatible with
> Java 1.4.
> 
> Has someone idea?

The plugin you use is for JAXB 2.x which requires you to use at least
java 1.5. For java 1.4 you need JAXB 1.x. You may want to use this JAXB
1.0 plugin.

      <plugin>
        <groupId>org.jvnet.jaxb1.maven2</groupId>
        <artifactId>maven-jaxb1-plugin</artifactId>
        <executions>
          <execution>
            <id>generate</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>generate</goal>
            </goals>
            <configuration>
              <extension>true</extension>
              <strict>true</strict>
              <bindingDirectory>src/main/jaxb</bindingDirectory>
              <schemaDirectory>src/main/jaxb</schemaDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>

For this to work you need some additional repositories, since that
plugin is not available via the central repository.

  <repositories>
    <repository>
      <id>maven2-repository.dev.java.net</id>
      <name>Java.net Maven 2 Repository</name>
      <url>http://download.java.net/maven/2/</url>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
    <repository>
      <id>maven-repository.dev.java.net</id>
      <name>Java.net Maven 1 Repository (legacy)</name>
      <url>http://download.java.net/maven/1/</url>
      <layout>legacy</layout>
    </repository>
  </repositories>
  <pluginRepositories>
    <pluginRepository>
      <id>maven2-repository.dev.java.net</id>
      <name>Java.net Maven 2 Repository</name>
      <url>http://download.java.net/maven/2/</url>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </pluginRepository>
    <pluginRepository>
      <id>maven-repository.dev.java.net</id>
      <name>Java.net Maven 1 Repository (legacy)</name>
      <url>http://download.java.net/maven/1/</url>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <layout>legacy</layout>
    </pluginRepository>
  </pluginRepositories>

And you will need the corresponding JAXB dependencies for java 1.4.

      <dependency>
        <groupId>javax.xml.bind</groupId>
        <artifactId>jaxb-api</artifactId>
        <version>1.0</version>
        <scope>compile</scope>
        <exclusions>
          <!--
          Excluded because of certificate problems.
          Classes must be provided by additional jaxp-api
          dependency when used.
          -->
          <exclusion>
            <groupId>javax.xml</groupId>
            <artifactId>namespace</artifactId>
          </exclusion>
          <exclusion>
            <groupId>javax.xml</groupId>
            <artifactId>jax-qname</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>com.sun.xml.bind</groupId>
        <artifactId>jaxb-impl</artifactId>
        <version>1.0.6</version>
        <scope>compile</scope>
      </dependency>

      <dependency>
        <groupId>javax.xml.parsers</groupId>
        <artifactId>jaxp-api</artifactId>
        <version>1.4</version>
        <scope>compile</scope>
      </dependency>
      <dependency>
        <groupId>com.sun.xml.parsers</groupId>
        <artifactId>jaxp-ri</artifactId>
        <version>1.4</version>
        <scope>runtime</scope>
      </dependency>

Give it a try.

-- 
Christian

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: Does Java 1.4 support "maven-jaxb-plugin"?

Posted by Jörg Schaible <Jo...@scalaris.com>.
Hi Thomas,

since that JAVA 5 class is part of the plugin dependecnies I doubt anywhay that you are able to run Maven with JDK 1.4. And I doubt that this JaxB will produce Java 1.4 code. You may try http://ws.apache.org/jaxme/mp/ as alternative.

- Jörg

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Does Java 1.4 support "maven-jaxb-plugin"?

Posted by Nick Stolwijk <ni...@gmail.com>.
I don't know if jaxb supports java 1.4, but if it does, try setting
your source to 1.5 and target to 1.4.

Hth,

Nick Stolwijk
~Java Developer~

Iprofs BV.
Claus Sluterweg 125
2012 WS Haarlem
www.iprofs.nl



On Wed, Oct 29, 2008 at 3:51 PM, thomas2004 <th...@yahoo.de> wrote:
>
> I do use the version of 1.4 as follow. But it doesn't help. The created java
> files by "maven-jaxb-plugin" contains annotation which is not supported by
> Java 1.4.
>
>                        <plugin>
>                                <artifactId>maven-war-plugin</artifactId>
>                                <configuration>
>                                        <archive>
>                                                <manifest>
>                                                        <addClasspath>true</addClasspath>
>                                                </manifest>
>                                        </archive>
>                                </configuration>
>                        </plugin>
>                        <plugin>
>                                <groupId>com.sun.tools.xjc.maven2</groupId>
>                                <artifactId>maven-jaxb-plugin</artifactId>
>                                <executions>
>                                        <execution>
>                                                <phase>generate-sources</phase>
>                                                <goals>
>                                                        <goal>generate</goal>
>                                                </goals>
>                                        </execution>
>                                </executions>
>                                <configuration>
>                                        <generatePackage>de.proactiv.pbv.dsl</generatePackage>
>                                        <schemaDirectory>src/main/webapp/WEB-INF/xsd</schemaDirectory>
>                                </configuration>
>                        </plugin>
>                        <plugin>
>                                <artifactId>maven-compiler-plugin</artifactId>
>                                <configuration>
>                                        <source>1.4</source>
>                                        <target>1.4</target>
>                                </configuration>
>                        </plugin>
>
>
>
>
> Nick Stolwijk-4 wrote:
>>
>> Use Java 1.5 to run maven, but configure the compiler plugin to output
>> Java 1.4 code. [1]
>>
>> [1]
>> http://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#source
>>
>> Hth,
>>
>> Nick Stolwijk
>> ~Java Developer~
>>
>> Iprofs BV.
>> Claus Sluterweg 125
>> 2012 WS Haarlem
>> www.iprofs.nl
>>
>>
>>
>> On Wed, Oct 29, 2008 at 1:39 PM, thomas2004 <th...@yahoo.de> wrote:
>>>
>>> Hi all,
>>>
>>> I use following plugin in my pom.xml to convert XSD to java:
>>> ...
>>>                        <plugin>
>>>
>>> <groupId>com.sun.tools.xjc.maven2</groupId>
>>>                                <artifactId>maven-jaxb-plugin</artifactId>
>>>                                <executions>
>>>                                        <execution>
>>>
>>> <phase>generate-sources</phase>
>>>                                                <goals>
>>>
>>> <goal>generate</goal>
>>>                                                </goals>
>>>                                        </execution>
>>>                                </executions>
>>>                                <configuration>
>>>
>>> <generatePackage>com.mycompany</generatePackage>
>>>
>>> <schemaDirectory>src/main/webapp/WEB-INF/xsd</schemaDirectory>
>>>                                </configuration>
>>>                        </plugin>
>>> ...
>>>
>>> I use Java 1.4. As I run mvn install, I got error as follow:
>>> ...
>>> [ERROR] BUILD ERROR
>>> [INFO]
>>> ------------------------------------------------------------------------
>>> [INFO] Internal error in the plugin manager executing goal
>>> 'com.sun.tools.xjc.ma
>>> ven2:maven-jaxb-plugin:1.1:generate': Unable to find the mojo
>>> 'com.sun.tools.xjc
>>> .maven2:maven-jaxb-plugin:1.1:generate' in the plugin
>>> 'com.sun.tools.xjc.maven2:
>>> maven-jaxb-plugin'
>>> com/sun/tools/xjc/maven2/XJCMojo (Unsupported major.minor version 49.0)
>>> [INFO]
>>> ------------------------------------------------------------------------
>>> [INFO] For more information, run Maven with the -e switch
>>> [INFO]
>>> ------------------------------------------------------------------------
>>> [INFO] Total time: 2 seconds
>>> [INFO] Finished at: Wed Oct 29 13:38:08 CET 2008
>>> [INFO] Final Memory: 8M/15M
>>> [INFO]
>>> ------------------------------------------------------------------------
>>> ...
>>>
>>> Surely when I use Java 1.5. It is OK. But I do want to use Java 1.4 since
>>> I
>>> will deploy my web-application to WebLogic 8 which is just compatible
>>> with
>>> Java 1.4.
>>>
>>> Has someone idea?
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Does-Java-1.4-support-%22maven-jaxb-plugin%22--tp20226200p20226200.html
>>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Does-Java-1.4-support-%22maven-jaxb-plugin%22--tp20226200p20228733.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Does Java 1.4 support "maven-jaxb-plugin"?

Posted by thomas2004 <th...@yahoo.de>.
I do use the version of 1.4 as follow. But it doesn't help. The created java
files by "maven-jaxb-plugin" contains annotation which is not supported by
Java 1.4.

			<plugin>
				<artifactId>maven-war-plugin</artifactId>
				<configuration>
					<archive>
						<manifest>
							<addClasspath>true</addClasspath>
						</manifest>
					</archive>
				</configuration>
			</plugin>
			<plugin>
				<groupId>com.sun.tools.xjc.maven2</groupId>
				<artifactId>maven-jaxb-plugin</artifactId>
				<executions>
					<execution>
						<phase>generate-sources</phase>
						<goals>
							<goal>generate</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<generatePackage>de.proactiv.pbv.dsl</generatePackage>
					<schemaDirectory>src/main/webapp/WEB-INF/xsd</schemaDirectory>
				</configuration>
			</plugin>
			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<configuration>
					<source>1.4</source>
					<target>1.4</target>
				</configuration>
			</plugin>




Nick Stolwijk-4 wrote:
> 
> Use Java 1.5 to run maven, but configure the compiler plugin to output
> Java 1.4 code. [1]
> 
> [1]
> http://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#source
> 
> Hth,
> 
> Nick Stolwijk
> ~Java Developer~
> 
> Iprofs BV.
> Claus Sluterweg 125
> 2012 WS Haarlem
> www.iprofs.nl
> 
> 
> 
> On Wed, Oct 29, 2008 at 1:39 PM, thomas2004 <th...@yahoo.de> wrote:
>>
>> Hi all,
>>
>> I use following plugin in my pom.xml to convert XSD to java:
>> ...
>>                        <plugin>
>>                               
>> <groupId>com.sun.tools.xjc.maven2</groupId>
>>                                <artifactId>maven-jaxb-plugin</artifactId>
>>                                <executions>
>>                                        <execution>
>>                                               
>> <phase>generate-sources</phase>
>>                                                <goals>
>>                                                       
>> <goal>generate</goal>
>>                                                </goals>
>>                                        </execution>
>>                                </executions>
>>                                <configuration>
>>                                       
>> <generatePackage>com.mycompany</generatePackage>
>>                                       
>> <schemaDirectory>src/main/webapp/WEB-INF/xsd</schemaDirectory>
>>                                </configuration>
>>                        </plugin>
>> ...
>>
>> I use Java 1.4. As I run mvn install, I got error as follow:
>> ...
>> [ERROR] BUILD ERROR
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] Internal error in the plugin manager executing goal
>> 'com.sun.tools.xjc.ma
>> ven2:maven-jaxb-plugin:1.1:generate': Unable to find the mojo
>> 'com.sun.tools.xjc
>> .maven2:maven-jaxb-plugin:1.1:generate' in the plugin
>> 'com.sun.tools.xjc.maven2:
>> maven-jaxb-plugin'
>> com/sun/tools/xjc/maven2/XJCMojo (Unsupported major.minor version 49.0)
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] For more information, run Maven with the -e switch
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] Total time: 2 seconds
>> [INFO] Finished at: Wed Oct 29 13:38:08 CET 2008
>> [INFO] Final Memory: 8M/15M
>> [INFO]
>> ------------------------------------------------------------------------
>> ...
>>
>> Surely when I use Java 1.5. It is OK. But I do want to use Java 1.4 since
>> I
>> will deploy my web-application to WebLogic 8 which is just compatible
>> with
>> Java 1.4.
>>
>> Has someone idea?
>> --
>> View this message in context:
>> http://www.nabble.com/Does-Java-1.4-support-%22maven-jaxb-plugin%22--tp20226200p20226200.html
>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Does-Java-1.4-support-%22maven-jaxb-plugin%22--tp20226200p20228733.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Does Java 1.4 support "maven-jaxb-plugin"?

Posted by Nick Stolwijk <ni...@gmail.com>.
Use Java 1.5 to run maven, but configure the compiler plugin to output
Java 1.4 code. [1]

[1] http://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#source

Hth,

Nick Stolwijk
~Java Developer~

Iprofs BV.
Claus Sluterweg 125
2012 WS Haarlem
www.iprofs.nl



On Wed, Oct 29, 2008 at 1:39 PM, thomas2004 <th...@yahoo.de> wrote:
>
> Hi all,
>
> I use following plugin in my pom.xml to convert XSD to java:
> ...
>                        <plugin>
>                                <groupId>com.sun.tools.xjc.maven2</groupId>
>                                <artifactId>maven-jaxb-plugin</artifactId>
>                                <executions>
>                                        <execution>
>                                                <phase>generate-sources</phase>
>                                                <goals>
>                                                        <goal>generate</goal>
>                                                </goals>
>                                        </execution>
>                                </executions>
>                                <configuration>
>                                        <generatePackage>com.mycompany</generatePackage>
>                                        <schemaDirectory>src/main/webapp/WEB-INF/xsd</schemaDirectory>
>                                </configuration>
>                        </plugin>
> ...
>
> I use Java 1.4. As I run mvn install, I got error as follow:
> ...
> [ERROR] BUILD ERROR
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Internal error in the plugin manager executing goal
> 'com.sun.tools.xjc.ma
> ven2:maven-jaxb-plugin:1.1:generate': Unable to find the mojo
> 'com.sun.tools.xjc
> .maven2:maven-jaxb-plugin:1.1:generate' in the plugin
> 'com.sun.tools.xjc.maven2:
> maven-jaxb-plugin'
> com/sun/tools/xjc/maven2/XJCMojo (Unsupported major.minor version 49.0)
> [INFO]
> ------------------------------------------------------------------------
> [INFO] For more information, run Maven with the -e switch
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 2 seconds
> [INFO] Finished at: Wed Oct 29 13:38:08 CET 2008
> [INFO] Final Memory: 8M/15M
> [INFO]
> ------------------------------------------------------------------------
> ...
>
> Surely when I use Java 1.5. It is OK. But I do want to use Java 1.4 since I
> will deploy my web-application to WebLogic 8 which is just compatible with
> Java 1.4.
>
> Has someone idea?
> --
> View this message in context: http://www.nabble.com/Does-Java-1.4-support-%22maven-jaxb-plugin%22--tp20226200p20226200.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org