Skip to content

Commit 85f2ba8

Browse files
author
=
committed
just do it... revert to maven 3.0.5 until there is a fix for the two plugins i had to add to the jboss-as-maven-plugin
1 parent 2b5ce37 commit 85f2ba8

File tree

20 files changed

+382
-304
lines changed

20 files changed

+382
-304
lines changed

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,4 @@
1212
.DS_Store
1313

1414
# Maven
15-
log/
16-
target/
15+
log/

algorithms/algorithms.iml

Lines changed: 9 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,23 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
3+
<component name="FacetManager">
4+
<facet type="ejb" name="EJB">
5+
<configuration>
6+
<ejbRoots>
7+
<root url="file://$MODULE_DIR$/src/main/java" />
8+
</ejbRoots>
9+
</configuration>
10+
</facet>
11+
</component>
312
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false">
413
<output url="file://$MODULE_DIR$/target/classes" />
514
<output-test url="file://$MODULE_DIR$/target/test-classes" />
615
<content url="file://$MODULE_DIR$">
716
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
8-
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" isTestSource="false" />
9-
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
1017
<excludeFolder url="file://$MODULE_DIR$/target" />
1118
</content>
1219
<orderEntry type="inheritedJdk" />
1320
<orderEntry type="sourceFolder" forTests="false" />
14-
<orderEntry type="library" name="Maven: commons-collections:commons-collections:3.2.1" level="project" />
15-
<orderEntry type="library" name="Maven: commons-io:commons-io:2.4" level="project" />
16-
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.1" level="project" />
17-
<orderEntry type="library" name="Maven: joda-time:joda-time:2.2" level="project" />
18-
<orderEntry type="library" name="Maven: org.jboss.spec:jboss-javaee-all-6.0:3.0.2.Final" level="project" />
19-
<orderEntry type="library" name="Maven: javax.activation:activation:1.1.1" level="project" />
20-
<orderEntry type="library" name="Maven: javax.enterprise:cdi-api:1.0-SP4" level="project" />
21-
<orderEntry type="library" name="Maven: org.jboss.spec.javax.interceptor:jboss-interceptors-api_1.1_spec:1.0.1.Final" level="project" />
22-
<orderEntry type="library" name="Maven: javax.inject:javax.inject:1" level="project" />
23-
<orderEntry type="library" name="Maven: javax.jws:jsr181-api:1.0-MR1" level="project" />
24-
<orderEntry type="library" name="Maven: javax.mail:mail:1.4.4" level="project" />
25-
<orderEntry type="library" name="Maven: javax.validation:validation-api:1.0.0.GA" level="project" />
26-
<orderEntry type="library" name="Maven: org.hibernate.javax.persistence:hibernate-jpa-2.0-api:1.0.1.Final" level="project" />
27-
<orderEntry type="library" name="Maven: org.jboss.spec.javax.annotation:jboss-annotations-api_1.1_spec:1.0.1.Final" level="project" />
28-
<orderEntry type="library" name="Maven: org.jboss.spec.javax.ejb:jboss-ejb-api_3.1_spec:1.0.2.Final" level="project" />
29-
<orderEntry type="library" name="Maven: org.jboss.spec.javax.el:jboss-el-api_2.2_spec:1.0.2.Final" level="project" />
30-
<orderEntry type="library" name="Maven: org.jboss.spec.javax.enterprise.deploy:jboss-jad-api_1.2_spec:1.0.1.Final" level="project" />
31-
<orderEntry type="library" name="Maven: org.jboss.spec.javax.faces:jboss-jsf-api_2.1_spec:2.0.9.Final" level="project" />
32-
<orderEntry type="library" name="Maven: org.jboss.spec.javax.management.j2ee:jboss-j2eemgmt-api_1.1_spec:1.0.1.Final" level="project" />
33-
<orderEntry type="library" name="Maven: org.jboss.spec.javax.resource:jboss-connector-api_1.6_spec:1.0.1.Final" level="project" />
34-
<orderEntry type="library" name="Maven: org.jboss.spec.javax.rmi:jboss-rmi-api_1.0_spec:1.0.4.Final" level="project" />
35-
<orderEntry type="library" name="Maven: org.jboss.spec.javax.security.jacc:jboss-jacc-api_1.4_spec:1.0.2.Final" level="project" />
36-
<orderEntry type="library" name="Maven: org.jboss.spec.javax.servlet:jboss-servlet-api_3.0_spec:1.0.2.Final" level="project" />
37-
<orderEntry type="library" name="Maven: org.jboss.spec.javax.security.auth.message:jboss-jaspi-api_1.0_spec:1.0.1.Final" level="project" />
38-
<orderEntry type="library" name="Maven: org.jboss.spec.javax.xml.registry:jboss-jaxr-api_1.0_spec:1.0.2.Final" level="project" />
39-
<orderEntry type="library" name="Maven: org.jboss.spec.javax.jms:jboss-jms-api_1.1_spec:1.0.1.Final" level="project" />
40-
<orderEntry type="library" name="Maven: org.jboss.spec.javax.servlet.jsp:jboss-jsp-api_2.2_spec:1.0.1.Final" level="project" />
41-
<orderEntry type="library" name="Maven: org.jboss.spec.javax.servlet.jstl:jboss-jstl-api_1.2_spec:1.0.3.Final" level="project" />
42-
<orderEntry type="library" name="Maven: xalan:xalan:2.7.1" level="project" />
43-
<orderEntry type="library" name="Maven: xalan:serializer:2.7.1" level="project" />
44-
<orderEntry type="library" name="Maven: xml-apis:xml-apis:1.3.04" level="project" />
45-
<orderEntry type="library" name="Maven: org.jboss.spec.javax.transaction:jboss-transaction-api_1.1_spec:1.0.1.Final" level="project" />
46-
<orderEntry type="library" name="Maven: org.jboss.spec.javax.ws.rs:jboss-jaxrs-api_1.1_spec:1.0.1.Final" level="project" />
47-
<orderEntry type="library" name="Maven: org.jboss.spec.javax.xml.bind:jboss-jaxb-api_2.2_spec:1.0.4.Final" level="project" />
48-
<orderEntry type="library" name="Maven: org.jboss.spec.javax.xml.rpc:jboss-jaxrpc-api_1.1_spec:1.0.1.Final" level="project" />
49-
<orderEntry type="library" name="Maven: org.jboss.spec.javax.xml.soap:jboss-saaj-api_1.3_spec:1.0.2.Final" level="project" />
50-
<orderEntry type="library" name="Maven: org.jboss.spec.javax.xml.ws:jboss-jaxws-api_2.2_spec:2.0.1.Final" level="project" />
5121
<orderEntry type="module" module-name="core" />
5222
<orderEntry type="library" name="Maven: commons-collections:commons-collections:3.2.1" level="project" />
5323
<orderEntry type="library" name="Maven: commons-io:commons-io:2.4" level="project" />

