Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fixing build issues on annotate
remove .gitignore unnecessary files
fix root README.md
refactoring org.jvnet.annox to org.jvnet.jaxb.annox
upgrade / align dependencies
  • Loading branch information
laurentschoelens committed Aug 21, 2023
1 parent 5fd7b33 commit 61fa5fb
Show file tree
Hide file tree
Showing 362 changed files with 1,324 additions and 1,497 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
**/.project
**/.settings
target
.DS_Store
372 changes: 188 additions & 184 deletions README.md

Large diffs are not rendered by default.

5 changes: 0 additions & 5 deletions basics/ant/.gitignore

This file was deleted.

4 changes: 0 additions & 4 deletions basics/basic/.gitignore

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -58,7 +59,7 @@
*
* @author Manuel Siggen (c) 2012 Etat-de-Vaud (www.vd.ch)
*/
@SuppressWarnings("UnusedDeclaration")
@SuppressWarnings("unused")
public class NamespacePrefixPlugin extends Plugin {

private static final String NAMESPACE_URI = "http://jaxb2-commons.dev.java.net/basic/namespace-prefix";
Expand Down Expand Up @@ -204,12 +205,11 @@ private static void addNamespacePrefix(JClass xmlNsClass, JAnnotationArrayMember
ns.param("prefix", prefix);
}

@SuppressWarnings("unchecked")
private static JAnnotationUse getOrAddXmlSchemaAnnotation(JPackage p, JClass xmlSchemaClass) {

JAnnotationUse xmlAnn = null;

final List<JAnnotationUse> annotations = getAnnotations(p);
final Collection<JAnnotationUse> annotations = getAnnotations(p);
if (annotations != null) {
for (JAnnotationUse annotation : annotations) {
final JClass clazz = getAnnotationJClass(annotation);
Expand Down Expand Up @@ -257,51 +257,19 @@ private static Model getPackageModel(PackageOutlineImpl packageOutline) {
}
}

@SuppressWarnings("unchecked")
private static List<JAnnotationUse> getAnnotations(JPackage p) {
// TODO bump jaxb-xjc dependency to version >= 2.2.2 and use the annotations() method instead.
try {
final Field annotationsField = JPackage.class.getDeclaredField("annotations");
annotationsField.setAccessible(true);
return (List<JAnnotationUse>) annotationsField.get(p);
}
catch (IllegalAccessException e) {
throw new RuntimeException("Unable to access 'annotation' field for package [" + p.name() + "] : " + e.getMessage(), e);
}
catch (NoSuchFieldException e) {
throw new RuntimeException("Unable to find 'annotation' field for package [" + p.name() + "] : " + e.getMessage(), e);
}
private static Collection<JAnnotationUse> getAnnotations(JPackage p) {
return p.annotations();
}

private static JClass getAnnotationJClass(JAnnotationUse annotation) {
try {
final Field clazzField = JAnnotationUse.class.getDeclaredField("clazz");
clazzField.setAccessible(true);
return (JClass) clazzField.get(annotation);
}
catch (IllegalAccessException e) {
throw new RuntimeException("Unable to access 'clazz' field for class [JAnnotationUse] : " + e.getMessage(), e);
}
catch (NoSuchFieldException e) {
throw new RuntimeException("Unable to find 'annotation' field for class [JAnnotationUse] : " + e.getMessage(), e);
}
return annotation.getAnnotationClass();
}

@SuppressWarnings("unchecked")
private static Map<String, JAnnotationValue> getAnnotationMemberValues(JAnnotationUse annotation) {
try {
final Field clazzField = JAnnotationUse.class.getDeclaredField("memberValues");
clazzField.setAccessible(true);
return (Map<String, JAnnotationValue>) clazzField.get(annotation);
}
catch (IllegalAccessException e) {
throw new RuntimeException("Unable to access 'memberValues' field for class [JAnnotationUse] : " + e.getMessage(), e);
}
catch (NoSuchFieldException e) {
throw new RuntimeException("Unable to find 'memberValues' field for class [JAnnotationUse] : " + e.getMessage(), e);
}
return annotation.getAnnotationMembers();
}


private static String getStringAnnotationValue(JAnnotationValue val) {
try {
final Field clazzField = val.getClass().getDeclaredField("value");
Expand Down
1 change: 0 additions & 1 deletion basics/dist/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb2-basics-dist</artifactId>
<packaging>pom</packaging>
<name>JAXB Tools :: JAXB Basics :: Distribution</name>
Expand Down
4 changes: 0 additions & 4 deletions basics/plugins/.gitignore

This file was deleted.

134 changes: 8 additions & 126 deletions basics/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,131 +46,13 @@
</modules>
</profile>
</profiles>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jaxb-core.version>2.3.0.1</jaxb-core.version>
<commons-beanutils.version>1.9.4</commons-beanutils.version>
<cxf-codegen-plugin.version>3.3.13</cxf-codegen-plugin.version>
</properties>
<prerequisites>
<maven>3.1</maven>
</prerequisites>
<dependencies>
<!-- JUnit -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb2-basics-plugins</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb2-basics-ant</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb2-basics-runtime</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb2-basics-tools</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb2-basics-testing</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb2-basics</artifactId>
<version>${project.version}</version>
</dependency>
<!-- JAXB Maven Plugin -->
<dependency>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb-maven-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb-maven-plugin-testing</artifactId>
<version>${project.version}</version>
</dependency>
<!-- JAXB -->
<!-- Start of add'l jaxb dependencies -->
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-core</artifactId>
<version>${jaxb-core.version}</version>
</dependency>
<!-- Joda-Time -->
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.5</version>
</dependency>
<!-- Commons -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.2.1</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.11.0</version>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>${commons-beanutils.version}</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring</artifactId>
<version>2.0.7</version>
</dependency>
<!-- XMLUnit -->
<dependency>
<groupId>xmlunit</groupId>
<artifactId>xmlunit</artifactId>
<version>1.5</version>
</dependency>
<!-- Ant -->
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
<version>${ant.version}</version>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant-launcher</artifactId>
<version>${ant.version}</version>
</dependency>
<!-- Java Parser -->
<dependency>
<groupId>com.google.code.javaparser</groupId>
<artifactId>javaparser</artifactId>
<version>1.0.11</version>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<!-- JUnit -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>

4 changes: 0 additions & 4 deletions basics/runtime/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion basics/samples/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion basics/samples/basic/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion basics/samples/cxf/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion basics/samples/po-simple/.gitignore

This file was deleted.

6 changes: 6 additions & 0 deletions basics/samples/po-simple/project-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@
<version>${slf4j.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit4.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<defaultGoal>test</defaultGoal>
Expand Down
1 change: 0 additions & 1 deletion basics/samples/po/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion basics/samples/po/project-build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
<include name="istack-commons-*.jar"/>
<include name="jakarta.xml.bind-api-*.jar"/>
<include name="jaxb2-basics-runtime-*.jar"/>
<include name="junit-*.jar"/>
<include name="relaxng-datatype-*.jar"/>
<include name="rngom-*.jar"/>
<include name="txw2-*.jar"/>
Expand Down
27 changes: 20 additions & 7 deletions basics/samples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@
<module>po-simple</module>
<module>cxf</module>
</modules>
<dependencies>
<dependency>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb-maven-plugin</artifactId>
<version>${project.version}</version>
<type>maven-plugin</type>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<defaultGoal>install</defaultGoal>
<plugins>
Expand Down Expand Up @@ -115,13 +124,17 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
4 changes: 0 additions & 4 deletions basics/testing/.gitignore

This file was deleted.

4 changes: 0 additions & 4 deletions basics/tests/JAXB-1058/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion basics/tests/commons_lang/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.12.0</version>
</dependency>
</dependencies>
<build>
Expand Down
1 change: 0 additions & 1 deletion basics/tests/episodes/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion basics/tests/episodes/a/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion basics/tests/episodes/b/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion basics/tests/ignoring/.gitignore

This file was deleted.

4 changes: 0 additions & 4 deletions basics/tests/issues/.gitignore

This file was deleted.

4 changes: 0 additions & 4 deletions basics/tests/one/.gitignore

This file was deleted.

4 changes: 0 additions & 4 deletions basics/tests/po/.gitignore

This file was deleted.

Loading

0 comments on commit 61fa5fb

Please sign in to comment.