// Banco banco = new Itau();
Banco banco = new BancoDoBrasil();
Boleto boleto = Boleto.novoBoleto()
.comBanco(banco)
.comDatas(datas)
.comBeneficiario(beneficiario)
.comPagador(pagador)
.comValorBoleto("200.00")
.comNumeroDoDocumento("1234")
.comInstrucoes("instrucao 1", "instrucao 2", "instrucao 3", "instrucao 4", "instrucao 5")
.comLocaisDePagamento("local 1", "local 2");
GeradorDeBoleto gerador = new GeradorDeBoleto(boleto);
// Para gerar um boleto em PDF
gerador.geraPDF("BancoDoBrasil.pdf");
// Para gerar um boleto em PNG
gerador.geraPNG("BancoDoBrasil.png");
// Para gerar um array de bytes a partir de um PDF
byte[] bPDF = gerador.geraPDF();
// Para gerar um array de bytes a partir de um PNG
byte[] bPNG = gerador.geraPNG();
}
}
Pow.xml
4.0.0br.com.caelum.stellacaelum-stellapom2.1.3Caelum Stella
Caelum Stella is a set of validators, formatters and converters
for Brazilian common ids like Zip codes, State codes, social ids
and so on. Stella also provides adapters for JSF, Struts tag
libs, JSP tag libs, Hibernate Validator and JS completion.
http://stella.caelum.com.brCaelumhttp://www.caelum.com.brorg.sonatype.ossoss-parent7UTF-8stella-corestella-bean-validationstella-hibernate-user-typesstella-facesstella-boletostella-freteexamples/faces-example-1xexamples/faces-example-2xexamples/hibernate-persistence-exampleexamples/vraptor-validator-examplejunitjunit4.11testorg.jmockjmock2.4.0testorg.jmockjmock-legacy2.4.0testorg.mockitomockito-all1.8.5testjunitjunitorg.jmockjmockorg.jmockjmock-legacyorg.mockitomockito-all1.8.5org.codehaus.mojocobertura-maven-pluginorg.apache.maven.pluginsmaven-compiler-plugin1.6UTF-8org.apache.maven.pluginsmaven-javadoc-pluginattach-javadocpackagejar
http://java.sun.com/j2se/1.5/docs/api
utf-8utf-8org.apache.maven.pluginsmaven-source-pluginattach-sourcespackagejarmaven-surefire-plugin2.4.2oncetruetruetrue-Duser.language=pt -Duser.country=BRjava.awt.headlesstruerun unit teststesttestfalse
**/integration/**/*.java
org.apache.maven.pluginsmaven-eclipse-plugin2.8.settings/org.eclipse.core.resources.prefs=UTF-8${line.separator}]]>${basedir}
http://svn.apache.org/repos/asf/maven/plugins/trunk/maven-eclipse-plugin/src/optional/eclipse-config/maven-styles.xml
org.apache.maven.pluginsmaven-compiler-plugin2.3.2org.apache.maven.pluginsmaven-surefire-pluginorg.apache.maven.pluginsmaven-javadoc-plugin2.8org.apache.maven.pluginsmaven-source-plugin2.1.2org.apache.maven.pluginsmaven-assembly-plugin2.2-beta-2
src/main/assembly/assembly-bin.xml
src/main/assembly/assembly-src.xml
fabiokungFabio Kungfabio.kung@caelum.com.brCaelumhttp://www.caelum.com.bradministratordeveloper-3peassPaulo Silveirapaulo.silveira@caelum.com.brCaelumhttp://www.caelum.com.brproject owneradministratordeveloper-3TuriniRodrigo Turinirodrigo.turini@caelum.com.brCaelumhttp://www.caelum.com.brdeveloper-3lucascsLucas Cavalcantilucas.cavalcanti@caelum.com.brCaelumhttp://www.caelum.com.brdeveloper-3jonasabreuJonas Abreujonas.abreu@caelum.com.brCaelumhttp://www.caelum.com.brdeveloper-3gui0rafaGuilherme Moreiraguilherme.moreira@caelum.com.brCaelumhttp://www.caelum.com.brdeveloper-3leobessaLeonardo Bessaleonardo.bessa@caelum.com.brCaelumhttp://www.caelum.com.brdeveloper-3cairesCaires Santoscaires.santos@caelum.com.brCaelumhttp://www.caelum.com.brdeveloper-3caueguerraCaue Haucke Porta Guerracaue.guerra@caelum.com.brCaelumhttp://www.caelum.com.brdeveloper-3marioftsMario do Amaral Gonçalvesmario.amaral@caelum.com.brCaelumhttp://www.caelum.com.brdeveloper-3Alberto Souzaasouza@settech.com.brhttp://www.settech.com.br/blogMateus Padromateush.prado@gmail.comRafael Carvalhorafael.c.carvalho@gmail.comApache 2.0Copyright CaelumLICENSE.txtintegration
maven-surefire-plugin
run integration teststesttestfalse
**/integration/**/*Test.java
scm:git:git://github.com/caelum/caelum-stellascm:git:git@github.com:caelum/caelum-stella.githttps://github.com/caelum/caelum-stellaUsers list
http://lists.sourceforge.net/lists/listinfo/caelum-stella-users
http://lists.sourceforge.net/lists/listinfo/caelum-stella-users
http://lists.sourceforge.net/lists/listinfo/caelum-stella-users
Developers list
http://lists.sourceforge.net/lists/listinfo/caelum-stella-devel
http://lists.sourceforge.net/lists/listinfo/caelum-stella-devel
http://lists.sourceforge.net/lists/listinfo/caelum-stella-devel
org.apache.maven.pluginsmaven-javadoc-plugin2.8org.apache.maven.pluginsmaven-surefire-plugin2.8.1org.codehaus.mojocobertura-maven-plugin2.5org.apache.maven.pluginsmaven-jxr-plugin2.2org.codehaus.mojochangelog-maven-plugin2.0-beta-1
Mensagem de erro:
Exception in thread "main" java.lang.NoClassDefFoundError: net/sf/jasperreports/engine/JRException
at teste.teste2.App.main(App.java:65)
Caused by: java.lang.ClassNotFoundException: net.sf.jasperreports.engine.JRException
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 1 more
Apos a configuração do pow.xml de acordo com o model descrito no manual. A bibliteca apresentou um erro e não gerou o pdf .
Codigo package teste.teste2;
import br.com.caelum.stella.boleto.Banco; import br.com.caelum.stella.boleto.Beneficiario; import br.com.caelum.stella.boleto.Boleto; import br.com.caelum.stella.boleto.Datas; import br.com.caelum.stella.boleto.Endereco; import br.com.caelum.stella.boleto.Pagador; import br.com.caelum.stella.boleto.bancos.BancoDoBrasil; import br.com.caelum.stella.boleto.bancos.Itau; import br.com.caelum.stella.boleto.transformer.GeradorDeBoleto;
public class App { public static void main( String[] args ) { Datas datas = Datas.novasDatas() .comDocumento(1, 5, 2008) .comProcessamento(1, 5, 2008) .comVencimento(2, 5, 2008);
// Banco banco = new Itau(); Banco banco = new BancoDoBrasil();
}
Pow.xml
Mensagem de erro: Exception in thread "main" java.lang.NoClassDefFoundError: net/sf/jasperreports/engine/JRException at teste.teste2.App.main(App.java:65) Caused by: java.lang.ClassNotFoundException: net.sf.jasperreports.engine.JRException at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 1 more