core/core.iml

Lines changed: 11 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,27 @@
55
<configuration>
66
<setting name="validation-enabled" value="true" />
77
<setting name="provider-name" value="" />
8-
<datasource-mapping>
9-
<factory-entry name="AlgorithmsPU" value="13e89613-10bb-4368-ba49-3cf3b1a9795e" />
10-
</datasource-mapping>
8+
<datasource-mapping />
119
<deploymentDescriptor name="persistence.xml" url="file://$MODULE_DIR$/META-INF/persistence.xml" />
1210
</configuration>
1311
</facet>
12+
<facet type="ejb" name="EJB">
13+
<configuration>
14+
<ejbRoots>
15+
<root url="file://$MODULE_DIR$/src/main/java" />
16+
<root url="file://$MODULE_DIR$/src/main/resources" />
17+
</ejbRoots>
18+
</configuration>
19+
</facet>
1420
</component>
1521
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false">
1622
<output url="file://$MODULE_DIR$/target/classes" />
1723
<output-test url="file://$MODULE_DIR$/target/test-classes" />
1824
<content url="file://$MODULE_DIR$">
25+
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
26+
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" isTestSource="true" />
1927
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
2028
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" isTestSource="false" />
21-
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
2229
<excludeFolder url="file://$MODULE_DIR$/target" />
2330
</content>
2431
<orderEntry type="inheritedJdk" />
@@ -60,43 +67,6 @@
6067
<orderEntry type="library" scope="PROVIDED" name="Maven: org.jboss.spec.javax.xml.soap:jboss-saaj-api_1.3_spec:1.0.2.Final" level="project" />
6168
<orderEntry type="library" scope="PROVIDED" name="Maven: org.jboss.spec.javax.xml.ws:jboss-jaxws-api_2.2_spec:2.0.1.Final" level="project" />
6269
<orderEntry type="library" name="Maven: joda-time:joda-time:2.2" level="project" />
63-
<orderEntry type="library" name="Maven: commons-collections:commons-collections:3.2.1" level="project" />
64-
<orderEntry type="library" name="Maven: commons-io:commons-io:2.4" level="project" />
65-
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.1" level="project" />
66-
<orderEntry type="library" scope="PROVIDED" name="Maven: org.jboss.spec:jboss-javaee-all-6.0:3.0.2.Final" level="project" />
67-
<orderEntry type="library" scope="PROVIDED" name="Maven: javax.activation:activation:1.1.1" level="project" />
68-
<orderEntry type="library" scope="PROVIDED" name="Maven: javax.enterprise:cdi-api:1.0-SP4" level="project" />
69-
<orderEntry type="library" scope="PROVIDED" name="Maven: org.jboss.spec.javax.interceptor:jboss-interceptors-api_1.1_spec:1.0.1.Final" level="project" />
70-
<orderEntry type="library" scope="PROVIDED" name="Maven: javax.inject:javax.inject:1" level="project" />
71-
<orderEntry type="library" scope="PROVIDED" name="Maven: javax.jws:jsr181-api:1.0-MR1" level="project" />
72-
<orderEntry type="library" scope="PROVIDED" name="Maven: javax.mail:mail:1.4.4" level="project" />
73-
<orderEntry type="library" scope="PROVIDED" name="Maven: javax.validation:validation-api:1.0.0.GA" level="project" />
74-
<orderEntry type="library" scope="PROVIDED" name="Maven: org.hibernate.javax.persistence:hibernate-jpa-2.0-api:1.0.1.Final" level="project" />
75-
<orderEntry type="library" scope="PROVIDED" name="Maven: org.jboss.spec.javax.annotation:jboss-annotations-api_1.1_spec:1.0.1.Final" level="project" />
76-
<orderEntry type="library" scope="PROVIDED" name="Maven: org.jboss.spec.javax.ejb:jboss-ejb-api_3.1_spec:1.0.2.Final" level="project" />
77-
<orderEntry type="library" scope="PROVIDED" name="Maven: org.jboss.spec.javax.el:jboss-el-api_2.2_spec:1.0.2.Final" level="project" />
78-
<orderEntry type="library" scope="PROVIDED" name="Maven: org.jboss.spec.javax.enterprise.deploy:jboss-jad-api_1.2_spec:1.0.1.Final" level="project" />
79-
<orderEntry type="library" scope="PROVIDED" name="Maven: org.jboss.spec.javax.faces:jboss-jsf-api_2.1_spec:2.0.9.Final" level="project" />
80-
<orderEntry type="library" scope="PROVIDED" name="Maven: org.jboss.spec.javax.management.j2ee:jboss-j2eemgmt-api_1.1_spec:1.0.1.Final" level="project" />
81-
<orderEntry type="library" scope="PROVIDED" name="Maven: org.jboss.spec.javax.resource:jboss-connector-api_1.6_spec:1.0.1.Final" level="project" />
82-
<orderEntry type="library" scope="PROVIDED" name="Maven: org.jboss.spec.javax.rmi:jboss-rmi-api_1.0_spec:1.0.4.Final" level="project" />
83-
<orderEntry type="library" scope="PROVIDED" name="Maven: org.jboss.spec.javax.security.jacc:jboss-jacc-api_1.4_spec:1.0.2.Final" level="project" />
84-
<orderEntry type="library" scope="PROVIDED" name="Maven: org.jboss.spec.javax.servlet:jboss-servlet-api_3.0_spec:1.0.2.Final" level="project" />
85-
<orderEntry type="library" scope="PROVIDED" name="Maven: org.jboss.spec.javax.security.auth.message:jboss-jaspi-api_1.0_spec:1.0.1.Final" level="project" />
86-
<orderEntry type="library" scope="PROVIDED" name="Maven: org.jboss.spec.javax.xml.registry:jboss-jaxr-api_1.0_spec:1.0.2.Final" level="project" />
87-
<orderEntry type="library" scope="PROVIDED" name="Maven: org.jboss.spec.javax.jms:jboss-jms-api_1.1_spec:1.0.1.Final" level="project" />
88-
<orderEntry type="library" scope="PROVIDED" name="Maven: org.jboss.spec.javax.servlet.jsp:jboss-jsp-api_2.2_spec:1.0.1.Final" level="project" />
89-
<orderEntry type="library" scope="PROVIDED" name="Maven: org.jboss.spec.javax.servlet.jstl:jboss-jstl-api_1.2_spec:1.0.3.Final" level="project" />
90-
<orderEntry type="library" scope="PROVIDED" name="Maven: xalan:xalan:2.7.1" level="project" />
91-
<orderEntry type="library" scope="PROVIDED" name="Maven: xalan:serializer:2.7.1" level="project" />
92-
<orderEntry type="library" scope="PROVIDED" name="Maven: xml-apis:xml-apis:1.3.04" level="project" />
93-
<orderEntry type="library" scope="PROVIDED" name="Maven: org.jboss.spec.javax.transaction:jboss-transaction-api_1.1_spec:1.0.1.Final" level="project" />
94-
<orderEntry type="library" scope="PROVIDED" name="Maven: org.jboss.spec.javax.ws.rs:jboss-jaxrs-api_1.1_spec:1.0.1.Final" level="project" />
95-
<orderEntry type="library" scope="PROVIDED" name="Maven: org.jboss.spec.javax.xml.bind:jboss-jaxb-api_2.2_spec:1.0.4.Final" level="project" />
96-
<orderEntry type="library" scope="PROVIDED" name="Maven: org.jboss.spec.javax.xml.rpc:jboss-jaxrpc-api_1.1_spec:1.0.1.Final" level="project" />
97-
<orderEntry type="library" scope="PROVIDED" name="Maven: org.jboss.spec.javax.xml.soap:jboss-saaj-api_1.3_spec:1.0.2.Final" level="project" />
98-
<orderEntry type="library" scope="PROVIDED" name="Maven: org.jboss.spec.javax.xml.ws:jboss-jaxws-api_2.2_spec:2.0.1.Final" level="project" />
99-
<orderEntry type="library" name="Maven: joda-time:joda-time:2.2" level="project" />
10070
</component>
10171
</module>
10272

core/src/main/java/com/thenaglecode/core/util/ResourceLocator.java

Lines changed: 0 additions & 65 deletions
This file was deleted.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package com.thenaglecode.core.util.propeties;
2+
3+
import java.lang.annotation.Retention;
4+
import java.lang.annotation.Target;
5+
6+
import static java.lang.annotation.ElementType.*;
7+
import static java.lang.annotation.RetentionPolicy.RUNTIME;
8+
9+
/**
10+
* Created with IntelliJ IDEA.
11+
* User: jxnagl
12+
* Date: 9/3/13
13+
* Time: 5:11 PM
14+
*
15+
* @see CoreProducer#produceResourceBundle(javax.enterprise.inject.spi.InjectionPoint)
16+
*/
17+
@Retention(RUNTIME)
18+
@Target({METHOD, FIELD, PARAMETER, TYPE})
19+
public @interface Bundle {
20+
public String subsystem() default "";
21+
public String name() default "configuration";
22+
public String locale() default "";
23+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package com.thenaglecode.core.util.propeties;
2+
3+
import javax.inject.Qualifier;
4+
import java.lang.annotation.Retention;
5+
import java.lang.annotation.RetentionPolicy;
6+
import java.lang.annotation.Target;
7+
8+
import static java.lang.annotation.ElementType.*;
9+
10+
/**
11+
* Created with IntelliJ IDEA.
12+
* User: jxnagl
13+
* Date: 9/4/13
14+
* Time: 3:31 PM
15+
*/
16+
@Qualifier
17+
@Retention(RetentionPolicy.RUNTIME)
18+
@Target({METHOD, FIELD, PARAMETER, TYPE})
19+
public @interface Core {
20+
}
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
package com.thenaglecode.core.util.propeties;
2+
3+
import javax.enterprise.inject.Produces;
4+
import javax.enterprise.inject.spi.InjectionPoint;
5+
import java.util.ArrayList;
6+
import java.util.List;
7+
import java.util.Locale;
8+
import java.util.PropertyResourceBundle;
9+
10+
/**
11+
* Created with IntelliJ IDEA.
12+
* User: jxnagl
13+
* Date: 9/3/13
14+
* Time: 5:11 PM
15+
*
16+
* stores all the producers for core functionality. e.g. ResourceBundles.
17+
*
18+
* @see Bundle
19+
*/
20+
public class CoreProducer {
21+
22+
public static final String DEFAULT_CONFIGURATION_BUNDLE_NAME = "configuration";
23+
24+
/**
25+
* produces a ResourceBundle using the details provided. each bundle name is an extension of the
26+
* root prefix of <code>'{@value GLOBAL#THENAGLECODE_ROOT_URL}'</code>
27+
*
28+
* @param ip the InjectionPoint that the annotation applies to. i.e. the field to be injected into.
29+
* @return a ResourceBundle if found or null if none found.
30+
*/
31+
@Produces
32+
@Core
33+
private PropertyResourceBundle produceResourceBundle(InjectionPoint ip) {
34+
Bundle b;
35+
if (ip.getAnnotated().isAnnotationPresent(Bundle.class)) {
36+
b = ip.getAnnotated().getAnnotation(Bundle.class);
37+
} else return null;
38+
Class container = ip.getMember().getDeclaringClass();
39+
String subsystem = b.subsystem() != null && !b.subsystem().equals("") ? b.subsystem() : container.getPackage().getName();
40+
if(subsystem.startsWith(GLOBAL.THENAGLECODE_ROOT_URL))
41+
subsystem = subsystem.substring(GLOBAL.THENAGLECODE_ROOT_URL.length() + 1);
42+
String name = b.name() != null && !b.name().equals("") ? b.name() : DEFAULT_CONFIGURATION_BUNDLE_NAME;
43+
44+
String baseName = GLOBAL.THENAGLECODE_ROOT_URL + "." + subsystem + "." + name;
45+
46+
Locale locale;
47+
List<String> localPieces = new ArrayList<>();
48+
if (b.locale().equals("") || b.locale().equals("default")) {
49+
locale = Locale.getDefault();
50+
} else {
51+
String[] lpieces = b.locale().split("_", 3);
52+
switch (lpieces.length) {
53+
case 0:
54+
locale = Locale.getDefault();
55+
break;
56+
case 1:
57+
locale = new Locale(lpieces[0]);
58+
break;
59+
case 2:
60+
locale = new Locale(lpieces[0], lpieces[1]);
61+
break;
62+
case 3:
63+
locale = new Locale(lpieces[0], lpieces[1], lpieces[2]);
64+
break;
65+
default:
66+
locale = Locale.getDefault();
67+
break;
68+
}
69+
}
70+
baseName = baseName.replace(".", "/");
71+
return (PropertyResourceBundle) PropertyResourceBundle.getBundle(baseName, locale);
72+
}
73+
74+
@Produces
75+
@Core
76+
private RefreshablePropertyResourceBundle produceRefreshablePropertyResourceBundle (InjectionPoint ip){
77+
Bundle b;
78+
if (ip.getAnnotated().isAnnotationPresent(Bundle.class)) {
79+
b = ip.getAnnotated().getAnnotation(Bundle.class);
80+
} else return null;
81+
Class container = ip.getMember().getDeclaringClass();
82+
String subsystem = b.subsystem() != null && !b.subsystem().equals("") ? b.subsystem() : container.getPackage().getName();
83+
if(subsystem.startsWith(GLOBAL.THENAGLECODE_ROOT_URL))
84+
subsystem = subsystem.substring(GLOBAL.THENAGLECODE_ROOT_URL.length() + 1);
85+
String name = b.name() != null && !b.name().equals("") ? b.name() : DEFAULT_CONFIGURATION_BUNDLE_NAME;
86+
String baseName = GLOBAL.THENAGLECODE_ROOT_URL + "." + subsystem;
87+
return ConfigurationUtil.getRefreshablePropertyResourceBundle(subsystem, name);
88+
}
89+
}

0 commit comments

Comments
 (0)